text1
stringlengths 0
536k
| text2
stringlengths 0
536k
| label
int64 0
1
|
---|---|---|
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">ansible-vault</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.0.0
config file =
configured module search path = Default w/o overrides
python version = 2.7.13 (default, Dec 18 2016, 07:03:39) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]"><pre class="notranslate"><code class="notranslate">ansible 2.3.0.0
config file =
configured module search path = Default w/o overrides
python version = 2.7.13 (default, Dec 18 2016, 07:03:39) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">n/a</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Have reproduced this on latest OS X and CentOS 6.8 Docker image</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">ansible-vault is no longer using the <code class="notranslate">-</code> argument for --output. Based on the output, it seems like it thinks the <code class="notranslate">-</code> is the literal name of the output file.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">echo myPassword | ansible-vault encrypt --output=-</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">On < 2.3, the following output is seen:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Vault password:
$ANSIBLE_VAULT;1.1;AES256
32663537353138656134386139666466306466316530653432353734386632343531663132636539
3635303239373734303161613630663163613264303730350a633466376433363934356534326464
32663736393037313830316336363339633235383464313030653264613833386664346130363934
3234346139656432300a633738383737623162313930663462636665353332376265633361356336
6565
Encryption successful"><pre class="notranslate"><code class="notranslate">Vault password:
$ANSIBLE_VAULT;1.1;AES256
32663537353138656134386139666466306466316530653432353734386632343531663132636539
3635303239373734303161613630663163613264303730350a633466376433363934356534326464
32663736393037313830316336363339633235383464313030653264613833386664346130363934
3234346139656432300a633738383737623162313930663462636665353332376265633361356336
6565
Encryption successful
</code></pre></div>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">On 2.3, the following output is seen:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="New Vault password:
Confirm New Vault password:
ERROR! [Errno 2] No such file or directory: '/Users/rchsu/cwd/-'"><pre class="notranslate"><code class="notranslate">New Vault password:
Confirm New Vault password:
ERROR! [Errno 2] No such file or directory: '/Users/rchsu/cwd/-'
</code></pre></div> | <h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">ansible-vault</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="→ ansible --version
ansible 2.2.1.0
config file =
configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">→ ansible --version
ansible 2.2.1.0
config file =
configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">I have no unique configuration</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">OS X El Capitan 10.11.6</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">If the first/only file I encrypt via ansible-vault is a json file (the json credentails downloaded from GCE for a service account), then ansible-playbook will not prompt for a vault password and <code class="notranslate">--ask-vault-pass</code> is not required to run a playbook successfully.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">I imagine this could work similar with anything that involves a json file, but here is what I did.</p>
<ol dir="auto">
<li>Download a GCE credentials .json file (I imagine this would work with aws or anything that uses json?).</li>
<li>Move it to be <code class="notranslate">group_vars/devboxes/credentials.json</code></li>
<li>Create the <code class="notranslate">create_vm.yml</code> playbook below and the <code class="notranslate">group_vars/devboxes/vars.yml</code> listed below.</li>
<li>Run the playbook at least once successfully <code class="notranslate">ansible-playbook create_vm.yml</code> before encrypting.
<ul dir="auto">
<li>When I tried this on another machine, it failed until I ran the playbook once with a decrypted creds.json, but then after encrypting the below behavior still occurred)</li>
</ul>
</li>
<li><code class="notranslate">ansible-vault encrypt group_vars/devboxes/credentials.json</code></li>
<li>Run the playbook again the same as in step 4
<ul dir="auto">
<li>Note that <code class="notranslate">--ask-vault-pass</code> was not required, but the decryption still occurred.</li>
</ul>
</li>
<li>(Optional) If you modify the credentials.json file (after decrypting it) and then re-encrypt it, the playbook will fail. So it doesn't seem to be storing a cached file anywhere, it just does not seem to recognize this playbook as requiring a password.</li>
</ol>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# create_vm.yml playbook
- hosts: localhost
connection: local
vars_files:
- "group_vars/devboxes/vars.yml"
gather_facts: False
tasks:
- name: "Creating virtual machine"
gce:
instance_names: my-test-instance1
zone: us-central1-a
machine_type: g1-small
image: debian-8
state: present
service_account_email: "{{ gce_service_account_email }}"
credentials_file: "{{ gce_credentials_file }}"
project_id: "{{ gce_project_id }}"
register: gce
# group_vars/devboxes/vars.yml
devboxes_gce_project_id: <GCE_PROJECT_ID>
devboxes_gce_service_account_email: <GCE_SERVICE_EMAIL>
devboxes_gce_credentials_file: "{{ playbook_dir }}/group_vars/devboxes/credentials.json""><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> create_vm.yml playbook</span>
- <span class="pl-ent">hosts</span>: <span class="pl-s">localhost</span>
<span class="pl-ent">connection</span>: <span class="pl-s">local</span>
<span class="pl-ent">vars_files</span>:
- <span class="pl-s"><span class="pl-pds">"</span>group_vars/devboxes/vars.yml<span class="pl-pds">"</span></span>
<span class="pl-ent">gather_facts</span>: <span class="pl-c1">False</span>
<span class="pl-ent">tasks</span>:
- <span class="pl-ent">name</span>: <span class="pl-s"><span class="pl-pds">"</span>Creating virtual machine<span class="pl-pds">"</span></span>
<span class="pl-ent">gce</span>:
<span class="pl-ent">instance_names</span>: <span class="pl-s">my-test-instance1</span>
<span class="pl-ent">zone</span>: <span class="pl-s">us-central1-a</span>
<span class="pl-ent">machine_type</span>: <span class="pl-s">g1-small</span>
<span class="pl-ent">image</span>: <span class="pl-s">debian-8</span>
<span class="pl-ent">state</span>: <span class="pl-s">present</span>
<span class="pl-ent">service_account_email</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ gce_service_account_email }}<span class="pl-pds">"</span></span>
<span class="pl-ent">credentials_file</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ gce_credentials_file }}<span class="pl-pds">"</span></span>
<span class="pl-ent">project_id</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ gce_project_id }}<span class="pl-pds">"</span></span>
<span class="pl-ent">register</span>: <span class="pl-s">gce</span>
<span class="pl-c"><span class="pl-c">#</span> group_vars/devboxes/vars.yml</span>
<span class="pl-ent">devboxes_gce_project_id</span>: <span class="pl-s"><GCE_PROJECT_ID></span>
<span class="pl-ent">devboxes_gce_service_account_email</span>: <span class="pl-s"><GCE_SERVICE_EMAIL></span>
<span class="pl-ent">devboxes_gce_credentials_file</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ playbook_dir }}/group_vars/devboxes/credentials.json<span class="pl-pds">"</span></span></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">I expected to ansible to give me a warning that a file was not decrypted, and require a password prompt or password file.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">I was not prompted for a password and the play completed successfully.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="→ ansible-vault encrypt group_vars/devboxes/creds.json
Vault password:
Encryption successful
→ ansible-playbook create_vm.yml
PLAY [localhost] ***************************************************************
TASK [Actually creating machine] ***********************************************
changed: [localhost]
PLAY RECAP *********************************************************************
localhost : ok=1 changed=1 unreachable=0 failed=0 "><pre class="notranslate"><code class="notranslate">→ ansible-vault encrypt group_vars/devboxes/creds.json
Vault password:
Encryption successful
→ ansible-playbook create_vm.yml
PLAY [localhost] ***************************************************************
TASK [Actually creating machine] ***********************************************
changed: [localhost]
PLAY RECAP *********************************************************************
localhost : ok=1 changed=1 unreachable=0 failed=0
</code></pre></div> | 0 |
<p dir="auto">DateTimeType, when used with the widget "text", currently duplicates the invalid error when an invalid value is entered.</p>
<p dir="auto">Also, it should be possible to configure the "invalid" messages of both the "date" and the "time" field.</p> | <p dir="auto">Suppose you have an entity "Task" with a "status" property of type Integer (stored in the database as an integer).</p>
<p dir="auto">You can define an action to set the status of a Task as:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" /**
* @ParamConverter("task", options={"mapping": {"task_id": "id"}})
*/
public function settaskstatusAction($status, Task $task) {
$em = $this->getDoctrine()->getManager();
$task->setStatus($status);
$em->persist($task);
$em->flush();
return $this->render(...);
}"><pre class="notranslate"> <span class="pl-c">/**</span>
<span class="pl-c"> * @ParamConverter("task", options={"mapping": {"task_id": "id"}})</span>
<span class="pl-c"> */</span>
<span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">settaskstatusAction</span>(<span class="pl-s1"><span class="pl-c1">$</span>status</span>, <span class="pl-smi"><span class="pl-smi">Task</span></span> <span class="pl-s1"><span class="pl-c1">$</span>task</span>) {
<span class="pl-s1"><span class="pl-c1">$</span>em</span> = <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-><span class="pl-en">getDoctrine</span>()-><span class="pl-en">getManager</span>();
<span class="pl-s1"><span class="pl-c1">$</span>task</span>-><span class="pl-en">setStatus</span>(<span class="pl-s1"><span class="pl-c1">$</span>status</span>);
<span class="pl-s1"><span class="pl-c1">$</span>em</span>-><span class="pl-en">persist</span>(<span class="pl-s1"><span class="pl-c1">$</span>task</span>);
<span class="pl-s1"><span class="pl-c1">$</span>em</span>-><span class="pl-en">flush</span>();
<span class="pl-k">return</span> <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-><span class="pl-en">render</span>(...);
}</pre></div>
<p dir="auto">This works, but if your Task has a status set to 1 and you call the action with parameter '1', the <code class="notranslate">$status</code> will contain the string '1' (which is different from the integer 1) and an update will be performed on the database without any real need for it. I noticed this by using the Loggable DoctrineExtension which then also adds a useless log entry.</p>
<p dir="auto">Of course it is easy to correct this by casting the <code class="notranslate">$status</code> value myself, but as Integer fields will be casted to int before being stored, I believe they could be casted before the comparison.</p> | 0 |
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=donnchadh" rel="nofollow">Donnchadh O Donnabhain</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-3359?redirect=false" rel="nofollow">SPR-3359</a></strong> and commented</p>
<p dir="auto">Here is a simple test case:</p>
<p dir="auto">Object testObject = new Object() {<br>
public Object getNestedObject() {<br>
return new Object() {<br>
Integer value = 0;</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" public void setIntValue(Integer value) {
this.value = value;
}
public Integer getIntValue() {
return value;
}
};
}"><pre class="notranslate"><code class="notranslate"> public void setIntValue(Integer value) {
this.value = value;
}
public Integer getIntValue() {
return value;
}
};
}
</code></pre></div>
<p dir="auto">};<br>
new org.springframework.beans.BeanWrapperImpl(testObject).setPropertyValue("nestedObject.intValue", "1");</p>
<p dir="auto">Note that it works for primitive types as it resorts to using java.beans.PropertyEditorManager.findEditor</p>
<p dir="auto">Looking at the spring sources:<br>
In PropertyEditorRegistrySupport, should there not be a line to copy<br>
defaultEditorsActive?<br>
/**</p>
<ul dir="auto">
<li>Copy the default editors registered in this instance to the given<br>
target registry.</li>
<li><code class="notranslate">@param</code> target the target registry to copy to<br>
*/<br>
protected void copyDefaultEditorsTo(PropertyEditorRegistrySupport target) {<br>
target.defaultEditors = this.defaultEditors;<br>
}</li>
</ul>
<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="398077276" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/8074" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/8074/hovercard" href="https://github.com/spring-projects/spring-framework/issues/8074">#8074</a> Bean nested properties generates exception at initialization time (<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="398077761" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/8132" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/8132/hovercard" href="https://github.com/spring-projects/spring-framework/issues/8132">#8132</a> AbstractFormController: binding of boolean inside a list does not work anymore in spring 2.0.4. in opposite to 2.0.3 (<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="398077559" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/8107" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/8107/hovercard" href="https://github.com/spring-projects/spring-framework/issues/8107">#8107</a> Nested BeanWrapperImpl may not have the default editors active. (<em><strong>"is duplicated by"</strong></em>)</li>
</ul> | <p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=simonwg" rel="nofollow">Simon Wong</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9464?redirect=false" rel="nofollow">SPR-9464</a></strong> and commented</p>
<p dir="auto">The issue could be revealed if MyBatis for Spring is used.</p>
<p dir="auto">MapperScannerConfigurer in MyBatis for Spring v1.1.0+ has changed to use BeanDefinitionRegistryPostProcessor instead of BeanFactoryPostProcessor as of v1.0.x for scanning MyBatis mapper resources.</p>
<p dir="auto">The case is postProcessBeanDefinitionRegistry(BeanDefinitionRegistry beanDefinitionRegistry) is not called by Spring container if MapperScannerConfigurer is created through <code class="notranslate">@Bean</code> (but it will be called if the bean is created through XML configuration)</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1.1</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/19798/TestSpring31MyBatis.zip" rel="nofollow">TestSpring31MyBatis.zip</a> (<em>10.58 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="398109541" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12525" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12525/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12525">#12525</a> BeanDefinitionRegistryPostProcessor registered via <code class="notranslate">@Bean</code> will not be invoked (<em><strong>"duplicates"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398111929" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12917" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12917/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12917">#12917</a> BeanFactoryPostProcessor breaks default post-processing of <code class="notranslate">@Configuration</code> classes</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-attic/spring-framework-issues/commit/a1584d7aa1906ab06ffe0dc8161c187647c8f6cc/hovercard" href="https://github.com/spring-attic/spring-framework-issues/commit/a1584d7aa1906ab06ffe0dc8161c187647c8f6cc">spring-attic/spring-framework-issues@<tt>a1584d7</tt></a></p> | 0 |
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="trait Foo { fn foo(&self); }
macro_rules! foo {
() => ();
($a:expr, $($n:expr,)*) => (
impl Foo for [(); $a] {
fn foo(&self) {
// Okay
let baz: [i32; $a] = [$($n),*];
// ICE
let bar = [$($n),*];
}
}
foo!($($n,)*);
)
}
foo!(3, 2, 1, 0,);
fn main() {}"><pre class="notranslate"><span class="pl-k">trait</span> <span class="pl-smi">Foo</span> <span class="pl-kos">{</span> <span class="pl-k">fn</span> <span class="pl-en">foo</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-kos">}</span>
<span class="pl-k">macro_rules!</span> foo <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>$a<span class="pl-kos">:</span>expr, $<span class="pl-kos">(</span>$n<span class="pl-kos">:</span>expr,<span class="pl-kos">)</span><span class="pl-c1">*</span><span class="pl-kos">)</span> => <span class="pl-kos">(</span>
<span class="pl-k">impl</span> <span class="pl-v">Foo</span> <span class="pl-k">for</span> <span class="pl-kos">[</span><span class="pl-kos">(</span><span class="pl-kos">)</span>; $a<span class="pl-kos">]</span> <span class="pl-kos">{</span>
<span class="pl-k">fn</span> foo<span class="pl-kos">(</span>&<span class="pl-smi">self</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// Okay</span>
<span class="pl-k">let</span> baz: <span class="pl-kos">[</span><span class="pl-smi">i32</span>; $a<span class="pl-kos">]</span> = <span class="pl-kos">[</span>$<span class="pl-kos">(</span>$n<span class="pl-kos">)</span>,<span class="pl-c1">*</span><span class="pl-kos">]</span>;
<span class="pl-c">// ICE</span>
<span class="pl-k">let</span> bar = <span class="pl-kos">[</span>$<span class="pl-kos">(</span>$n<span class="pl-kos">)</span>,<span class="pl-c1">*</span><span class="pl-kos">]</span>;
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
foo!<span class="pl-kos">(</span>$<span class="pl-kos">(</span>$n,<span class="pl-kos">)</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">foo</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-c1">3</span>, <span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-c1">0</span>,<span class="pl-kos">)</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-kos">}</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<anon>:11:27: 11:36 error: internal compiler error: cat_expr Errd
<anon>:11 let bar = [$($n),*];
^~~~~~~~~"><pre class="notranslate"><code class="notranslate"><anon>:11:27: 11:36 error: internal compiler error: cat_expr Errd
<anon>:11 let bar = [$($n),*];
^~~~~~~~~
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc 1.0.0-nightly (91bdf23f5 2015-03-09) (built 2015-03-09)"><pre class="notranslate"><code class="notranslate">rustc 1.0.0-nightly (91bdf23f5 2015-03-09) (built 2015-03-09)
</code></pre></div> | <p dir="auto">Test case:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fn main() { []; }"><pre class="notranslate"><code class="notranslate">fn main() { []; }
</code></pre></div>
<p dir="auto">Output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ RUST_BACKTRACE=1 rustc test.rs
test.rs:1:13: 1:15 error: internal compiler error: cat_expr Errd
test.rs:1 fn main() { []; }
^~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:129
stack backtrace:
1: 0xcc029720 - sys::backtrace::write::h66f3f2784d0f6c5ddgA
2: 0xcc051b80 - panicking::on_panic::h6fdde9e4e9166fe6jaJ
3: 0xcbf91c30 - rt::unwind::begin_unwind_inner::hba10c536ef2aae75MQI
4: 0xc92a10c0 - rt::unwind::begin_unwind::h11287547919384241778
5: 0xc92a1050 - diagnostic::SpanHandler::span_bug::h551f703868554ecfUBD
6: 0xc9e32fe0 - session::Session::span_bug::h10f6b5fdbea6485fbjp
7: 0xcb6c5920 - check::regionck::visit_expr::hc78138689559ecf8Yrd
8: 0xcb6c35c0 - check::regionck::Rcx<'a, 'tcx>::visit_fn_body::h75e2fac33dc50b43a4c
9: 0xcb75ee50 - check::check_bare_fn::hf42e5aabaa5cb880Oan
10: 0xcb756f40 - check::check_item::hdbe569c101f96905stn
11: 0xcb822f10 - check_crate::closure.36015
12: 0xcb81d9c0 - check_crate::h9d44bf3fde687089EXB
13: 0xcc6a38c0 - driver::phase_3_run_analysis_passes::h36c633d41f11ca74wFa
14: 0xcc689ec0 - driver::compile_input::h0de317319ab5c701Hba
15: 0xcc754e20 - run_compiler::hffa0c0711e361de8E5b
16: 0xcc753720 - thunk::F.Invoke<A, R>::invoke::h12673221910893163557
17: 0xcc752610 - rt::unwind::try::try_fn::h15130568597725528481
18: 0xcc0bd740 - rust_try_inner
19: 0xcc0bd730 - rust_try
20: 0xcc752910 - thunk::F.Invoke<A, R>::invoke::h3924406537784056782
21: 0xcc03d990 - sys::thread::thread_start::h3734be2229bd3edegEE
22: 0xc5f650c0 - start_thread
23: 0xcbc0a449 - __clone
24: 0x0 - <unknown>"><pre class="notranslate"><code class="notranslate">$ RUST_BACKTRACE=1 rustc test.rs
test.rs:1:13: 1:15 error: internal compiler error: cat_expr Errd
test.rs:1 fn main() { []; }
^~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:129
stack backtrace:
1: 0xcc029720 - sys::backtrace::write::h66f3f2784d0f6c5ddgA
2: 0xcc051b80 - panicking::on_panic::h6fdde9e4e9166fe6jaJ
3: 0xcbf91c30 - rt::unwind::begin_unwind_inner::hba10c536ef2aae75MQI
4: 0xc92a10c0 - rt::unwind::begin_unwind::h11287547919384241778
5: 0xc92a1050 - diagnostic::SpanHandler::span_bug::h551f703868554ecfUBD
6: 0xc9e32fe0 - session::Session::span_bug::h10f6b5fdbea6485fbjp
7: 0xcb6c5920 - check::regionck::visit_expr::hc78138689559ecf8Yrd
8: 0xcb6c35c0 - check::regionck::Rcx<'a, 'tcx>::visit_fn_body::h75e2fac33dc50b43a4c
9: 0xcb75ee50 - check::check_bare_fn::hf42e5aabaa5cb880Oan
10: 0xcb756f40 - check::check_item::hdbe569c101f96905stn
11: 0xcb822f10 - check_crate::closure.36015
12: 0xcb81d9c0 - check_crate::h9d44bf3fde687089EXB
13: 0xcc6a38c0 - driver::phase_3_run_analysis_passes::h36c633d41f11ca74wFa
14: 0xcc689ec0 - driver::compile_input::h0de317319ab5c701Hba
15: 0xcc754e20 - run_compiler::hffa0c0711e361de8E5b
16: 0xcc753720 - thunk::F.Invoke<A, R>::invoke::h12673221910893163557
17: 0xcc752610 - rt::unwind::try::try_fn::h15130568597725528481
18: 0xcc0bd740 - rust_try_inner
19: 0xcc0bd730 - rust_try
20: 0xcc752910 - thunk::F.Invoke<A, R>::invoke::h3924406537784056782
21: 0xcc03d990 - sys::thread::thread_start::h3734be2229bd3edegEE
22: 0xc5f650c0 - start_thread
23: 0xcbc0a449 - __clone
24: 0x0 - <unknown>
</code></pre></div>
<p dir="auto">Compiler version:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc 1.0.0-nightly (b47aebe3f 2015-02-26) (built 2015-02-27)
binary: rustc
commit-hash: b47aebe3fc2da06c760fd8ea19f84cbc41d34831
commit-date: 2015-02-26
build-date: 2015-02-27
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly"><pre class="notranslate"><code class="notranslate">rustc 1.0.0-nightly (b47aebe3f 2015-02-26) (built 2015-02-27)
binary: rustc
commit-hash: b47aebe3fc2da06c760fd8ea19f84cbc41d34831
commit-date: 2015-02-26
build-date: 2015-02-27
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly
</code></pre></div>
<p dir="auto">I modified the test case in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="59341575" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/22894" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/22894/hovercard" href="https://github.com/rust-lang/rust/issues/22894">#22894</a> by moving the <code class="notranslate">&*""</code> into <code class="notranslate">fn main()</code>, and I saw the same ICE. I then changed the <code class="notranslate">""</code> to the similar <code class="notranslate">&[]</code>, and I saw an ICE with a different error message and a different stack trace (e.g. phase 3 instead of phase 4). The <code class="notranslate">&</code> and <code class="notranslate">*</code> are unnecessary.</p>
<p dir="auto">I also see the <code class="notranslate">cat_expr Errd</code> message in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="56894364" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/22037" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/22037/hovercard" href="https://github.com/rust-lang/rust/issues/22037">#22037</a>, but there are differences -- this issue happens in phase 3 rather than 4, and there is no "fictitious type" message.</p> | 1 |
<p dir="auto">Currently, using app.test_client() together with multi-threaded environment will fail:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from concurrent.futures import ThreadPoolExecutor
from flask import Flask, jsonify
app = Flask(__name__)
@app.route("/info")
def info():
return jsonify({"status": "success"})
app.testing = True
with app.test_client() as client:
def check(*args):
return client.get("/info")
with ThreadPoolExecutor(5) as tpe:
print(tpe.map(check, range(5)))"><pre class="notranslate"><code class="notranslate">from concurrent.futures import ThreadPoolExecutor
from flask import Flask, jsonify
app = Flask(__name__)
@app.route("/info")
def info():
return jsonify({"status": "success"})
app.testing = True
with app.test_client() as client:
def check(*args):
return client.get("/info")
with ThreadPoolExecutor(5) as tpe:
print(tpe.map(check, range(5)))
</code></pre></div>
<p dir="auto">with</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
File "/Users/X/.pyenv/versions/flow-venv-3.9/lib/python3.9/site-packages/flask/ctx.py", line 399, in pop
self.app.do_teardown_request(exc)
File "/Users/X/.pyenv/versions/flow-venv-3.9/lib/python3.9/site-packages/flask/app.py", line 2370, in do_teardown_request
for name in chain(request.blueprints, (None,)):
File "/Users/X/.pyenv/versions/flow-venv-3.9/lib/python3.9/site-packages/werkzeug/local.py", line 316, in __get__
obj = instance._get_current_object() # type: ignore[misc]
File "/Users/X/.pyenv/versions/flow-venv-3.9/lib/python3.9/site-packages/werkzeug/local.py", line 513, in _get_current_object
raise RuntimeError(unbound_message) from None
RuntimeError: Working outside of request context."><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
File "/Users/X/.pyenv/versions/flow-venv-3.9/lib/python3.9/site-packages/flask/ctx.py", line 399, in pop
self.app.do_teardown_request(exc)
File "/Users/X/.pyenv/versions/flow-venv-3.9/lib/python3.9/site-packages/flask/app.py", line 2370, in do_teardown_request
for name in chain(request.blueprints, (None,)):
File "/Users/X/.pyenv/versions/flow-venv-3.9/lib/python3.9/site-packages/werkzeug/local.py", line 316, in __get__
obj = instance._get_current_object() # type: ignore[misc]
File "/Users/X/.pyenv/versions/flow-venv-3.9/lib/python3.9/site-packages/werkzeug/local.py", line 513, in _get_current_object
raise RuntimeError(unbound_message) from None
RuntimeError: Working outside of request context.
</code></pre></div>
<p dir="auto">Obviously, this can be solved by running the app as standalone (see <a href="http://www.prschmid.com/2013/01/multi-threaded-unit-test-for-flask-rest.html" rel="nofollow">http://www.prschmid.com/2013/01/multi-threaded-unit-test-for-flask-rest.html</a>), but then I have to add manual error control and re-rise and do not get proper tracebacks while testing, and code coverage is also not given.</p> | <p dir="auto">The following code defines a simple app, and queries it from a test that uses threads:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import threading
from flask import Flask
import pytest
def create_app():
app = Flask(__name__)
@app.route("/hi", methods=["POST"])
def hello():
return "Hello, World!"
return app
@pytest.fixture()
def app():
app = create_app()
yield app
@pytest.fixture()
def client(app):
with app.test_client() as client:
yield client
def test_request_example(client):
successes = 0
def f():
nonlocal successes
response = client.post("/hi")
assert "Hello, World!" == response.text
successes += 1
thread = threading.Thread(target=f)
thread.start()
thread.join()
f()
assert successes == 2"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">threading</span>
<span class="pl-k">from</span> <span class="pl-s1">flask</span> <span class="pl-k">import</span> <span class="pl-v">Flask</span>
<span class="pl-k">import</span> <span class="pl-s1">pytest</span>
<span class="pl-k">def</span> <span class="pl-en">create_app</span>():
<span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-v">Flask</span>(<span class="pl-s1">__name__</span>)
<span class="pl-en">@<span class="pl-s1">app</span>.<span class="pl-en">route</span>(<span class="pl-s">"/hi"</span>, <span class="pl-s1">methods</span><span class="pl-c1">=</span>[<span class="pl-s">"POST"</span>])</span>
<span class="pl-k">def</span> <span class="pl-en">hello</span>():
<span class="pl-k">return</span> <span class="pl-s">"Hello, World!"</span>
<span class="pl-k">return</span> <span class="pl-s1">app</span>
<span class="pl-en">@<span class="pl-s1">pytest</span>.<span class="pl-en">fixture</span>()</span>
<span class="pl-k">def</span> <span class="pl-en">app</span>():
<span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-en">create_app</span>()
<span class="pl-k">yield</span> <span class="pl-s1">app</span>
<span class="pl-en">@<span class="pl-s1">pytest</span>.<span class="pl-en">fixture</span>()</span>
<span class="pl-k">def</span> <span class="pl-en">client</span>(<span class="pl-s1">app</span>):
<span class="pl-k">with</span> <span class="pl-s1">app</span>.<span class="pl-en">test_client</span>() <span class="pl-k">as</span> <span class="pl-s1">client</span>:
<span class="pl-k">yield</span> <span class="pl-s1">client</span>
<span class="pl-k">def</span> <span class="pl-en">test_request_example</span>(<span class="pl-s1">client</span>):
<span class="pl-s1">successes</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>
<span class="pl-k">def</span> <span class="pl-en">f</span>():
<span class="pl-k">nonlocal</span> <span class="pl-s1">successes</span>
<span class="pl-s1">response</span> <span class="pl-c1">=</span> <span class="pl-s1">client</span>.<span class="pl-en">post</span>(<span class="pl-s">"/hi"</span>)
<span class="pl-k">assert</span> <span class="pl-s">"Hello, World!"</span> <span class="pl-c1">==</span> <span class="pl-s1">response</span>.<span class="pl-s1">text</span>
<span class="pl-s1">successes</span> <span class="pl-c1">+=</span> <span class="pl-c1">1</span>
<span class="pl-s1">thread</span> <span class="pl-c1">=</span> <span class="pl-s1">threading</span>.<span class="pl-v">Thread</span>(<span class="pl-s1">target</span><span class="pl-c1">=</span><span class="pl-s1">f</span>)
<span class="pl-s1">thread</span>.<span class="pl-en">start</span>()
<span class="pl-s1">thread</span>.<span class="pl-en">join</span>()
<span class="pl-en">f</span>()
<span class="pl-k">assert</span> <span class="pl-s1">successes</span> <span class="pl-c1">==</span> <span class="pl-c1">2</span></pre></div>
<p dir="auto">When running with pytest on Flask 2.1.3, this test passes:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="========================================================================= test session starts ==========================================================================
platform linux -- Python 3.9.2, pytest-7.1.2, pluggy-0.13.0
rootdir: /home/dev/swh-environment/swh-indexer, configfile: pytest.ini
plugins: asyncio-0.18.3, requests-mock-1.9.3, django-4.5.2, xdist-2.5.0, swh.core-2.13, mock-3.8.2, django-test-migrations-1.2.0, flask-1.2.0, redis-2.4.0, hypothesis-6.49.1, cov-3.0.0, subtesthack-0.1.2, forked-1.3.0, postgresql-3.1.3, swh.journal-0.8.1.dev3+gf92d4ac
asyncio: mode=strict
collected 1 item
test_flask_threads.py . [100%]
===================================================================== 1 passed, 1 warning in 0.02s ====================================================================="><pre class="notranslate"><code class="notranslate">========================================================================= test session starts ==========================================================================
platform linux -- Python 3.9.2, pytest-7.1.2, pluggy-0.13.0
rootdir: /home/dev/swh-environment/swh-indexer, configfile: pytest.ini
plugins: asyncio-0.18.3, requests-mock-1.9.3, django-4.5.2, xdist-2.5.0, swh.core-2.13, mock-3.8.2, django-test-migrations-1.2.0, flask-1.2.0, redis-2.4.0, hypothesis-6.49.1, cov-3.0.0, subtesthack-0.1.2, forked-1.3.0, postgresql-3.1.3, swh.journal-0.8.1.dev3+gf92d4ac
asyncio: mode=strict
collected 1 item
test_flask_threads.py . [100%]
===================================================================== 1 passed, 1 warning in 0.02s =====================================================================
</code></pre></div>
<p dir="auto">However, when running with Flask 2.2.0:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="========================================================================= test session starts ==========================================================================
platform linux -- Python 3.9.2, pytest-7.1.2, pluggy-0.13.0
rootdir: /home/dev/swh-environment/swh-indexer, configfile: pytest.ini
plugins: asyncio-0.18.3, requests-mock-1.9.3, django-4.5.2, xdist-2.5.0, swh.core-2.13, mock-3.8.2, django-test-migrations-1.2.0, flask-1.2.0, redis-2.4.0, hypothesis-6.49.1, cov-3.0.0, subtesthack-0.1.2, forked-1.3.0, postgresql-3.1.3, swh.journal-0.8.1.dev3+gf92d4ac
asyncio: mode=strict
collected 1 item
test_flask_threads.py F [100%]
=============================================================================== FAILURES ===============================================================================
_________________________________________________________________________ test_request_example _________________________________________________________________________
self = <contextlib.ExitStack object at 0x7fc444b63b20>
exc_details = (<class 'ValueError'>, ValueError("<Token var=<ContextVar name='flask.request_ctx' at 0x7fc44844a1d0> at 0x7fc444a18a80> was created in a different Context"), <traceback object at 0x7fc444a18d40>)
received_exc = False, _fix_exception_context = <function ExitStack.__exit__.<locals>._fix_exception_context at 0x7fc444a7edc0>, suppressed_exc = False
def __exit__(self, *exc_details):
received_exc = exc_details[0] is not None
# We manipulate the exception state so it behaves as though
# we were actually nesting multiple with statements
frame_exc = sys.exc_info()[1]
def _fix_exception_context(new_exc, old_exc):
# Context may not be correct, so find the end of the chain
while 1:
exc_context = new_exc.__context__
if exc_context is old_exc:
# Context is already set correctly (see issue 20317)
return
if exc_context is None or exc_context is frame_exc:
break
new_exc = exc_context
# Change the end of the chain to point to the exception
# we expect it to reference
new_exc.__context__ = old_exc
# Callbacks are invoked in LIFO order to match the behaviour of
# nested context managers
suppressed_exc = False
pending_raise = False
while self._exit_callbacks:
is_sync, cb = self._exit_callbacks.pop()
assert is_sync
try:
> if cb(*exc_details):
/usr/lib/python3.9/contextlib.py:498:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <flask.ctx.AppContext object at 0x7fc444b75730>, exc_type = None, exc_value = None, tb = None
def __exit__(
self,
exc_type: t.Optional[type],
exc_value: t.Optional[BaseException],
tb: t.Optional[TracebackType],
) -> None:
> self.pop(exc_value)
../../.local/lib/python3.9/site-packages/flask/ctx.py:275:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <flask.ctx.AppContext object at 0x7fc444b75730>, exc = None
def pop(self, exc: t.Optional[BaseException] = _sentinel) -> None: # type: ignore
"""Pops the app context."""
try:
if len(self._cv_tokens) == 1:
if exc is _sentinel:
exc = sys.exc_info()[1]
self.app.do_teardown_appcontext(exc)
finally:
ctx = _cv_app.get()
> _cv_app.reset(self._cv_tokens.pop())
E ValueError: <Token var=<ContextVar name='flask.app_ctx' at 0x7fc44844f090> at 0x7fc444a18ac0> was created in a different Context
../../.local/lib/python3.9/site-packages/flask/ctx.py:256: ValueError
During handling of the above exception, another exception occurred:
client = <FlaskClient <Flask 'test_flask_threads'>>
def test_request_example(client):
successes = 0
def f():
nonlocal successes
response = client.post("/hi")
assert "Hello, World!" == response.text
successes += 1
thread = threading.Thread(target=f)
thread.start()
thread.join()
> f()
test_flask_threads.py:42:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_flask_threads.py:34: in f
response = client.post("/hi")
../../.local/lib/python3.9/site-packages/werkzeug/test.py:1140: in post
return self.open(*args, **kw)
../../.local/lib/python3.9/site-packages/flask/testing.py:221: in open
self._context_stack.close()
/usr/lib/python3.9/contextlib.py:521: in close
self.__exit__(None, None, None)
/usr/lib/python3.9/contextlib.py:513: in __exit__
raise exc_details[1]
/usr/lib/python3.9/contextlib.py:498: in __exit__
if cb(*exc_details):
../../.local/lib/python3.9/site-packages/flask/ctx.py:432: in __exit__
self.pop(exc_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <RequestContext 'http://localhost/hi' [POST] of test_flask_threads>
exc = ValueError("<Token var=<ContextVar name='flask.app_ctx' at 0x7fc44844f090> at 0x7fc444a18ac0> was created in a different Context")
def pop(self, exc: t.Optional[BaseException] = _sentinel) -> None: # type: ignore
"""Pops the request context and unbinds it by doing that. This will
also trigger the execution of functions registered by the
:meth:`~flask.Flask.teardown_request` decorator.
.. versionchanged:: 0.9
Added the `exc` argument.
"""
clear_request = len(self._cv_tokens) == 1
try:
if clear_request:
if exc is _sentinel:
exc = sys.exc_info()[1]
self.app.do_teardown_request(exc)
request_close = getattr(self.request, "close", None)
if request_close is not None:
request_close()
finally:
ctx = _cv_request.get()
token, app_ctx = self._cv_tokens.pop()
> _cv_request.reset(token)
E ValueError: <Token var=<ContextVar name='flask.request_ctx' at 0x7fc44844a1d0> at 0x7fc444a18a80> was created in a different Context
../../.local/lib/python3.9/site-packages/flask/ctx.py:407: ValueError
======================================================================= short test summary info ========================================================================
FAILED test_flask_threads.py::test_request_example - ValueError: <Token var=<ContextVar name='flask.request_ctx' at 0x7fc44844a1d0> at 0x7fc444a18a80> was created in...
===================================================================== 1 failed, 1 warning in 0.11s ====================================================================="><pre class="notranslate"><code class="notranslate">========================================================================= test session starts ==========================================================================
platform linux -- Python 3.9.2, pytest-7.1.2, pluggy-0.13.0
rootdir: /home/dev/swh-environment/swh-indexer, configfile: pytest.ini
plugins: asyncio-0.18.3, requests-mock-1.9.3, django-4.5.2, xdist-2.5.0, swh.core-2.13, mock-3.8.2, django-test-migrations-1.2.0, flask-1.2.0, redis-2.4.0, hypothesis-6.49.1, cov-3.0.0, subtesthack-0.1.2, forked-1.3.0, postgresql-3.1.3, swh.journal-0.8.1.dev3+gf92d4ac
asyncio: mode=strict
collected 1 item
test_flask_threads.py F [100%]
=============================================================================== FAILURES ===============================================================================
_________________________________________________________________________ test_request_example _________________________________________________________________________
self = <contextlib.ExitStack object at 0x7fc444b63b20>
exc_details = (<class 'ValueError'>, ValueError("<Token var=<ContextVar name='flask.request_ctx' at 0x7fc44844a1d0> at 0x7fc444a18a80> was created in a different Context"), <traceback object at 0x7fc444a18d40>)
received_exc = False, _fix_exception_context = <function ExitStack.__exit__.<locals>._fix_exception_context at 0x7fc444a7edc0>, suppressed_exc = False
def __exit__(self, *exc_details):
received_exc = exc_details[0] is not None
# We manipulate the exception state so it behaves as though
# we were actually nesting multiple with statements
frame_exc = sys.exc_info()[1]
def _fix_exception_context(new_exc, old_exc):
# Context may not be correct, so find the end of the chain
while 1:
exc_context = new_exc.__context__
if exc_context is old_exc:
# Context is already set correctly (see issue 20317)
return
if exc_context is None or exc_context is frame_exc:
break
new_exc = exc_context
# Change the end of the chain to point to the exception
# we expect it to reference
new_exc.__context__ = old_exc
# Callbacks are invoked in LIFO order to match the behaviour of
# nested context managers
suppressed_exc = False
pending_raise = False
while self._exit_callbacks:
is_sync, cb = self._exit_callbacks.pop()
assert is_sync
try:
> if cb(*exc_details):
/usr/lib/python3.9/contextlib.py:498:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <flask.ctx.AppContext object at 0x7fc444b75730>, exc_type = None, exc_value = None, tb = None
def __exit__(
self,
exc_type: t.Optional[type],
exc_value: t.Optional[BaseException],
tb: t.Optional[TracebackType],
) -> None:
> self.pop(exc_value)
../../.local/lib/python3.9/site-packages/flask/ctx.py:275:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <flask.ctx.AppContext object at 0x7fc444b75730>, exc = None
def pop(self, exc: t.Optional[BaseException] = _sentinel) -> None: # type: ignore
"""Pops the app context."""
try:
if len(self._cv_tokens) == 1:
if exc is _sentinel:
exc = sys.exc_info()[1]
self.app.do_teardown_appcontext(exc)
finally:
ctx = _cv_app.get()
> _cv_app.reset(self._cv_tokens.pop())
E ValueError: <Token var=<ContextVar name='flask.app_ctx' at 0x7fc44844f090> at 0x7fc444a18ac0> was created in a different Context
../../.local/lib/python3.9/site-packages/flask/ctx.py:256: ValueError
During handling of the above exception, another exception occurred:
client = <FlaskClient <Flask 'test_flask_threads'>>
def test_request_example(client):
successes = 0
def f():
nonlocal successes
response = client.post("/hi")
assert "Hello, World!" == response.text
successes += 1
thread = threading.Thread(target=f)
thread.start()
thread.join()
> f()
test_flask_threads.py:42:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_flask_threads.py:34: in f
response = client.post("/hi")
../../.local/lib/python3.9/site-packages/werkzeug/test.py:1140: in post
return self.open(*args, **kw)
../../.local/lib/python3.9/site-packages/flask/testing.py:221: in open
self._context_stack.close()
/usr/lib/python3.9/contextlib.py:521: in close
self.__exit__(None, None, None)
/usr/lib/python3.9/contextlib.py:513: in __exit__
raise exc_details[1]
/usr/lib/python3.9/contextlib.py:498: in __exit__
if cb(*exc_details):
../../.local/lib/python3.9/site-packages/flask/ctx.py:432: in __exit__
self.pop(exc_value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <RequestContext 'http://localhost/hi' [POST] of test_flask_threads>
exc = ValueError("<Token var=<ContextVar name='flask.app_ctx' at 0x7fc44844f090> at 0x7fc444a18ac0> was created in a different Context")
def pop(self, exc: t.Optional[BaseException] = _sentinel) -> None: # type: ignore
"""Pops the request context and unbinds it by doing that. This will
also trigger the execution of functions registered by the
:meth:`~flask.Flask.teardown_request` decorator.
.. versionchanged:: 0.9
Added the `exc` argument.
"""
clear_request = len(self._cv_tokens) == 1
try:
if clear_request:
if exc is _sentinel:
exc = sys.exc_info()[1]
self.app.do_teardown_request(exc)
request_close = getattr(self.request, "close", None)
if request_close is not None:
request_close()
finally:
ctx = _cv_request.get()
token, app_ctx = self._cv_tokens.pop()
> _cv_request.reset(token)
E ValueError: <Token var=<ContextVar name='flask.request_ctx' at 0x7fc44844a1d0> at 0x7fc444a18a80> was created in a different Context
../../.local/lib/python3.9/site-packages/flask/ctx.py:407: ValueError
======================================================================= short test summary info ========================================================================
FAILED test_flask_threads.py::test_request_example - ValueError: <Token var=<ContextVar name='flask.request_ctx' at 0x7fc44844a1d0> at 0x7fc444a18a80> was created in...
===================================================================== 1 failed, 1 warning in 0.11s =====================================================================
</code></pre></div>
<p dir="auto">Environment:</p>
<ul dir="auto">
<li>Python version: 3.9</li>
<li>Flask version: 2.2.0</li>
</ul> | 1 |
<p dir="auto">The instructions are: "Let's delete the "tails" property from myDog."</p>
<p dir="auto">and the test being run is "Delete the property "bark" from myDog." The test should test whether the key-value pair for tails prop is removed.</p> | <p dir="auto">Challenge <a href="http://freecodecamp.com/challenges/waypoint-delete-properties-from-a-javascript-object#?solution=var%20ourDog%20%3D%20%7B%0A%20%20%22name%22%3A%20%22Camper%22%2C%0A%20%20%22legs%22%3A%204%2C%0A%20%20%22tails%22%3A%201%2C%0A%20%20%22friends%22%3A%20%5B%22everything!%22%5D%2C%0A%20%20%22bark%22%3A%20%22bow-wow%22%0A%7D%3B%0A%0Adelete%20ourDog.bark%3B%0A%0Avar%20myDog%20%3D%20%7B%0A%20%20%22name%22%3A%20%22Happy%20Coder%22%2C%0A%20%20%22legs%22%3A%204%2C%0A%20%20%22tails%22%3A%201%2C%0A%20%20%22friends%22%3A%20%5B%22Free%20Code%20Camp%20Campers%22%5D%2C%0A%20%20%22bark%22%3A%20%22woof%22%0A%7D%3B%0A%0A%2F%2F%20Only%20change%20code%20below%20this%20line.%0A%0Adelete%20myDog.bark%3B%0A%0A%2F%2F%20Only%20change%20code%20above%20this%20line.%0A%0A%28function%28z%29%7Breturn%20z%3B%7D%29%28myDog%29%3B%0A" rel="nofollow">Waypoint: Delete Properties from a JavaScript Object</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Windows NT 10.0; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0</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-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var ourDog = {
"name": "Camper",
"legs": 4,
"tails": 1,
"friends": ["everything!"],
"bark": "bow-wow"
};
delete ourDog.bark;
var myDog = {
"name": "Happy Coder",
"legs": 4,
"tails": 1,
"friends": ["Free Code Camp Campers"],
"bark": "woof"
};
// Only change code below this line.
delete myDog.bark;
// Only change code above this line.
(function(z){return z;})(myDog);
"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">ourDog</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-s">"name"</span>: <span class="pl-s">"Camper"</span><span class="pl-kos">,</span>
<span class="pl-s">"legs"</span>: <span class="pl-c1">4</span><span class="pl-kos">,</span>
<span class="pl-s">"tails"</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span>
<span class="pl-s">"friends"</span>: <span class="pl-kos">[</span><span class="pl-s">"everything!"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-s">"bark"</span>: <span class="pl-s">"bow-wow"</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">delete</span> <span class="pl-s1">ourDog</span><span class="pl-kos">.</span><span class="pl-c1">bark</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">myDog</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-s">"name"</span>: <span class="pl-s">"Happy Coder"</span><span class="pl-kos">,</span>
<span class="pl-s">"legs"</span>: <span class="pl-c1">4</span><span class="pl-kos">,</span>
<span class="pl-s">"tails"</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span>
<span class="pl-s">"friends"</span>: <span class="pl-kos">[</span><span class="pl-s">"Free Code Camp Campers"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-s">"bark"</span>: <span class="pl-s">"woof"</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-c">// Only change code below this line.</span>
<span class="pl-k">delete</span> <span class="pl-s1">myDog</span><span class="pl-kos">.</span><span class="pl-c1">bark</span><span class="pl-kos">;</span>
<span class="pl-c">// Only change code above this line.</span>
<span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">z</span><span class="pl-kos">)</span><span class="pl-kos">{</span><span class="pl-k">return</span> <span class="pl-s1">z</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">myDog</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Issue:<br>
Properties box says:<br>
"Let's delete the "tails" property from myDog."<br>
Test success statement:<br>
"Delete the property "bark" from myDog."</p>
<p dir="auto">Test succeeds on deleting bark property, not tails.</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">After updating to Angular 4 code below throws errors (Cannot read property 'instance' of undefined). It was working without any problems before update:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export` const entity = new InjectionToken<string>('entity');
export class BaseComponent {
protected entity<string>;
constructor(injector: Injector) {
...
this.entity = injector.get(entity)
}
}
@Component({
...
providers: [{provide: entity, useValue: 'whoCares'}]
})
export class InheritorComponent {
constructor(injector: Injector) {
super(injector)
}
}"><pre class="notranslate"><code class="notranslate">export` const entity = new InjectionToken<string>('entity');
export class BaseComponent {
protected entity<string>;
constructor(injector: Injector) {
...
this.entity = injector.get(entity)
}
}
@Component({
...
providers: [{provide: entity, useValue: 'whoCares'}]
})
export class InheritorComponent {
constructor(injector: Injector) {
super(injector)
}
}
</code></pre></div>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">I excepted InheritorComponent to be initialized with provided data via token.</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong></p>
<p dir="auto">Here is working example:<br>
<a href="http://plnkr.co/edit/CQLX3D5WWjixnzV5zQgN?p=preview" rel="nofollow">http://plnkr.co/edit/CQLX3D5WWjixnzV5zQgN?p=preview</a><br>
Here is unwoking (to brake it uncomment 26 line of app.ts)<br>
<a href="http://plnkr.co/edit/5yeUn0j1VxASsAD0657n?p=preview" rel="nofollow">http://plnkr.co/edit/5yeUn0j1VxASsAD0657n?p=preview</a></p>
<p dir="auto">Code is similar. The only difference is angular version.</p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>
<ul dir="auto">
<li><strong>Angular version:</strong> 4.0.X</li>
</ul>
<ul dir="auto">
<li><strong>Browser:</strong> [all ]</li>
</ul>
<ul dir="auto">
<li>
<p dir="auto"><strong>Language:</strong> [TypeScript 2.2]</p>
</li>
<li>
<p dir="auto"><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> = 6.9.2</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></p>
<p dir="auto">After updating from <code class="notranslate">4.0.0-rc.2</code> to <code class="notranslate">4.0.0</code> <code class="notranslate">Router</code> not injected as expected</p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">Should be injected as expected</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong></p>
<p dir="auto">Plunker: <a href="http://plnkr.co/edit/ogCHjeYuCDM8vNLdwAFx?p=preview" rel="nofollow">http://plnkr.co/edit/ogCHjeYuCDM8vNLdwAFx?p=preview</a></p>
<p dir="auto">Update from <code class="notranslate">4.0.0-rc.2</code> to <code class="notranslate">4.0.0</code></p>
<p dir="auto"><code class="notranslate">ConfigService</code> provided in <code class="notranslate">AppModule</code> as <code class="notranslate">APP_INITIALIZER</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" providers: [
ConfigService,
{
provide: APP_INITIALIZER,
useFactory: configServiceFactory,
deps: [ConfigService],
multi: true
}
],"><pre class="notranslate"><code class="notranslate"> providers: [
ConfigService,
{
provide: APP_INITIALIZER,
useFactory: configServiceFactory,
deps: [ConfigService],
multi: true
}
],
</code></pre></div>
<p dir="auto"><code class="notranslate">ApiService</code> injected manually from <code class="notranslate">ConfigService</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Injectable()
export class ConfigService {
private api: ApiService;
public constructor(
private injector: Injector
) {
// Avoid cyclid dependencies, inject manually:
this.api = injector.get(ApiService);
}"><pre class="notranslate"><code class="notranslate">@Injectable()
export class ConfigService {
private api: ApiService;
public constructor(
private injector: Injector
) {
// Avoid cyclid dependencies, inject manually:
this.api = injector.get(ApiService);
}
</code></pre></div>
<p dir="auto"><code class="notranslate">router</code> is undefined when injected in <code class="notranslate">ApiService</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { Http, Headers, RequestOptionsArgs, Response } from '@angular/http';
import { Router } from '@angular/router';
@Injectable()
export class ApiService {
constructor(
private router: Router,
private http: Http
) {
console.log(router, 'router'); // undefined
debugger;"><pre class="notranslate"><code class="notranslate">import { Http, Headers, RequestOptionsArgs, Response } from '@angular/http';
import { Router } from '@angular/router';
@Injectable()
export class ApiService {
constructor(
private router: Router,
private http: Http
) {
console.log(router, 'router'); // undefined
debugger;
</code></pre></div>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong></p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>
<p dir="auto">@angular/cli: 1.0.0<br>
node: 7.4.0<br>
os: win32 x64<br>
@angular/animations: 4.0.0<br>
@angular/common: 4.0.0<br>
@angular/compiler: 4.0.0<br>
@angular/compiler-cli: 4.0.0<br>
@angular/core: 4.0.0<br>
@angular/forms: 4.0.0<br>
@angular/http: 4.0.0<br>
@angular/platform-browser: 4.0.0<br>
@angular/platform-browser-dynamic: 4.0.0<br>
@angular/platform-server: 4.0.0<br>
@angular/router: 4.0.0<br>
@angular/material: 2.0.0-beta.2<br>
@angular/flex-layout: 2.0.0-rc.1<br>
@angular/cli: 1.0.0<br>
@ngtools/webpack: 1.3.0</p>
<ul dir="auto">
<li><strong>Angular version:</strong> 4.0.0</li>
</ul>
<ul dir="auto">
<li>
<p dir="auto"><strong>Browser:</strong> all</p>
</li>
<li>
<p dir="auto"><strong>Language:</strong> TypeScript 2.2.1</p>
</li>
<li>
<p dir="auto"><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> = 7.4.0</p>
</li>
</ul>
<h3 dir="auto">The log given by the failure.</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="core.es5.js:1085 ERROR TypeError: Cannot read property 'url' of undefined
at CatchSubscriber.selector (api.service.ts:127)
at CatchSubscriber.error (catch.js:104)
at MapSubscriber.Subscriber._error (Subscriber.js:128)
at MapSubscriber.Subscriber.error (Subscriber.js:102)
at XMLHttpRequest.onLoad (http.es5.js:1210)
at ZoneDelegate.invokeTask (zone.js:363)
at Object.onInvokeTask (core.es5.js:4136)
at ZoneDelegate.invokeTask (zone.js:362)
at Zone.runTask (zone.js:166)
at XMLHttpRequest.ZoneTask.invoke (zone.js:416)
defaultErrorLogger @ core.es5.js:1085
ErrorHandler.handleError @ core.es5.js:1145
next @ core.es5.js:4774
schedulerFn @ core.es5.js:3848
SafeSubscriber.__tryOrUnsub @ Subscriber.js:234
SafeSubscriber.next @ Subscriber.js:183
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ core.es5.js:3834
NgZone.triggerError @ core.es5.js:4205
onHandleError @ core.es5.js:4166
ZoneDelegate.handleError @ zone.js:334
Zone.runTask @ zone.js:169
ZoneTask.invoke @ zone.js:416
Navigated to http://localhost:4200/
core.es5.js:3053Template parse warnings:
The <template> element is deprecated. Use <ng-template> instead ("[WARNING ->]<template><div class="mat-autocomplete-panel" role="listbox" [id]="id" [ngClass]="_getClassList()" #p"): ng:///MdAutocompleteModule/MdAutocomplete.html@0:0
Console.warn @ core.es5.js:3053
TemplateParser.parse @ compiler.es5.js:11508
JitCompiler._compileTemplate @ compiler.es5.js:25195
(anonymous) @ compiler.es5.js:25119
JitCompiler._compileComponents @ compiler.es5.js:25119
createResult @ compiler.es5.js:25004
ZoneDelegate.invoke @ zone.js:330
Zone.run @ zone.js:126
(anonymous) @ zone.js:679
ZoneDelegate.invokeTask @ zone.js:363
Zone.runTask @ zone.js:166
drainMicroTaskQueue @ zone.js:529
api.service.ts:31 undefined "router""><pre class="notranslate"><code class="notranslate">core.es5.js:1085 ERROR TypeError: Cannot read property 'url' of undefined
at CatchSubscriber.selector (api.service.ts:127)
at CatchSubscriber.error (catch.js:104)
at MapSubscriber.Subscriber._error (Subscriber.js:128)
at MapSubscriber.Subscriber.error (Subscriber.js:102)
at XMLHttpRequest.onLoad (http.es5.js:1210)
at ZoneDelegate.invokeTask (zone.js:363)
at Object.onInvokeTask (core.es5.js:4136)
at ZoneDelegate.invokeTask (zone.js:362)
at Zone.runTask (zone.js:166)
at XMLHttpRequest.ZoneTask.invoke (zone.js:416)
defaultErrorLogger @ core.es5.js:1085
ErrorHandler.handleError @ core.es5.js:1145
next @ core.es5.js:4774
schedulerFn @ core.es5.js:3848
SafeSubscriber.__tryOrUnsub @ Subscriber.js:234
SafeSubscriber.next @ Subscriber.js:183
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ core.es5.js:3834
NgZone.triggerError @ core.es5.js:4205
onHandleError @ core.es5.js:4166
ZoneDelegate.handleError @ zone.js:334
Zone.runTask @ zone.js:169
ZoneTask.invoke @ zone.js:416
Navigated to http://localhost:4200/
core.es5.js:3053Template parse warnings:
The <template> element is deprecated. Use <ng-template> instead ("[WARNING ->]<template><div class="mat-autocomplete-panel" role="listbox" [id]="id" [ngClass]="_getClassList()" #p"): ng:///MdAutocompleteModule/MdAutocomplete.html@0:0
Console.warn @ core.es5.js:3053
TemplateParser.parse @ compiler.es5.js:11508
JitCompiler._compileTemplate @ compiler.es5.js:25195
(anonymous) @ compiler.es5.js:25119
JitCompiler._compileComponents @ compiler.es5.js:25119
createResult @ compiler.es5.js:25004
ZoneDelegate.invoke @ zone.js:330
Zone.run @ zone.js:126
(anonymous) @ zone.js:679
ZoneDelegate.invokeTask @ zone.js:363
Zone.runTask @ zone.js:166
drainMicroTaskQueue @ zone.js:529
api.service.ts:31 undefined "router"
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1386622/24331329/793a21a0-123a-11e7-8f57-195271c76098.png"><img src="https://cloud.githubusercontent.com/assets/1386622/24331329/793a21a0-123a-11e7-8f57-195271c76098.png" alt="2017-03-26 15_39_04-mtcrm" style="max-width: 100%;"></a></p> | 1 |
<p dir="auto">I tried getting the inverse (related to issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="437943844" data-permission-text="Title is private" data-url="https://github.com/google/jax/issues/646" data-hovercard-type="issue" data-hovercard-url="/google/jax/issues/646/hovercard" href="https://github.com/google/jax/issues/646">#646</a>), and it worked fine sort of. Here is some pseudocode of what I was trying to do.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def get_distances(...):
svd code here to get inverse matrix
return distances
def energy(params, positions, cell):
get distances, do calculation
return energy
def forces(params, positions, cell):
dedr = grad(energy, 1)
return -dedr(...) # works fine
def stress(params, position, cell):
def e0(params, positions, cell, strain):
modify positions and cell with strain
return energy(params, newpositions, newcell)
deds = grad(e0, 3)
return deds(params, positions, cell, np.zeros(3)) "><pre class="notranslate"><code class="notranslate">def get_distances(...):
svd code here to get inverse matrix
return distances
def energy(params, positions, cell):
get distances, do calculation
return energy
def forces(params, positions, cell):
dedr = grad(energy, 1)
return -dedr(...) # works fine
def stress(params, position, cell):
def e0(params, positions, cell, strain):
modify positions and cell with strain
return energy(params, newpositions, newcell)
deds = grad(e0, 3)
return deds(params, positions, cell, np.zeros(3))
</code></pre></div>
<p dir="auto">The last function gave me this error:<br>
<code class="notranslate">NotImplementedError: Forward-mode differentiation rule for 'svd' not implemented</code></p>
<p dir="auto">I guess the issue is that the strain modifies the cell, which is the array I need an inverse of, and this triggers the need for a derivative through the svd, and it is evidently not implemented.</p>
<p dir="auto">It seems like a clear error, so this is mostly a report I guess that it is not implemented. It isn't obvious where that would be done. Any hints?</p> | 1 |
|
<p dir="auto">Challenge <a href="http://freecodecamp.com/challenges/waypoint-add-alt-text-to-an-image-for-accessibility" rel="nofollow">http://freecodecamp.com/challenges/waypoint-add-alt-text-to-an-image-for-accessibility</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.</p>
<p dir="auto">I have finished the HTML5/CSS waypoints (before the updated extra waypoints), however, upon redoing them, I am still receiving points.</p> | <p dir="auto">Challenge <a href="http://freecodecamp.com/challenges/waypoint-import-a-google-font" rel="nofollow">http://freecodecamp.com/challenges/waypoint-import-a-google-font</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.</p>
<p dir="auto">I noticed new waypoints for HTML5/CSS sections. I completed some of the new ones, and just to refreshen up on some older waypoints I finished a while ago, I decided to redo some.</p>
<p dir="auto">I noticed that I was receiving points for complete the waypoints that I have already done. These were the ones that were done before the new update in the curriculum.</p> | 1 |
<h3 dir="auto">Feature request</h3>
<p dir="auto">##transformers.AutoModel.from_pretrained()## module allows to load pretrained models from local directories as well. The local pickle files path is an argument of the above function. These files can have different encoding types.</p>
<p dir="auto">A parameter called 'encoding' can be added in the parameter list similar to</p>
<p dir="auto">pandas.read_csv('path/to/csv/file',encoding='utf-8')</p>
<p dir="auto">which takes encoding type as parameter. But this proposed encoding feature must be enabled only while loading local files and should not take parameters while loading models from other sources (like HF-Hub etc).</p>
<h3 dir="auto">Motivation</h3>
<p dir="auto">I face Unicode-Decode error while loading pickled model files from local directory. To overcome this issue, the above feature would help to avoid the unicode-decode error.</p>
<h3 dir="auto">Your contribution</h3>
<p dir="auto">Unfortunately, I can't contribute now.</p> | <p dir="auto">Dear HuggingFace team,</p>
<p dir="auto">There is unfortunately no option to reopen the bugs, the issue I reported here [1] still exists with testing the last version of transformers. I add my comments on the same ticket. Could you kindly reopen this bug?</p>
<p dir="auto">The variations are very high after resume, which makes the results not usable with resuming after checkpoint, I also tried to make things deterministic in torch, but it also could not solve the issue. I study in an institution where I only have access to GPUs for short hours, and I very much appreciate your help on this issue to make training reproducible after resume from the checkpoints in trainer.</p>
<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>
<p dir="auto">[1] <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="861744931" data-permission-text="Title is private" data-url="https://github.com/huggingface/transformers/issues/11323" data-hovercard-type="issue" data-hovercard-url="/huggingface/transformers/issues/11323/hovercard" href="https://github.com/huggingface/transformers/issues/11323">#11323</a></p> | 0 |
<p dir="auto">Right now no unboxed closures are Copy, but there's no reason that 0-size closures or those with only copy captures couldn't be Copy.</p> | <h3 dir="auto">Description:</h3>
<p dir="auto">Internal compiler error with the following code:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pub trait Trait {}
impl PartialEq for Trait {
fn eq(&self, other: &Self) -> bool {
self as *const _ == other as *const _
}
}"><pre class="notranslate"><span class="pl-k">pub</span> <span class="pl-k">trait</span> <span class="pl-smi">Trait</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-k">impl</span> <span class="pl-smi">PartialEq</span> <span class="pl-k">for</span> <span class="pl-smi">Trait</span> <span class="pl-kos">{</span>
<span class="pl-k">fn</span> <span class="pl-en">eq</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-s1">other</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-smi">bool</span> <span class="pl-kos">{</span>
<span class="pl-smi">self</span> <span class="pl-k">as</span> <span class="pl-c1">*</span><span class="pl-k">const</span> <span class="pl-smi">_</span> == other <span class="pl-k">as</span> <span class="pl-c1">*</span><span class="pl-k">const</span> <span class="pl-smi">_</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Version:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="λ → rustc --version --verbose
rustc 1.2.0-nightly (2f5683913 2015-06-18)
binary: rustc
commit-hash: 2f5683913c9815d9f12494784747f79b0f3b3066
commit-date: 2015-06-18
host: x86_64-apple-darwin
release: 1.2.0-nightly"><pre class="notranslate"><code class="notranslate">λ → rustc --version --verbose
rustc 1.2.0-nightly (2f5683913 2015-06-18)
binary: rustc
commit-hash: 2f5683913c9815d9f12494784747f79b0f3b3066
commit-date: 2015-06-18
host: x86_64-apple-darwin
release: 1.2.0-nightly
</code></pre></div>
<h3 dir="auto">Backtrace:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="thread 'rustc' panicked at 'assertion failed: self.appropriate_rvalue_mode(bcx.ccx()) == ByValue', ../src/librustc_trans/trans/datum.rs:635
stack backtrace:
1: 0x10692f625 - sys::backtrace::write::h7217b77d522d376bzns
2: 0x1069388c6 - panicking::on_panic::h734ff7875f002408HHw
3: 0x1068eeff8 - rt::unwind::begin_unwind_inner::h12ac9fe1c7c1af05Tpw
4: 0x102dec3ff - rt::unwind::begin_unwind::h9456661013370349045
5: 0x102e84628 - trans::datum::Datum<'tcx, K>::to_llscalarish::h2090742821809817825
6: 0x102f0c3d7 - trans::expr::trans_binary::h18b1ae4d157c7559UOC
7: 0x102f0041a - trans::expr::trans_unadjusted::hb8364de9ecf82122hiB
8: 0x102ed7a4c - trans::expr::trans_into::h37bf0f4f595d93d16DA
9: 0x102e54d10 - trans::controlflow::trans_block::h4fbfe9e245dfbc46Ruv
10: 0x102e5363a - trans::base::trans_closure::h34071d9a784d8f1cLWh
11: 0x102e5533e - trans::base::trans_fn::h8b60fc728b696b76t7h
12: 0x102e5914c - trans::base::trans_item::haac7f69fe6a753f8Yvi
13: 0x102e66cfb - trans::base::trans_crate::hb1800db125dfa8773jj
14: 0x102cbb42f - driver::phase_4_translate_to_llvm::ha90b5a4585d4395fBOa
15: 0x102c93f4f - driver::compile_input::hc7efa8e10e996fb1Tba
16: 0x102d56449 - run_compiler::hd964f53796cdaa72G7b
17: 0x102d5393f - boxed::F.FnBox<A>::call_box::h1390611659955526416
18: 0x102d53087 - rt::unwind::try::try_fn::h7096656292409969094
19: 0x1069c8db8 - rust_try_inner
20: 0x1069c8da5 - rust_try
21: 0x106921075 - rt::unwind::try::inner_try::had4cdff9eafcbf1fMlw
22: 0x102d532d2 - boxed::F.FnBox<A>::call_box::h7809183391410762880
23: 0x10693729d - sys::thread::Thread::new::thread_start::hd1c42fff9d20c3856Jv
24: 0x7fff95422267 - _pthread_body
25: 0x7fff954221e4 - _pthread_start"><pre class="notranslate"><code class="notranslate">thread 'rustc' panicked at 'assertion failed: self.appropriate_rvalue_mode(bcx.ccx()) == ByValue', ../src/librustc_trans/trans/datum.rs:635
stack backtrace:
1: 0x10692f625 - sys::backtrace::write::h7217b77d522d376bzns
2: 0x1069388c6 - panicking::on_panic::h734ff7875f002408HHw
3: 0x1068eeff8 - rt::unwind::begin_unwind_inner::h12ac9fe1c7c1af05Tpw
4: 0x102dec3ff - rt::unwind::begin_unwind::h9456661013370349045
5: 0x102e84628 - trans::datum::Datum<'tcx, K>::to_llscalarish::h2090742821809817825
6: 0x102f0c3d7 - trans::expr::trans_binary::h18b1ae4d157c7559UOC
7: 0x102f0041a - trans::expr::trans_unadjusted::hb8364de9ecf82122hiB
8: 0x102ed7a4c - trans::expr::trans_into::h37bf0f4f595d93d16DA
9: 0x102e54d10 - trans::controlflow::trans_block::h4fbfe9e245dfbc46Ruv
10: 0x102e5363a - trans::base::trans_closure::h34071d9a784d8f1cLWh
11: 0x102e5533e - trans::base::trans_fn::h8b60fc728b696b76t7h
12: 0x102e5914c - trans::base::trans_item::haac7f69fe6a753f8Yvi
13: 0x102e66cfb - trans::base::trans_crate::hb1800db125dfa8773jj
14: 0x102cbb42f - driver::phase_4_translate_to_llvm::ha90b5a4585d4395fBOa
15: 0x102c93f4f - driver::compile_input::hc7efa8e10e996fb1Tba
16: 0x102d56449 - run_compiler::hd964f53796cdaa72G7b
17: 0x102d5393f - boxed::F.FnBox<A>::call_box::h1390611659955526416
18: 0x102d53087 - rt::unwind::try::try_fn::h7096656292409969094
19: 0x1069c8db8 - rust_try_inner
20: 0x1069c8da5 - rust_try
21: 0x106921075 - rt::unwind::try::inner_try::had4cdff9eafcbf1fMlw
22: 0x102d532d2 - boxed::F.FnBox<A>::call_box::h7809183391410762880
23: 0x10693729d - sys::thread::Thread::new::thread_start::hd1c42fff9d20c3856Jv
24: 0x7fff95422267 - _pthread_body
25: 0x7fff954221e4 - _pthread_start
</code></pre></div> | 0 |
<h3 dir="auto">Which version of ShardingSphere did you use?</h3>
<p dir="auto">4.0.0-RC1 error<br>
3.1.0 normal</p>
<h3 dir="auto">Which project did you use? Sharding-JDBC or Sharding-Proxy?</h3>
<p dir="auto">sharding-jdbc</p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">rewrite sql contains schema,so can right run.</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">rewrite sql doesn't contain schema.</p>
<h3 dir="auto">Reason analyze (If you can)</h3>
<h3 dir="auto">Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.</h3>
<p dir="auto">I have three schemas: ds0, ds1, test<br>
test also default datasource</p>
<p dir="auto">at ds0 create table test_a:<br>
CREATE TABLE <code class="notranslate">test_a</code> (<br>
<code class="notranslate">name</code> varchar(20) DEFAULT NULL COMMENT '名称',<br>
<code class="notranslate">code</code> varchar(20) DEFAULT NULL COMMENT '编码',<br>
<code class="notranslate">id</code> varchar(36) NOT NULL DEFAULT '',<br>
PRIMARY KEY (<code class="notranslate">id</code>)<br>
) ENGINE=InnoDB DEFAULT CHARSET=utf8;</p>
<p dir="auto">at ds1 create table test_b:<br>
CREATE TABLE <code class="notranslate">test_b</code> (<br>
<code class="notranslate">name</code> varchar(20) DEFAULT NULL COMMENT '名称',<br>
<code class="notranslate">code</code> varchar(20) DEFAULT NULL COMMENT '编码',<br>
<code class="notranslate">id</code> varchar(36) NOT NULL DEFAULT '',<br>
PRIMARY KEY (<code class="notranslate">id</code>)<br>
) ENGINE=InnoDB DEFAULT CHARSET=utf8;</p>
<p dir="auto">at test execute sql (test_a, test_b all not sharding tables):<br>
select e.* from (<br>
SELECT<br>
c.<code class="notranslate">id</code> AS idStr,<br>
c.<code class="notranslate">code</code> AS <code class="notranslate">code</code>,<br>
c.<code class="notranslate">name</code> AS <code class="notranslate">name</code><br>
FROM<br>
<code class="notranslate">ds0</code>.<code class="notranslate">test_a</code> c<br>
UNION ALL<br>
SELECT<br>
<code class="notranslate">a</code>.<code class="notranslate">id</code> AS idStr,<br>
<code class="notranslate">a</code>.<code class="notranslate">code</code> AS <code class="notranslate">code</code>,<br>
<code class="notranslate">a</code>.<code class="notranslate">name</code> AS <code class="notranslate">name</code><br>
FROM<br>
<code class="notranslate">ds1</code>.<code class="notranslate">test_b</code> a<br>
) e</p>
<p dir="auto">error info as bellow:<br>
2019-10-31 09:25:36.838 INFO 9720 --- [nio-8084-exec-1] ShardingSphere-SQL : Actual SQL: test :::<br>
select e.* from (<br>
SELECT<br>
c.<code class="notranslate">id</code> AS idStr,<br>
c.<code class="notranslate">code</code> AS <code class="notranslate">code</code>,<br>
c.<code class="notranslate">name</code> AS <code class="notranslate">name</code><br>
FROM<br>
<code class="notranslate">test_a</code> c<br>
UNION ALL<br>
SELECT<br>
<code class="notranslate">a</code>.<code class="notranslate">id</code> AS idStr,<br>
<code class="notranslate">a</code>.<code class="notranslate">code</code> AS <code class="notranslate">code</code>,<br>
<code class="notranslate">a</code>.<code class="notranslate">name</code> AS <code class="notranslate">name</code><br>
FROM<br>
<code class="notranslate">test_b</code> a<br>
) e<br>
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.test_a' doesn't exist</p>
<h3 dir="auto">Example codes for reproduce this issue (such as a github link).</h3> | <h2 dir="auto">Use version</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" <dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
<version>4.0.0-RC3</version>
</dependency>"><pre class="notranslate"><code class="notranslate"> <dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
<version>4.0.0-RC3</version>
</dependency>
</code></pre></div>
<hr>
<h2 dir="auto">Meeting problems</h2>
<h2 dir="auto">2019-12-01 23:08:28.800 ERROR 25132 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Error attempting to get column 'create_time' from result set. Cause: java.sql.SQLFeatureNotSupportedException: getObject with type</h2>
<h2 dir="auto">Object property is localdatetime ,Only date type is supported after testing,The time types of jdk8 are not supported .</h2>
<p dir="auto">LocalDate type<br>
LocalTime type<br>
LocalDateTime type</p>
<p dir="auto">Throw exception when returning encapsulation as object from database</p>
<hr>
<h2 dir="auto">Hope to solve the bug</h2> | 0 |
<h3 dir="auto">Model description</h3>
<p dir="auto">Swin2SR is a Swinv2-based model for image super resolution and compression.</p>
<h3 dir="auto">Open source status</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> The model implementation is available</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> The model weights are available</li>
</ul>
<h3 dir="auto">Provide useful links for the implementation</h3>
<p dir="auto"><a href="https://github.com/mv-lab/swin2sr">https://github.com/mv-lab/swin2sr</a></p> | <h3 dir="auto">System Info</h3>
<p dir="auto">I'm running into an issue where I'm not able to load a 4-bit or 8-bit quantized version of Falcon or LLaMa models. This was working a couple of weeks ago. This is running on Colab. I'm wondering if anyone knows of a fix, or why this is no longer working when it was 2-3 weeks ago around June 8th.</p>
<ul dir="auto">
<li><code class="notranslate">transformers</code> version: 4.31.0.dev0</li>
<li>Platform: Linux-5.15.107+-x86_64-with-glibc2.31</li>
<li>Python version: 3.10.12</li>
<li>Huggingface_hub version: 0.15.1</li>
<li>Safetensors version: 0.3.1</li>
<li>PyTorch version (GPU?): 2.0.1+cu118 (True)</li>
<li>Tensorflow version (GPU?): 2.12.0 (True)</li>
<li>Flax version (CPU?/GPU?/TPU?): 0.6.11 (gpu)</li>
<li>Jax version: 0.4.10</li>
<li>JaxLib version: 0.4.10</li>
</ul>
<h3 dir="auto">Who can help?</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Information</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> The official example scripts</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> My own modified scripts</li>
</ul>
<h3 dir="auto">Tasks</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> An officially supported task in the <code class="notranslate">examples</code> folder (such as GLUE/SQuAD, ...)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> My own task or dataset (give details below)</li>
</ul>
<h3 dir="auto">Reproduction</h3>
<p dir="auto">Running in Colab on an A100 in Colab PRro</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
!pip install git+https://www.github.com/huggingface/transformers
!pip install git+https://github.com/huggingface/accelerate
!pip install bitsandbytes
!pip install einops
from transformers import AutoModelForCausalLM, AutoConfig, AutoTokenizer
import torch
model_path="tiiuae/falcon-40b-instruct"
config = AutoConfig.from_pretrained(model_path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True, load_in_4bit=True, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-40b-instruct")
input_text = "Describe the solar system."
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
outputs = model.generate(input_ids, max_length=100)
print(tokenizer.decode(outputs[0]))
"><pre class="notranslate"><code class="notranslate">
!pip install git+https://www.github.com/huggingface/transformers
!pip install git+https://github.com/huggingface/accelerate
!pip install bitsandbytes
!pip install einops
from transformers import AutoModelForCausalLM, AutoConfig, AutoTokenizer
import torch
model_path="tiiuae/falcon-40b-instruct"
config = AutoConfig.from_pretrained(model_path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True, load_in_4bit=True, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-40b-instruct")
input_text = "Describe the solar system."
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
outputs = model.generate(input_ids, max_length=100)
print(tokenizer.decode(outputs[0]))
</code></pre></div>
<p dir="auto">Cell output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Collecting git+https://www.github.com/huggingface/transformers
Cloning https://www.github.com/huggingface/transformers to /tmp/pip-req-build-6pyatvel
Running command git clone --filter=blob:none --quiet https://www.github.com/huggingface/transformers /tmp/pip-req-build-6pyatvel
warning: redirecting to https://github.com/huggingface/transformers.git/
Resolved https://www.github.com/huggingface/transformers to commit e84bf1f734f87aa2bedc41b9b9933d00fc6add98
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from transformers==4.31.0.dev0) (3.12.2)
Collecting huggingface-hub<1.0,>=0.14.1 (from transformers==4.31.0.dev0)
Downloading huggingface_hub-0.15.1-py3-none-any.whl (236 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 236.8/236.8 kB 11.6 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from transformers==4.31.0.dev0) (1.22.4)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from transformers==4.31.0.dev0) (23.1)
Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from transformers==4.31.0.dev0) (6.0)
Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers==4.31.0.dev0) (2022.10.31)
Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from transformers==4.31.0.dev0) (2.27.1)
Collecting tokenizers!=0.11.3,<0.14,>=0.11.1 (from transformers==4.31.0.dev0)
Downloading tokenizers-0.13.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.8/7.8 MB 114.2 MB/s eta 0:00:00
Collecting safetensors>=0.3.1 (from transformers==4.31.0.dev0)
Downloading safetensors-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 79.9 MB/s eta 0:00:00
Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.10/dist-packages (from transformers==4.31.0.dev0) (4.65.0)
Requirement already satisfied: fsspec in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<1.0,>=0.14.1->transformers==4.31.0.dev0) (2023.6.0)
Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<1.0,>=0.14.1->transformers==4.31.0.dev0) (4.6.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.31.0.dev0) (1.26.16)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.31.0.dev0) (2023.5.7)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.31.0.dev0) (2.0.12)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.31.0.dev0) (3.4)
Building wheels for collected packages: transformers
Building wheel for transformers (pyproject.toml) ... done
Created wheel for transformers: filename=transformers-4.31.0.dev0-py3-none-any.whl size=7228417 sha256=5867afa880111a40f7b630e51d9f1709ec1131236a31c2c7fb5f97179e3d1405
Stored in directory: /tmp/pip-ephem-wheel-cache-t06u3u6x/wheels/c1/ac/11/e69d454307e735e14f4f95e575c8be27fd99835ec36f504c13
Successfully built transformers
Installing collected packages: tokenizers, safetensors, huggingface-hub, transformers
Successfully installed huggingface-hub-0.15.1 safetensors-0.3.1 tokenizers-0.13.3 transformers-4.31.0.dev0
Collecting git+https://github.com/huggingface/accelerate
Cloning https://github.com/huggingface/accelerate to /tmp/pip-req-build-76ziff6x
Running command git clone --filter=blob:none --quiet https://github.com/huggingface/accelerate /tmp/pip-req-build-76ziff6x
Resolved https://github.com/huggingface/accelerate to commit d141b4ce794227450a105b7281611c7980e5b3d6
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from accelerate==0.21.0.dev0) (1.22.4)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from accelerate==0.21.0.dev0) (23.1)
Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from accelerate==0.21.0.dev0) (5.9.5)
Requirement already satisfied: pyyaml in /usr/local/lib/python3.10/dist-packages (from accelerate==0.21.0.dev0) (6.0)
Requirement already satisfied: torch>=1.6.0 in /usr/local/lib/python3.10/dist-packages (from accelerate==0.21.0.dev0) (2.0.1+cu118)
Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch>=1.6.0->accelerate==0.21.0.dev0) (3.12.2)
Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch>=1.6.0->accelerate==0.21.0.dev0) (4.6.3)
Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch>=1.6.0->accelerate==0.21.0.dev0) (1.11.1)
Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch>=1.6.0->accelerate==0.21.0.dev0) (3.1)
Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch>=1.6.0->accelerate==0.21.0.dev0) (3.1.2)
Requirement already satisfied: triton==2.0.0 in /usr/local/lib/python3.10/dist-packages (from torch>=1.6.0->accelerate==0.21.0.dev0) (2.0.0)
Requirement already satisfied: cmake in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch>=1.6.0->accelerate==0.21.0.dev0) (3.25.2)
Requirement already satisfied: lit in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch>=1.6.0->accelerate==0.21.0.dev0) (16.0.6)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch>=1.6.0->accelerate==0.21.0.dev0) (2.1.3)
Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch>=1.6.0->accelerate==0.21.0.dev0) (1.3.0)
Building wheels for collected packages: accelerate
Building wheel for accelerate (pyproject.toml) ... done
Created wheel for accelerate: filename=accelerate-0.21.0.dev0-py3-none-any.whl size=234648 sha256=71b98a6d4b1111cc9ca22265f6699cd552325e5f71c83daebe696afd957497ee
Stored in directory: /tmp/pip-ephem-wheel-cache-atmtszgr/wheels/f6/c7/9d/1b8a5ca8353d9307733bc719107acb67acdc95063bba749f26
Successfully built accelerate
Installing collected packages: accelerate
Successfully installed accelerate-0.21.0.dev0
Collecting bitsandbytes
Downloading bitsandbytes-0.39.1-py3-none-any.whl (97.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.1/97.1 MB 18.8 MB/s eta 0:00:00
Installing collected packages: bitsandbytes
Successfully installed bitsandbytes-0.39.1
Collecting einops
Downloading einops-0.6.1-py3-none-any.whl (42 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.2/42.2 kB 3.8 MB/s eta 0:00:00
Installing collected packages: einops
Successfully installed einops-0.6.1
Downloading (…)lve/main/config.json: 100%
658/658 [00:00<00:00, 51.8kB/s]
Downloading (…)/configuration_RW.py: 100%
2.51k/2.51k [00:00<00:00, 227kB/s]
A new version of the following files was downloaded from https://huggingface.co/tiiuae/falcon-40b-instruct:
- configuration_RW.py
. Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
Downloading (…)main/modelling_RW.py: 100%
47.1k/47.1k [00:00<00:00, 3.76MB/s]
A new version of the following files was downloaded from https://huggingface.co/tiiuae/falcon-40b-instruct:
- modelling_RW.py
. Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
Downloading (…)model.bin.index.json: 100%
39.3k/39.3k [00:00<00:00, 3.46MB/s]
Downloading shards: 100%
9/9 [04:40<00:00, 29.33s/it]
Downloading (…)l-00001-of-00009.bin: 100%
9.50G/9.50G [00:37<00:00, 274MB/s]
Downloading (…)l-00002-of-00009.bin: 100%
9.51G/9.51G [00:33<00:00, 340MB/s]
Downloading (…)l-00003-of-00009.bin: 100%
9.51G/9.51G [00:28<00:00, 320MB/s]
Downloading (…)l-00004-of-00009.bin: 100%
9.51G/9.51G [00:33<00:00, 317MB/s]
Downloading (…)l-00005-of-00009.bin: 100%
9.51G/9.51G [00:27<00:00, 210MB/s]
Downloading (…)l-00006-of-00009.bin: 100%
9.51G/9.51G [00:34<00:00, 180MB/s]
Downloading (…)l-00007-of-00009.bin: 100%
9.51G/9.51G [00:27<00:00, 307MB/s]
Downloading (…)l-00008-of-00009.bin: 100%
9.51G/9.51G [00:27<00:00, 504MB/s]
Downloading (…)l-00009-of-00009.bin: 100%
7.58G/7.58G [00:27<00:00, 315MB/s]
===================================BUG REPORT===================================
Welcome to bitsandbytes. For bug reports, please run
python -m bitsandbytes
and submit this information together with your error trace to: https://github.com/TimDettmers/bitsandbytes/issues
================================================================================
bin /usr/local/lib/python3.10/dist-packages/bitsandbytes/libbitsandbytes_cuda118.so
CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching in backup paths...
CUDA SETUP: CUDA runtime path found: /usr/local/cuda/lib64/libcudart.so
CUDA SETUP: Highest compute capability among GPUs detected: 8.0
CUDA SETUP: Detected CUDA version 118
CUDA SETUP: Loading binary /usr/local/lib/python3.10/dist-packages/bitsandbytes/libbitsandbytes_cuda118.so...
/usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: /usr/lib64-nvidia did not contain ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] as expected! Searching further paths...
warn(msg)
/usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/sys/fs/cgroup/memory.events /var/colab/cgroup/jupyter-children/memory.events')}
warn(msg)
/usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('//172.28.0.1'), PosixPath('8013'), PosixPath('http')}
warn(msg)
/usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('//colab.research.google.com/tun/m/cc48301118ce562b961b3c22d803539adc1e0c19/gpu-a100-s-b20acq94qsrp --tunnel_background_save_delay=10s --tunnel_periodic_background_save_frequency=30m0s --enable_output_coalescing=true --output_coalescing_required=true'), PosixPath('--logtostderr --listen_host=172.28.0.12 --target_host=172.28.0.12 --tunnel_background_save_url=https')}
warn(msg)
/usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/env/python')}
warn(msg)
/usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('//ipykernel.pylab.backend_inline'), PosixPath('module')}
warn(msg)
/usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: Found duplicate ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] files: {PosixPath('/usr/local/cuda/lib64/libcudart.so'), PosixPath('/usr/local/cuda/lib64/libcudart.so.11.0')}.. We'll flip a coin and try one of these, in order to fail forward.
Either way, this might cause trouble in the future:
If you get `CUDA error: invalid device function` errors, the above might be the cause and the solution is to make sure only one ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] in the paths that we search based on your env.
warn(msg)
Loading checkpoint shards: 100%
9/9 [05:45<00:00, 35.83s/it]
Downloading (…)neration_config.json: 100%
111/111 [00:00<00:00, 10.3kB/s]
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
[<ipython-input-1-c89997e10ae9>](https://localhost:8080/#) in <cell line: 15>()
13
14 config = AutoConfig.from_pretrained(model_path, trust_remote_code=True)
---> 15 model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True, load_in_4bit=True, device_map="auto")
16
17 tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-40b-instruct")
3 frames
[/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py](https://localhost:8080/#) in to(self, *args, **kwargs)
1894 # Checks if the model has been loaded in 8-bit
1895 if getattr(self, "is_quantized", False):
-> 1896 raise ValueError(
1897 "`.to` is not supported for `4-bit` or `8-bit` models. Please use the model as it is, since the"
1898 " model has already been set to the correct devices and casted to the correct `dtype`."
ValueError: `.to` is not supported for `4-bit` or `8-bit` models. Please use the model as it is, since the model has already been set to the correct devices and casted to the correct `dtype`."><pre class="notranslate"><code class="notranslate">Collecting git+https://www.github.com/huggingface/transformers
Cloning https://www.github.com/huggingface/transformers to /tmp/pip-req-build-6pyatvel
Running command git clone --filter=blob:none --quiet https://www.github.com/huggingface/transformers /tmp/pip-req-build-6pyatvel
warning: redirecting to https://github.com/huggingface/transformers.git/
Resolved https://www.github.com/huggingface/transformers to commit e84bf1f734f87aa2bedc41b9b9933d00fc6add98
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from transformers==4.31.0.dev0) (3.12.2)
Collecting huggingface-hub<1.0,>=0.14.1 (from transformers==4.31.0.dev0)
Downloading huggingface_hub-0.15.1-py3-none-any.whl (236 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 236.8/236.8 kB 11.6 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from transformers==4.31.0.dev0) (1.22.4)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from transformers==4.31.0.dev0) (23.1)
Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from transformers==4.31.0.dev0) (6.0)
Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers==4.31.0.dev0) (2022.10.31)
Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from transformers==4.31.0.dev0) (2.27.1)
Collecting tokenizers!=0.11.3,<0.14,>=0.11.1 (from transformers==4.31.0.dev0)
Downloading tokenizers-0.13.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.8/7.8 MB 114.2 MB/s eta 0:00:00
Collecting safetensors>=0.3.1 (from transformers==4.31.0.dev0)
Downloading safetensors-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 79.9 MB/s eta 0:00:00
Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.10/dist-packages (from transformers==4.31.0.dev0) (4.65.0)
Requirement already satisfied: fsspec in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<1.0,>=0.14.1->transformers==4.31.0.dev0) (2023.6.0)
Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<1.0,>=0.14.1->transformers==4.31.0.dev0) (4.6.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.31.0.dev0) (1.26.16)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.31.0.dev0) (2023.5.7)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.31.0.dev0) (2.0.12)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.31.0.dev0) (3.4)
Building wheels for collected packages: transformers
Building wheel for transformers (pyproject.toml) ... done
Created wheel for transformers: filename=transformers-4.31.0.dev0-py3-none-any.whl size=7228417 sha256=5867afa880111a40f7b630e51d9f1709ec1131236a31c2c7fb5f97179e3d1405
Stored in directory: /tmp/pip-ephem-wheel-cache-t06u3u6x/wheels/c1/ac/11/e69d454307e735e14f4f95e575c8be27fd99835ec36f504c13
Successfully built transformers
Installing collected packages: tokenizers, safetensors, huggingface-hub, transformers
Successfully installed huggingface-hub-0.15.1 safetensors-0.3.1 tokenizers-0.13.3 transformers-4.31.0.dev0
Collecting git+https://github.com/huggingface/accelerate
Cloning https://github.com/huggingface/accelerate to /tmp/pip-req-build-76ziff6x
Running command git clone --filter=blob:none --quiet https://github.com/huggingface/accelerate /tmp/pip-req-build-76ziff6x
Resolved https://github.com/huggingface/accelerate to commit d141b4ce794227450a105b7281611c7980e5b3d6
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from accelerate==0.21.0.dev0) (1.22.4)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from accelerate==0.21.0.dev0) (23.1)
Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from accelerate==0.21.0.dev0) (5.9.5)
Requirement already satisfied: pyyaml in /usr/local/lib/python3.10/dist-packages (from accelerate==0.21.0.dev0) (6.0)
Requirement already satisfied: torch>=1.6.0 in /usr/local/lib/python3.10/dist-packages (from accelerate==0.21.0.dev0) (2.0.1+cu118)
Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch>=1.6.0->accelerate==0.21.0.dev0) (3.12.2)
Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch>=1.6.0->accelerate==0.21.0.dev0) (4.6.3)
Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch>=1.6.0->accelerate==0.21.0.dev0) (1.11.1)
Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch>=1.6.0->accelerate==0.21.0.dev0) (3.1)
Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch>=1.6.0->accelerate==0.21.0.dev0) (3.1.2)
Requirement already satisfied: triton==2.0.0 in /usr/local/lib/python3.10/dist-packages (from torch>=1.6.0->accelerate==0.21.0.dev0) (2.0.0)
Requirement already satisfied: cmake in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch>=1.6.0->accelerate==0.21.0.dev0) (3.25.2)
Requirement already satisfied: lit in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch>=1.6.0->accelerate==0.21.0.dev0) (16.0.6)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch>=1.6.0->accelerate==0.21.0.dev0) (2.1.3)
Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch>=1.6.0->accelerate==0.21.0.dev0) (1.3.0)
Building wheels for collected packages: accelerate
Building wheel for accelerate (pyproject.toml) ... done
Created wheel for accelerate: filename=accelerate-0.21.0.dev0-py3-none-any.whl size=234648 sha256=71b98a6d4b1111cc9ca22265f6699cd552325e5f71c83daebe696afd957497ee
Stored in directory: /tmp/pip-ephem-wheel-cache-atmtszgr/wheels/f6/c7/9d/1b8a5ca8353d9307733bc719107acb67acdc95063bba749f26
Successfully built accelerate
Installing collected packages: accelerate
Successfully installed accelerate-0.21.0.dev0
Collecting bitsandbytes
Downloading bitsandbytes-0.39.1-py3-none-any.whl (97.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.1/97.1 MB 18.8 MB/s eta 0:00:00
Installing collected packages: bitsandbytes
Successfully installed bitsandbytes-0.39.1
Collecting einops
Downloading einops-0.6.1-py3-none-any.whl (42 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.2/42.2 kB 3.8 MB/s eta 0:00:00
Installing collected packages: einops
Successfully installed einops-0.6.1
Downloading (…)lve/main/config.json: 100%
658/658 [00:00<00:00, 51.8kB/s]
Downloading (…)/configuration_RW.py: 100%
2.51k/2.51k [00:00<00:00, 227kB/s]
A new version of the following files was downloaded from https://huggingface.co/tiiuae/falcon-40b-instruct:
- configuration_RW.py
. Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
Downloading (…)main/modelling_RW.py: 100%
47.1k/47.1k [00:00<00:00, 3.76MB/s]
A new version of the following files was downloaded from https://huggingface.co/tiiuae/falcon-40b-instruct:
- modelling_RW.py
. Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
Downloading (…)model.bin.index.json: 100%
39.3k/39.3k [00:00<00:00, 3.46MB/s]
Downloading shards: 100%
9/9 [04:40<00:00, 29.33s/it]
Downloading (…)l-00001-of-00009.bin: 100%
9.50G/9.50G [00:37<00:00, 274MB/s]
Downloading (…)l-00002-of-00009.bin: 100%
9.51G/9.51G [00:33<00:00, 340MB/s]
Downloading (…)l-00003-of-00009.bin: 100%
9.51G/9.51G [00:28<00:00, 320MB/s]
Downloading (…)l-00004-of-00009.bin: 100%
9.51G/9.51G [00:33<00:00, 317MB/s]
Downloading (…)l-00005-of-00009.bin: 100%
9.51G/9.51G [00:27<00:00, 210MB/s]
Downloading (…)l-00006-of-00009.bin: 100%
9.51G/9.51G [00:34<00:00, 180MB/s]
Downloading (…)l-00007-of-00009.bin: 100%
9.51G/9.51G [00:27<00:00, 307MB/s]
Downloading (…)l-00008-of-00009.bin: 100%
9.51G/9.51G [00:27<00:00, 504MB/s]
Downloading (…)l-00009-of-00009.bin: 100%
7.58G/7.58G [00:27<00:00, 315MB/s]
===================================BUG REPORT===================================
Welcome to bitsandbytes. For bug reports, please run
python -m bitsandbytes
and submit this information together with your error trace to: https://github.com/TimDettmers/bitsandbytes/issues
================================================================================
bin /usr/local/lib/python3.10/dist-packages/bitsandbytes/libbitsandbytes_cuda118.so
CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching in backup paths...
CUDA SETUP: CUDA runtime path found: /usr/local/cuda/lib64/libcudart.so
CUDA SETUP: Highest compute capability among GPUs detected: 8.0
CUDA SETUP: Detected CUDA version 118
CUDA SETUP: Loading binary /usr/local/lib/python3.10/dist-packages/bitsandbytes/libbitsandbytes_cuda118.so...
/usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: /usr/lib64-nvidia did not contain ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] as expected! Searching further paths...
warn(msg)
/usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/sys/fs/cgroup/memory.events /var/colab/cgroup/jupyter-children/memory.events')}
warn(msg)
/usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('//172.28.0.1'), PosixPath('8013'), PosixPath('http')}
warn(msg)
/usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('//colab.research.google.com/tun/m/cc48301118ce562b961b3c22d803539adc1e0c19/gpu-a100-s-b20acq94qsrp --tunnel_background_save_delay=10s --tunnel_periodic_background_save_frequency=30m0s --enable_output_coalescing=true --output_coalescing_required=true'), PosixPath('--logtostderr --listen_host=172.28.0.12 --target_host=172.28.0.12 --tunnel_background_save_url=https')}
warn(msg)
/usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/env/python')}
warn(msg)
/usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('//ipykernel.pylab.backend_inline'), PosixPath('module')}
warn(msg)
/usr/local/lib/python3.10/dist-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: Found duplicate ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] files: {PosixPath('/usr/local/cuda/lib64/libcudart.so'), PosixPath('/usr/local/cuda/lib64/libcudart.so.11.0')}.. We'll flip a coin and try one of these, in order to fail forward.
Either way, this might cause trouble in the future:
If you get `CUDA error: invalid device function` errors, the above might be the cause and the solution is to make sure only one ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] in the paths that we search based on your env.
warn(msg)
Loading checkpoint shards: 100%
9/9 [05:45<00:00, 35.83s/it]
Downloading (…)neration_config.json: 100%
111/111 [00:00<00:00, 10.3kB/s]
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
[<ipython-input-1-c89997e10ae9>](https://localhost:8080/#) in <cell line: 15>()
13
14 config = AutoConfig.from_pretrained(model_path, trust_remote_code=True)
---> 15 model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True, load_in_4bit=True, device_map="auto")
16
17 tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-40b-instruct")
3 frames
[/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py](https://localhost:8080/#) in to(self, *args, **kwargs)
1894 # Checks if the model has been loaded in 8-bit
1895 if getattr(self, "is_quantized", False):
-> 1896 raise ValueError(
1897 "`.to` is not supported for `4-bit` or `8-bit` models. Please use the model as it is, since the"
1898 " model has already been set to the correct devices and casted to the correct `dtype`."
ValueError: `.to` is not supported for `4-bit` or `8-bit` models. Please use the model as it is, since the model has already been set to the correct devices and casted to the correct `dtype`.
</code></pre></div>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Model should be loaded and able to run inference.</p> | 0 |
<p dir="auto"><strong>Context:</strong></p>
<ul dir="auto">
<li>Playwright Version: 1.9.1</li>
<li>Operating System: Mac</li>
<li>Browser: Chrome</li>
</ul>
<p dir="auto"><strong>Describe the bug</strong></p>
<p dir="auto">I'm currently scraping tiktok using this unofficial tiktok api which uses playwright <a href="https://github.com/davidteather/TikTok-Api">https://github.com/davidteather/TikTok-Api</a>. Today i updated my Mac to Monterey and the script im running to scrape tiktok stopped working and throws out the error below. I've tried to reinstall all the packages and also reinstall playwright but cant get the script running again.</p>
<p dir="auto">Result</p>
<p dir="auto"><code class="notranslate">Traceback (most recent call last): File "/Users/johndoe/Documents/tiktok/emails.py", line 16, in <module> api = TikTokApi.get_instance(custom_verifyFp=verifyFp, use_test_endpoints=True) File "/Users/johndoe/Documents/tiktok/.venv/lib/python3.9/site-packages/TikTokApi/tiktok.py", line 151, in get_instance TikTokApi(**kwargs) File "/Users/johndoe/Documents/tiktok/.venv/lib/python3.9/site-packages/TikTokApi/tiktok.py", line 63, in __init__ self.browser = browser(**kwargs) File "/Users/johndoe/Documents/tiktok/.venv/lib/python3.9/site-packages/TikTokApi/browser_utilities/browser.py", line 84, in __init__ raise e File "/Users/johndoe/Documents/tiktok/.venv/lib/python3.9/site-packages/TikTokApi/browser_utilities/browser.py", line 79, in __init__ self.browser = get_playwright().webkit.launch( File "/Users/johndoe/Documents/tiktok/.venv/lib/python3.9/site-packages/playwright/sync_api/_generated.py", line 8915, in launch self._sync( File "/Users/johndoe/Documents/tiktok/.venv/lib/python3.9/site-packages/playwright/_impl/_sync_base.py", line 103, in _sync return task.result() File "/Users/johndoe/Documents/tiktok/.venv/lib/python3.9/site-packages/playwright/_impl/_browser_type.py", line 74, in launch raise e File "/Users/johndoe/Documents/tiktok/.venv/lib/python3.9/site-packages/playwright/_impl/_browser_type.py", line 70, in launch return from_channel(await self._channel.send("launch", params)) File "/Users/johndoe/Documents/tiktok/.venv/lib/python3.9/site-packages/playwright/_impl/_connection.py", line 36, in send return await self.inner_send(method, params, False) File "/Users/johndoe/Documents/tiktok/.venv/lib/python3.9/site-packages/playwright/_impl/_connection.py", line 47, in inner_send result = await callback.future playwright._impl._api_types.Error: No executable path is specified. Pass "executablePath" option directly.</code></p> | <h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.XX]</li>
<li>Operating System: [All, Windows 11, Ubuntu 20, macOS 13.2, etc.]</li>
<li>Browser: [All, Chromium, Firefox, WebKit]</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I provided exact source code that allows reproducing the issue locally.</li>
</ul>
<p dir="auto"><strong>Link to the GitHub repository with the repro</strong></p>
<p dir="auto">[https://github.com/your_profile/playwright_issue_title]</p>
<p dir="auto">or</p>
<p dir="auto"><strong>Config file</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], },
},
});"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">defineConfig</span><span class="pl-kos">,</span> <span class="pl-s1">devices</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">projects</span>: <span class="pl-kos">[</span>
<span class="pl-kos">{</span>
<span class="pl-c1">name</span>: <span class="pl-s">'chromium'</span><span class="pl-kos">,</span>
<span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Chrome'</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></pre></div>
<p dir="auto"><strong>Test file (self-contained)</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { test, expect } from '@playwright/test';
test('has title', async ({ page }) => {
await page.goto('https://playwright.dev/');
// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Playwright/);
});
test('get started link', async ({ page }) => {
await page.goto('https://playwright.dev/');
// Click the get started link.
await page.getByRole('link', { name: 'Get started' }).click();
// Expects the URL to contain intro.
await expect(page).toHaveURL(/.*intro/);
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span><span class="pl-kos">,</span> <span class="pl-s1">expect</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>
<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'has title'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <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">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">'https://playwright.dev/'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Expect a title "to contain" a substring.</span>
<span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toHaveTitle</span><span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span>Playwright<span class="pl-c1">/</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-en">test</span><span class="pl-kos">(</span><span class="pl-s">'get started link'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <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">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">'https://playwright.dev/'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Click the get started link.</span>
<span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">getByRole</span><span class="pl-kos">(</span><span class="pl-s">'link'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'Get started'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">click</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Expects the URL to contain intro.</span>
<span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toHaveURL</span><span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span>.<span class="pl-c1">*</span>intro<span class="pl-c1">/</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></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>I have installed Playwright and haven't changed anything, I am just trying to run the sample tests provided by Playwright.</li>
<li>I installed Playwright yesterday , yesterday it was working fine,</li>
<li>Today when I am trying to run the test by using the command " npx playwright test " , I am getting issue for all major browsers.</li>
<li>I am getting error at the below line,<br>
await page.goto('<a href="https://playwright.dev/" rel="nofollow">https://playwright.dev/</a>');</li>
<li>Error: page.goto: net::ERR_NAME_NOT_RESOLVED at <a href="https://playwright.dev/" rel="nofollow">https://playwright.dev/</a></li>
<li>There is an issue with page.goto , I have also tried with other examples. I am getting the same error.</li>
<li>Please help to fix this as soon as possible.</li>
<li>Please let me know if you need more information. Below I have attached a screen shot of the error that I am facing.</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">[It should run the tests successfully. I tried it yesterday and everything was working fine]</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">[Please view below the attached screen-shot for the error]<br>
<a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/89217750/253188689-e37200c4-c152-49e9-89ff-3fe1d9137675.png"><img width="428" alt="image" src="https://user-images.githubusercontent.com/89217750/253188689-e37200c4-c152-49e9-89ff-3fe1d9137675.png" style="max-width: 100%;"></a></p> | 0 |
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ cargo build
Compiling libc v0.1.10
Compiling log v0.3.2
Compiling link-crash v0.1.0 (file:///C:/Users/%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80/Document
s/link-crash)
error: linking with `link.exe` failed: exit code: 1120
note: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC/bin\\link.exe" "/LIBPATH:C:\\Program Files (x86
)\\Microsoft Visual Studio 14.0\\VC/lib\\" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.10150.
0\\ucrt\\x86" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\x86" "/NOLOGO" "/NXCOMPAT"
"/LIBPATH:C:\\Program Files\\rust-nightly-i686-pc-windows-msvc\\rustc\\bin\\rustlib\\i686-pc-windows-msvc\\lib"
"C:\\Users\\\u{410}\u{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{440}\\Documents\\link-crash\\target\\deb
ug\\link_crash.0.o" "/OUT:C:\\Users\\\u{410}\u{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{440}\\Documents\
\link-crash\\target\\debug\\link_crash.exe" "/OPT:REF,ICF" "/DEBUG" "C:\\Users\\\u{410}\u{43b}\u{435}\u{43a}\u{4
41}\u{430}\u{43d}\u{434}\u{440}\\Documents\\link-crash\\target\\debug\\liblink_crash.rlib" "C:\\Users\\\u{410}\u
{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{440}\\Documents\\link-crash\\target\\debug\\deps\\liblog-f18a3
e885170bd3f.rlib" "C:\\Users\\\u{410}\u{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{440}\\Documents\\link-c
rash\\target\\debug\\deps\\liblibc-144c435538abd757.rlib" "C:\\Program Files\\rust-nightly-i686-pc-windows-msvc\
\rustc\\bin\\rustlib\\i686-pc-windows-msvc\\lib\\libstd-35017696.rlib" "C:\\Program Files\\rust-nightly-i686-pc-
windows-msvc\\rustc\\bin\\rustlib\\i686-pc-windows-msvc\\lib\\libcollections-35017696.rlib" "C:\\Program Files\\
rust-nightly-i686-pc-windows-msvc\\rustc\\bin\\rustlib\\i686-pc-windows-msvc\\lib\\librustc_unicode-35017696.rli
b" "C:\\Program Files\\rust-nightly-i686-pc-windows-msvc\\rustc\\bin\\rustlib\\i686-pc-windows-msvc\\lib\\libran
d-35017696.rlib" "C:\\Program Files\\rust-nightly-i686-pc-windows-msvc\\rustc\\bin\\rustlib\\i686-pc-windows-msv
c\\lib\\liballoc-35017696.rlib" "C:\\Program Files\\rust-nightly-i686-pc-windows-msvc\\rustc\\bin\\rustlib\\i686
-pc-windows-msvc\\lib\\liballoc_system-35017696.rlib" "C:\\Program Files\\rust-nightly-i686-pc-windows-msvc\\rus
tc\\bin\\rustlib\\i686-pc-windows-msvc\\lib\\liblibc-35017696.rlib" "C:\\Program Files\\rust-nightly-i686-pc-win
dows-msvc\\rustc\\bin\\rustlib\\i686-pc-windows-msvc\\lib\\libcore-35017696.rlib" "/LIBPATH:C:\\Users\\\u{410}\u
{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{440}\\Documents\\link-crash\\target\\debug" "/LIBPATH:C:\\User
s\\\u{410}\u{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{440}\\Documents\\link-crash\\target\\debug\\deps"
"/LIBPATH:C:\\Program Files\\rust-nightly-i686-pc-windows-msvc\\rustc\\bin\\rustlib\\i686-pc-windows-msvc\\lib"
"/LIBPATH:C:\\Users\\\u{410}\u{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{440}\\Documents\\link-crash\\.ru
st\\bin\\i686-pc-windows-msvc" "/LIBPATH:C:\\Users\\\u{410}\u{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{4
40}\\Documents\\link-crash\\bin\\i686-pc-windows-msvc" "kernel32.lib" "shell32.lib" "msvcrt.lib" "ws2_32.lib" "u
serenv.lib" "advapi32.lib" "kernel32.lib" "shell32.lib" "msvcrt.lib" "compiler-rt.lib"
Could not compile `link-crash`.
To learn more, run the command again with --verbose."><pre class="notranslate"><code class="notranslate">$ cargo build
Compiling libc v0.1.10
Compiling log v0.3.2
Compiling link-crash v0.1.0 (file:///C:/Users/%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80/Document
s/link-crash)
error: linking with `link.exe` failed: exit code: 1120
note: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC/bin\\link.exe" "/LIBPATH:C:\\Program Files (x86
)\\Microsoft Visual Studio 14.0\\VC/lib\\" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.10150.
0\\ucrt\\x86" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\x86" "/NOLOGO" "/NXCOMPAT"
"/LIBPATH:C:\\Program Files\\rust-nightly-i686-pc-windows-msvc\\rustc\\bin\\rustlib\\i686-pc-windows-msvc\\lib"
"C:\\Users\\\u{410}\u{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{440}\\Documents\\link-crash\\target\\deb
ug\\link_crash.0.o" "/OUT:C:\\Users\\\u{410}\u{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{440}\\Documents\
\link-crash\\target\\debug\\link_crash.exe" "/OPT:REF,ICF" "/DEBUG" "C:\\Users\\\u{410}\u{43b}\u{435}\u{43a}\u{4
41}\u{430}\u{43d}\u{434}\u{440}\\Documents\\link-crash\\target\\debug\\liblink_crash.rlib" "C:\\Users\\\u{410}\u
{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{440}\\Documents\\link-crash\\target\\debug\\deps\\liblog-f18a3
e885170bd3f.rlib" "C:\\Users\\\u{410}\u{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{440}\\Documents\\link-c
rash\\target\\debug\\deps\\liblibc-144c435538abd757.rlib" "C:\\Program Files\\rust-nightly-i686-pc-windows-msvc\
\rustc\\bin\\rustlib\\i686-pc-windows-msvc\\lib\\libstd-35017696.rlib" "C:\\Program Files\\rust-nightly-i686-pc-
windows-msvc\\rustc\\bin\\rustlib\\i686-pc-windows-msvc\\lib\\libcollections-35017696.rlib" "C:\\Program Files\\
rust-nightly-i686-pc-windows-msvc\\rustc\\bin\\rustlib\\i686-pc-windows-msvc\\lib\\librustc_unicode-35017696.rli
b" "C:\\Program Files\\rust-nightly-i686-pc-windows-msvc\\rustc\\bin\\rustlib\\i686-pc-windows-msvc\\lib\\libran
d-35017696.rlib" "C:\\Program Files\\rust-nightly-i686-pc-windows-msvc\\rustc\\bin\\rustlib\\i686-pc-windows-msv
c\\lib\\liballoc-35017696.rlib" "C:\\Program Files\\rust-nightly-i686-pc-windows-msvc\\rustc\\bin\\rustlib\\i686
-pc-windows-msvc\\lib\\liballoc_system-35017696.rlib" "C:\\Program Files\\rust-nightly-i686-pc-windows-msvc\\rus
tc\\bin\\rustlib\\i686-pc-windows-msvc\\lib\\liblibc-35017696.rlib" "C:\\Program Files\\rust-nightly-i686-pc-win
dows-msvc\\rustc\\bin\\rustlib\\i686-pc-windows-msvc\\lib\\libcore-35017696.rlib" "/LIBPATH:C:\\Users\\\u{410}\u
{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{440}\\Documents\\link-crash\\target\\debug" "/LIBPATH:C:\\User
s\\\u{410}\u{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{440}\\Documents\\link-crash\\target\\debug\\deps"
"/LIBPATH:C:\\Program Files\\rust-nightly-i686-pc-windows-msvc\\rustc\\bin\\rustlib\\i686-pc-windows-msvc\\lib"
"/LIBPATH:C:\\Users\\\u{410}\u{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{440}\\Documents\\link-crash\\.ru
st\\bin\\i686-pc-windows-msvc" "/LIBPATH:C:\\Users\\\u{410}\u{43b}\u{435}\u{43a}\u{441}\u{430}\u{43d}\u{434}\u{4
40}\\Documents\\link-crash\\bin\\i686-pc-windows-msvc" "kernel32.lib" "shell32.lib" "msvcrt.lib" "ws2_32.lib" "u
serenv.lib" "advapi32.lib" "kernel32.lib" "shell32.lib" "msvcrt.lib" "compiler-rt.lib"
Could not compile `link-crash`.
To learn more, run the command again with --verbose.
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ rustc -vV
rustc 1.4.0-nightly (f3f23bf9c 2015-08-30)
binary: rustc
commit-hash: f3f23bf9c5ee16dab8c25bb5d301d689fbbe0cf1
commit-date: 2015-08-30
host: i686-pc-windows-msvc
release: 1.4.0-nightly"><pre class="notranslate"><code class="notranslate">$ rustc -vV
rustc 1.4.0-nightly (f3f23bf9c 2015-08-30)
binary: rustc
commit-hash: f3f23bf9c5ee16dab8c25bb5d301d689fbbe0cf1
commit-date: 2015-08-30
host: i686-pc-windows-msvc
release: 1.4.0-nightly
</code></pre></div>
<p dir="auto">Here is the minimal test case:</p>
<ul dir="auto">
<li><code class="notranslate">Cargo.toml</code>:</li>
</ul>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[package]
name = "link-crash"
version = "0.1.0"
authors = ["Alexander Bulaev <[email protected]>"]
[dependencies]
log = "*""><pre class="notranslate"><span class="pl-kos">[</span>package<span class="pl-kos">]</span>
name = <span class="pl-s">"link-crash"</span>
version = <span class="pl-s">"0.1.0"</span>
authors = <span class="pl-kos">[</span><span class="pl-s">"Alexander Bulaev <[email protected]>"</span><span class="pl-kos">]</span>
<span class="pl-kos">[</span>dependencies<span class="pl-kos">]</span>
log = <span class="pl-s">"*"</span></pre></div>
<ul dir="auto">
<li><code class="notranslate">src/lib.rs</code>:</li>
</ul>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#[macro_use]
extern crate log;
use std::fmt::Debug;
pub struct Logger<E: Debug> {
field: E,
}
impl<E: Debug> Logger<E> {
pub fn new(field: E) -> Logger<E> {
Logger {
field: field
}
}
pub fn do_log(&self) {
info!("This is the message: {:?}", self.field);
}
}"><pre class="notranslate"><span class="pl-c1">#<span class="pl-kos">[</span>macro_use<span class="pl-kos">]</span></span>
<span class="pl-k">extern</span> <span class="pl-k">crate</span> log<span class="pl-kos">;</span>
<span class="pl-k">use</span> std<span class="pl-kos">::</span>fmt<span class="pl-kos">::</span><span class="pl-v">Debug</span><span class="pl-kos">;</span>
<span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">Logger</span><span class="pl-kos"><</span><span class="pl-smi">E</span><span class="pl-kos">:</span> <span class="pl-smi">Debug</span><span class="pl-kos">></span> <span class="pl-kos">{</span>
<span class="pl-c1">field</span><span class="pl-kos">:</span> <span class="pl-smi">E</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">E</span><span class="pl-kos">:</span> <span class="pl-smi">Debug</span><span class="pl-kos">></span> <span class="pl-smi">Logger</span><span class="pl-kos"><</span><span class="pl-smi">E</span><span class="pl-kos">></span> <span class="pl-kos">{</span>
<span class="pl-k">pub</span> <span class="pl-k">fn</span> <span class="pl-en">new</span><span class="pl-kos">(</span><span class="pl-s1">field</span><span class="pl-kos">:</span> <span class="pl-smi">E</span><span class="pl-kos">)</span> -> <span class="pl-smi">Logger</span><span class="pl-kos"><</span><span class="pl-smi">E</span><span class="pl-kos">></span> <span class="pl-kos">{</span>
<span class="pl-smi">Logger</span> <span class="pl-kos">{</span>
<span class="pl-c1">field</span><span class="pl-kos">:</span> field
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">pub</span> <span class="pl-k">fn</span> <span class="pl-en">do_log</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">info</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"This is the message: {:?}"</span>, <span class="pl-smi">self</span>.field<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<ul dir="auto">
<li><code class="notranslate">src/main.rs</code>:</li>
</ul>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="extern crate link_crash;
fn main() {
link_crash::Logger::new("123").do_log();
}"><pre class="notranslate"><span class="pl-k">extern</span> <span class="pl-k">crate</span> link_crash<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>
link_crash<span class="pl-kos">::</span><span class="pl-smi">Logger</span><span class="pl-kos">::</span><span class="pl-en">new</span><span class="pl-kos">(</span><span class="pl-s">"123"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">do_log</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">Currently the compiler makes basically no attempt to correctly use <code class="notranslate">dllimport</code>. As a bit of a refresher, the Windows linker requires that if you're importing symbols from a DLL that they're tagged with <code class="notranslate">dllimport</code>. This helps wire things up correctly at runtime and link-time. To help us out, though, the linker will patch up a few cases where <code class="notranslate">dllimport</code> is missing where it would otherwise be required. If a function in another DLL is linked to without <code class="notranslate">dllimport</code> then the linker will inject a local shim which adds a bit of indirection and runtime overhead but allows the crate to link correctly. For importing constants from other DLLs, however, MSVC linker requires that dllimport is annotated correctly. MinGW linkers can sometimes workaround it (see <a href="https://github.com/llvm/llvm-project/commit/eac1b05f1db91097eb37d975e07789ce039cf7f7">this commit</a> description.</p>
<p dir="auto">If we're targeting windows, then the compiler currently puts <code class="notranslate">dllimport</code> on all imported constants from external crates, regardless of whether it's actually being imported from another crate. We rely on the linker fixing up all imports of functions. This ends up meaning that some crates don't link correctly, however (see this comment: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="91209293" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/26591" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/26591/hovercard?comment_id=123513631&comment_type=issue_comment" href="https://github.com/rust-lang/rust/issues/26591#issuecomment-123513631">#26591 (comment)</a>).</p>
<p dir="auto">We should fix the compiler's handling of dllimport in a few ways:</p>
<ul dir="auto">
<li>Functions should be tagged with <code class="notranslate">dllimport</code> where appropriate</li>
<li>FFI functions should also be tagged with <code class="notranslate">dllimport</code> where appropriate</li>
<li>Constants should not always be tagged with <code class="notranslate">dllimport</code> if they're not actually being imported from a DLL.</li>
</ul>
<p dir="auto">I currently have a few thoughts running around in my head for fixing this, but nothing seems plausible enough to push on.</p>
<p dir="auto">EDIT: Updated as <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mati865/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mati865">@mati865</a> requested <a href="https://github.com/rust-lang/rust/issues/27438#issuecomment-665739234" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/27438/hovercard">here</a>.</p> | 1 |
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/15936231/92454136-c6ecaa80-f1f2-11ea-9868-4d31a1724743.png"><img src="https://user-images.githubusercontent.com/15936231/92454136-c6ecaa80-f1f2-11ea-9868-4d31a1724743.png" alt="image" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/15936231/92454331-fac7d000-f1f2-11ea-9eaf-4ed7c21142a3.png"><img src="https://user-images.githubusercontent.com/15936231/92454331-fac7d000-f1f2-11ea-9eaf-4ed7c21142a3.png" alt="image" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/15936231/92454417-14691780-f1f3-11ea-9579-d966efdc9180.png"><img src="https://user-images.githubusercontent.com/15936231/92454417-14691780-f1f3-11ea-9579-d966efdc9180.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">this issue is caused by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="695687412" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/7390" data-hovercard-type="issue" data-hovercard-url="/denoland/deno/issues/7390/hovercard" href="https://github.com/denoland/deno/issues/7390">#7390</a></p> | <p dir="auto">Lets say I have code like this:</p>
<p dir="auto">foo.ts:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { myDep } from "https://unpkg.com/[email protected]/myDep.ts""><pre class="notranslate"><code class="notranslate">import { myDep } from "https://unpkg.com/[email protected]/myDep.ts"
</code></pre></div>
<p dir="auto">bar.ts:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { myDep } from "https://unpkg.com/[email protected]/myDep.ts""><pre class="notranslate"><code class="notranslate">import { myDep } from "https://unpkg.com/[email protected]/myDep.ts"
</code></pre></div>
<p dir="auto">How do I ensure my versions of myDep stay in sync across <code class="notranslate">foo.ts</code> and <code class="notranslate">bar.ts</code>?</p>
<p dir="auto">Should Deno-idomatic code use dependency injection so dependencies are only externally referenced in one place? That seems like a good idea, but difficult to enforce.</p> | 0 |
<p dir="auto">Sorry, long post :)</p>
<p dir="auto">I know this project is <strong>web</strong>pack, though it seems to have quite a lot of features (well done by the way). I've started writing a node packer (and I came up with a similar <a href="https://github.com/jpillora/node-bale/blob/master/templates/main.js">bootstrapper</a> to yours). I had the grand goal of packing (in a similar flat file as yours) an entire application, with all of its dependencies. After a couple days working on it, it seems like there are many difficult corner cases. Such as:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var app = express()
app.use(express.static(__dirname + '/../static')); //lack of path.join"><pre class="notranslate"><code class="notranslate">var app = express()
app.use(express.static(__dirname + '/../static')); //lack of path.join
</code></pre></div>
<p dir="auto">At compile time, you could calculate which directory <code class="notranslate">static</code> is, though you wouldn't know what <code class="notranslate">express</code>, for example, is doing with it. My solution was to force each module to specify it's static files using a glob like: <code class="notranslate">./static/**</code>. Then there's the problem of where to copy all these static files. They can't go next the <code class="notranslate">bundle.js</code>, with 40+ modules, there would be a clash. So then you need to namespace static files, and rewrite all file references. I think the optimal solution for the filesystem stuff is to dynamically rewrite the <code class="notranslate">fs</code> module to modify filepaths before passing them to the real <code class="notranslate">fs</code> methods.</p>
<p dir="auto">After running into many problems, introducing exceptions for each disallowed case, dynamic requires, etc. Forcing a manifest.</p>
<p dir="auto">I'm modified my packer to now just do a directory copy, with the ability to rewrite the source. like change <code class="notranslate">my-secret-module.js</code> to <code class="notranslate">x.js</code> and all requires to <code class="notranslate">x</code> too. While minifying ofcourse. I plan to do like a "progressive enhancement" of packing. So start a normal directory copy, though <strong>when possible</strong>, compress filenames, flatten modules, etc. Optimally, I'd like no manifest file, and if you write your JS in an analysable way, the packer will pack tighter, if not it'll still work.</p>
<p dir="auto">Just wondering on your thoughts about Node.js, I know it's not your target, though many companies would be interested in getting it right, since it would allow for <em>safer</em> (even though it's not perfect) distribution.</p>
<p dir="auto">I originally came up with the same module number indexing scheme. Though I moved to full-path hashing + hash compression. So, <code class="notranslate">my/path/to/file.js</code> might hash to <code class="notranslate">aef83c1........</code>, and another might hash to <code class="notranslate">a2d553.....</code>. After all hashes have been calculated. You can compress them all. The above two would compress to <code class="notranslate">ae</code> and <code class="notranslate">a2</code>. With hashing, it allows you to convert <code class="notranslate">require(myvar)</code> into <code class="notranslate">require(__hash(myvar))</code>. Though there are still a few issues, like calculating the fullpath from a module requires you to store the path along side the module. However, I think this could be solved with some more cryptomagic. If you're happy with indices, instead of using an object <code class="notranslate">{0:a 1:b 2:c }</code>, you can equivalently use array <code class="notranslate">[ a, b, c]</code> - save a few bytes.</p> | <h2 dir="auto">Feature request</h2>
<p dir="auto">Here is the bug-ish issue I'm running into:</p>
<p dir="auto"><a href="https://github.com/jedwards1211/webpack-code-splitting-issue/tree/two-async-chunks">https://github.com/jedwards1211/webpack-code-splitting-issue/tree/two-async-chunks</a></p>
<h3 dir="auto"><code class="notranslate">index.js</code></h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import('./chunk1.js')
import('./chunk2.js')"><pre class="notranslate"><span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-s">'./chunk1.js'</span><span class="pl-kos">)</span>
<span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-s">'./chunk2.js'</span><span class="pl-kos">)</span></pre></div>
<h3 dir="auto"><code class="notranslate">chunk1.js</code></h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { Toggle } from 'react-powerplug';
console.log(Toggle)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-v">Toggle</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'react-powerplug'</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-v">Toggle</span><span class="pl-kos">)</span></pre></div>
<h3 dir="auto"><code class="notranslate">chunk2.js</code></h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { Value } from 'react-powerplug';
console.log(Value)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-v">Value</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'react-powerplug'</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-v">Value</span><span class="pl-kos">)</span></pre></div>
<h3 dir="auto"><code class="notranslate">webpack.config.js</code></h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// webpack.config.js
module.exports = {
mode: 'production',
externals: {
'react': 'React'
},
}"><pre class="notranslate"><span class="pl-c">// webpack.config.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">mode</span>: <span class="pl-s">'production'</span><span class="pl-kos">,</span>
<span class="pl-c1">externals</span>: <span class="pl-kos">{</span>
<span class="pl-s">'react'</span>: <span class="pl-s">'React'</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">webpack it on the command line</p>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
<code class="notranslate">dist/1.js</code> contains <code class="notranslate">Toggle</code> but not <code class="notranslate">Value</code>.<br>
<code class="notranslate">dist/2.js</code> contains <code class="notranslate">Value</code> but not <code class="notranslate">Toggle</code>.</p>
<p dir="auto"><strong>Current behavior</strong><br>
<code class="notranslate">dist/1.js</code> contains both <code class="notranslate">Toggle</code> and <code class="notranslate">Value</code>.<br>
<code class="notranslate">dist/2.js</code> contains both <code class="notranslate">Toggle</code> and <code class="notranslate">Value</code>.</p>
<p dir="auto">It seems that the tree shaking is applied to <code class="notranslate">react-powerplug</code> main module itself, irrespective of the individual chunks that are importing from it.</p>
<p dir="auto"><strong>What is motivation or use case for adding/changing the behavior?</strong><br>
Many packages nowadays use rollup to bundle their code into a single JS module and distribute that one file (or maybe one bundle for ES5, one bundle for ES2015). As such, I want to be confident that Webpack will eliminate dead code effectively when several different chunks of my app are importing from a rollup bundle.</p>
<p dir="auto"><strong>How should this be implemented in your opinion?</strong><br>
Hopefully, tree-shaking can be performed on <code class="notranslate">react-powerplug</code> for the import in <code class="notranslate">chunk1.js</code>, and then a second, different round of tree-shaking can be performed for the import in <code class="notranslate">chunk2.js</code>. Right now it seems like Webpack is only performing one tree-shaking operation on <code class="notranslate">react-powerplug</code> based upon all imports from it from all chunks in my app.</p>
<p dir="auto"><strong>Are you willing to work on this yourself?</strong><br>
I would need a lot of guidance, as this seems like this might require a significant refactor</p> | 0 |
<p dir="auto">The last patches for the modal break some functionality. One is easy to test.</p>
<p dir="auto"><a href="http://jsfiddle.net/MUu4K/1/" rel="nofollow">http://jsfiddle.net/MUu4K/1/</a></p>
<p dir="auto">In the fiddle above, try to close the modal, open it and then close it again by the button "close" or the "x" at the top. It does not work anymore.</p>
<p dir="auto">used rev: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/twbs/bootstrap/commit/92c2ad98e753c64a2bd6e3fb94870a2ad3ee0333/hovercard" href="https://github.com/twbs/bootstrap/commit/92c2ad98e753c64a2bd6e3fb94870a2ad3ee0333"><tt>92c2ad9</tt></a></p> | <p dir="auto">Hi,</p>
<p dir="auto">The code used on last Thursday worked fine. But after updated to latest code on Monday (GMT+8), the modal dialog when clicks to dismiss for seconds onward cannot be close.</p>
<p dir="auto">I am checking on source code line 932, if I commented out this line then it is working again.</p>
<p dir="auto">this.$element<br>
.removeClass('in')<br>
.attr('aria-hidden', true)<br>
//.off('click.dismiss.modal')</p>
<p dir="auto">Am I missing anything...?</p>
<p dir="auto">Sorry for the grammar. Thanks.</p> | 1 |
<p dir="auto"><em>Please make sure that this is a build/installation issue. As per our <a href="https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md">GitHub Policy</a>, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template</em></p>
<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>OS Platform and Distribution: Ubuntu 16.04<br>
Using Docker (latest-gpu image)</li>
<li>Mobile Device: No</li>
<li>TensorFlow installed from (source or binary): N/A</li>
<li>TensorFlow version: 1.13.0-rc1</li>
<li>Python version: Python 3.5.2</li>
<li>Installed using virtualenv? pip? conda?: N/A</li>
<li>Bazel version (if compiling from source): N/A</li>
<li>GCC/Compiler version (if compiling from source): N/A</li>
<li>CUDA/cuDNN version:<br>
nvcc: NVIDIA (R) Cuda compiler driver<br>
Copyright (c) 2005-2018 NVIDIA Corporation<br>
Built on Sat_Aug_25_21:08:01_CDT_2018<br>
Cuda compilation tools, release 10.0, V10.0.130</li>
<li>GPU model and memory: Quadro M1200</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="==============NVSMI LOG==============
Timestamp : Mon Feb 25 00:50:20 2019
Driver Version : 410.78
CUDA Version : 10.0
Attached GPUs : 1
GPU 00000000:01:00.0
Product Name : Quadro M1200
Product Brand : Quadro
Display Mode : Disabled
Display Active : Disabled
Persistence Mode : Enabled
Accounting Mode : Disabled
Accounting Mode Buffer Size : 4000
Driver Model
Current : N/A
Pending : N/A
Serial Number : N/A
GPU UUID : GPU-d9093d17-7927-a053-9104-426e68b1d4ac
Minor Number : 0
VBIOS Version : 82.07.BB.00.13
MultiGPU Board : No
Board ID : 0x100
GPU Part Number : N/A
Inforom Version
Image Version : N/A
OEM Object : N/A
ECC Object : N/A
Power Management Object : N/A
GPU Operation Mode
Current : N/A
Pending : N/A
GPU Virtualization Mode
Virtualization mode : None
IBMNPU
Relaxed Ordering Mode : N/A
PCI
Bus : 0x01
Device : 0x00
Domain : 0x0000
Device Id : 0x13B610DE
Bus Id : 00000000:01:00.0
Sub System Id : 0x224D17AA
GPU Link Info
PCIe Generation
Max : 3
Current : 3
Link Width
Max : 16x
Current : 16x
Bridge Chip
Type : N/A
Firmware : N/A
Replays since reset : 0
Tx Throughput : 0 KB/s
Rx Throughput : 0 KB/s
Fan Speed : N/A
Performance State : P0
Clocks Throttle Reasons
Idle : Not Active
Applications Clocks Setting : Active
SW Power Cap : Not Active
HW Slowdown : Not Active
HW Thermal Slowdown : N/A
HW Power Brake Slowdown : N/A
Sync Boost : Not Active
SW Thermal Slowdown : Not Active
Display Clock Setting : Not Active
FB Memory Usage
Total : 4043 MiB
Used : 3813 MiB
Free : 230 MiB
BAR1 Memory Usage
Total : 256 MiB
Used : 3 MiB
Free : 253 MiB
Compute Mode : Default
Utilization
Gpu : 0 %
Memory : 0 %
Encoder : 0 %
Decoder : 0 %
Encoder Stats
Active Sessions : 0
Average FPS : 0
Average Latency : 0
FBC Stats
Active Sessions : 0
Average FPS : 0
Average Latency : 0
Ecc Mode
Current : N/A
Pending : N/A
ECC Errors
Volatile
Single Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
CBU : N/A
Total : N/A
Double Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
CBU : N/A
Total : N/A
Aggregate
Single Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
CBU : N/A
Total : N/A
Double Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
CBU : N/A
Total : N/A
Retired Pages
Single Bit ECC : N/A
Double Bit ECC : N/A
Pending : N/A
Temperature
GPU Current Temp : 37 C
GPU Shutdown Temp : N/A
GPU Slowdown Temp : 96 C
GPU Max Operating Temp : 92 C
Memory Current Temp : N/A
Memory Max Operating Temp : N/A
Power Readings
Power Management : N/A
Power Draw : N/A
Power Limit : N/A
Default Power Limit : N/A
Enforced Power Limit : N/A
Min Power Limit : N/A
Max Power Limit : N/A
Clocks
Graphics : 993 MHz
SM : 993 MHz
Memory : 2505 MHz
Video : 893 MHz
Applications Clocks
Graphics : N/A
Memory : N/A
Default Applications Clocks
Graphics : N/A
Memory : N/A
Max Clocks
Graphics : 1150 MHz
SM : 1150 MHz
Memory : 2505 MHz
Video : 1035 MHz
Max Customer Boost Clocks
Graphics : N/A
Clock Policy
Auto Boost : N/A
Auto Boost Default : N/A
Processes
Process ID : 1123
Type : G
Name : /usr/lib/xorg/Xorg
Used GPU Memory : 8 MiB
Process ID : 31763
Type : C
Name : python
Used GPU Memory : 3791 MiB"><pre class="notranslate"><code class="notranslate">==============NVSMI LOG==============
Timestamp : Mon Feb 25 00:50:20 2019
Driver Version : 410.78
CUDA Version : 10.0
Attached GPUs : 1
GPU 00000000:01:00.0
Product Name : Quadro M1200
Product Brand : Quadro
Display Mode : Disabled
Display Active : Disabled
Persistence Mode : Enabled
Accounting Mode : Disabled
Accounting Mode Buffer Size : 4000
Driver Model
Current : N/A
Pending : N/A
Serial Number : N/A
GPU UUID : GPU-d9093d17-7927-a053-9104-426e68b1d4ac
Minor Number : 0
VBIOS Version : 82.07.BB.00.13
MultiGPU Board : No
Board ID : 0x100
GPU Part Number : N/A
Inforom Version
Image Version : N/A
OEM Object : N/A
ECC Object : N/A
Power Management Object : N/A
GPU Operation Mode
Current : N/A
Pending : N/A
GPU Virtualization Mode
Virtualization mode : None
IBMNPU
Relaxed Ordering Mode : N/A
PCI
Bus : 0x01
Device : 0x00
Domain : 0x0000
Device Id : 0x13B610DE
Bus Id : 00000000:01:00.0
Sub System Id : 0x224D17AA
GPU Link Info
PCIe Generation
Max : 3
Current : 3
Link Width
Max : 16x
Current : 16x
Bridge Chip
Type : N/A
Firmware : N/A
Replays since reset : 0
Tx Throughput : 0 KB/s
Rx Throughput : 0 KB/s
Fan Speed : N/A
Performance State : P0
Clocks Throttle Reasons
Idle : Not Active
Applications Clocks Setting : Active
SW Power Cap : Not Active
HW Slowdown : Not Active
HW Thermal Slowdown : N/A
HW Power Brake Slowdown : N/A
Sync Boost : Not Active
SW Thermal Slowdown : Not Active
Display Clock Setting : Not Active
FB Memory Usage
Total : 4043 MiB
Used : 3813 MiB
Free : 230 MiB
BAR1 Memory Usage
Total : 256 MiB
Used : 3 MiB
Free : 253 MiB
Compute Mode : Default
Utilization
Gpu : 0 %
Memory : 0 %
Encoder : 0 %
Decoder : 0 %
Encoder Stats
Active Sessions : 0
Average FPS : 0
Average Latency : 0
FBC Stats
Active Sessions : 0
Average FPS : 0
Average Latency : 0
Ecc Mode
Current : N/A
Pending : N/A
ECC Errors
Volatile
Single Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
CBU : N/A
Total : N/A
Double Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
CBU : N/A
Total : N/A
Aggregate
Single Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
CBU : N/A
Total : N/A
Double Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
CBU : N/A
Total : N/A
Retired Pages
Single Bit ECC : N/A
Double Bit ECC : N/A
Pending : N/A
Temperature
GPU Current Temp : 37 C
GPU Shutdown Temp : N/A
GPU Slowdown Temp : 96 C
GPU Max Operating Temp : 92 C
Memory Current Temp : N/A
Memory Max Operating Temp : N/A
Power Readings
Power Management : N/A
Power Draw : N/A
Power Limit : N/A
Default Power Limit : N/A
Enforced Power Limit : N/A
Min Power Limit : N/A
Max Power Limit : N/A
Clocks
Graphics : 993 MHz
SM : 993 MHz
Memory : 2505 MHz
Video : 893 MHz
Applications Clocks
Graphics : N/A
Memory : N/A
Default Applications Clocks
Graphics : N/A
Memory : N/A
Max Clocks
Graphics : 1150 MHz
SM : 1150 MHz
Memory : 2505 MHz
Video : 1035 MHz
Max Customer Boost Clocks
Graphics : N/A
Clock Policy
Auto Boost : N/A
Auto Boost Default : N/A
Processes
Process ID : 1123
Type : G
Name : /usr/lib/xorg/Xorg
Used GPU Memory : 8 MiB
Process ID : 31763
Type : C
Name : python
Used GPU Memory : 3791 MiB
</code></pre></div>
<p dir="auto"><strong>Describe the problem</strong></p>
<p dir="auto">When using my GPU, it takes several minutes (just over 4 minutes) to initialise to do anything. Issue does not exist when using CPU</p>
<p dir="auto"><strong>Provide the exact sequence of commands / steps that you executed before running into the problem</strong></p>
<p dir="auto"><code class="notranslate">docker run -it -u $(id -u):$(id -g) --runtime=nvidia -v $(realpath ~/tensorflow):/tf/tensorflow tensorflow/tensorflow:latest-gpu bash</code></p>
<p dir="auto"><code class="notranslate">python test.py</code></p>
<p dir="auto">contents of test.py:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import tensorflow as tf
mnist = tf.keras.datasets.mnist
(x_train, y_train),(x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(input_shape=(28, 28)),
tf.keras.layers.Dense(512, activation=tf.nn.relu),
tf.keras.layers.Dropout(0.2),
tf.keras.layers.Dense(10, activation=tf.nn.softmax)
])
model.compile(optimizer='adam',
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
model.fit(x_train, y_train, epochs=5)
model.evaluate(x_test, y_test)"><pre class="notranslate"><code class="notranslate">import tensorflow as tf
mnist = tf.keras.datasets.mnist
(x_train, y_train),(x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(input_shape=(28, 28)),
tf.keras.layers.Dense(512, activation=tf.nn.relu),
tf.keras.layers.Dropout(0.2),
tf.keras.layers.Dense(10, activation=tf.nn.softmax)
])
model.compile(optimizer='adam',
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
model.fit(x_train, y_train, epochs=5)
model.evaluate(x_test, y_test)
</code></pre></div>
<p dir="auto"><strong>Any other info / logs</strong><br>
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.</p>
<p dir="auto">logs while running test script</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz
11493376/11490434 [==============================] - 0s 0us/step
11501568/11490434 [==============================] - 0s 0us/step
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/resource_variable_ops.py:435: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/layers/core.py:143: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
2019-02-25 05:46:52.561440: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-02-25 05:46:52.628689: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:998] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2019-02-25 05:46:52.629997: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x50be7d0 executing computations on platform CUDA. Devices:
2019-02-25 05:46:52.630035: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): Quadro M1200, Compute Capability 5.0
2019-02-25 05:46:52.664820: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2808000000 Hz
2019-02-25 05:46:52.666234: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x5128500 executing computations on platform Host. Devices:
2019-02-25 05:46:52.666318: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): <undefined>, <undefined>
2019-02-25 05:46:52.666979: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 0 with properties:
name: Quadro M1200 major: 5 minor: 0 memoryClockRate(GHz): 1.148
pciBusID: 0000:01:00.0
totalMemory: 3.95GiB freeMemory: 3.90GiB
2019-02-25 05:46:52.667052: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0
2019-02-25 05:46:52.669065: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-02-25 05:46:52.669122: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0
2019-02-25 05:46:52.669152: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N
2019-02-25 05:46:52.669563: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3696 MB memory) -> physical GPU (device: 0, name: Quadro M1200, pci bus id: 0000:01:00.0, compute capability: 5.0)
Epoch 1/5
2019-02-25 05:51:01.254939: I tensorflow/stream_executor/dso_loader.cc:152] successfully opened CUDA library libcublas.so.10.0 locally
60000/60000 [==============================] - 5s 84us/sample - loss: 0.2207 - acc: 0.9348
Epoch 2/5
60000/60000 [==============================] - 5s 79us/sample - loss: 0.0960 - acc: 0.9714
Epoch 3/5
60000/60000 [==============================] - 5s 78us/sample - loss: 0.0697 - acc: 0.9774
Epoch 4/5
60000/60000 [==============================] - 5s 79us/sample - loss: 0.0536 - acc: 0.9826
Epoch 5/5
60000/60000 [==============================] - 5s 76us/sample - loss: 0.0430 - acc: 0.9857
10000/10000 [==============================] - 0s 29us/sample - loss: 0.0606 - acc: 0.9813"><pre class="notranslate"><code class="notranslate">Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz
11493376/11490434 [==============================] - 0s 0us/step
11501568/11490434 [==============================] - 0s 0us/step
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/resource_variable_ops.py:435: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/layers/core.py:143: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
2019-02-25 05:46:52.561440: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-02-25 05:46:52.628689: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:998] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2019-02-25 05:46:52.629997: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x50be7d0 executing computations on platform CUDA. Devices:
2019-02-25 05:46:52.630035: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): Quadro M1200, Compute Capability 5.0
2019-02-25 05:46:52.664820: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2808000000 Hz
2019-02-25 05:46:52.666234: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x5128500 executing computations on platform Host. Devices:
2019-02-25 05:46:52.666318: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): <undefined>, <undefined>
2019-02-25 05:46:52.666979: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 0 with properties:
name: Quadro M1200 major: 5 minor: 0 memoryClockRate(GHz): 1.148
pciBusID: 0000:01:00.0
totalMemory: 3.95GiB freeMemory: 3.90GiB
2019-02-25 05:46:52.667052: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0
2019-02-25 05:46:52.669065: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-02-25 05:46:52.669122: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0
2019-02-25 05:46:52.669152: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N
2019-02-25 05:46:52.669563: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3696 MB memory) -> physical GPU (device: 0, name: Quadro M1200, pci bus id: 0000:01:00.0, compute capability: 5.0)
Epoch 1/5
2019-02-25 05:51:01.254939: I tensorflow/stream_executor/dso_loader.cc:152] successfully opened CUDA library libcublas.so.10.0 locally
60000/60000 [==============================] - 5s 84us/sample - loss: 0.2207 - acc: 0.9348
Epoch 2/5
60000/60000 [==============================] - 5s 79us/sample - loss: 0.0960 - acc: 0.9714
Epoch 3/5
60000/60000 [==============================] - 5s 78us/sample - loss: 0.0697 - acc: 0.9774
Epoch 4/5
60000/60000 [==============================] - 5s 79us/sample - loss: 0.0536 - acc: 0.9826
Epoch 5/5
60000/60000 [==============================] - 5s 76us/sample - loss: 0.0430 - acc: 0.9857
10000/10000 [==============================] - 0s 29us/sample - loss: 0.0606 - acc: 0.9813
</code></pre></div> | <p dir="auto">I noticed that tensorflow always takes about ~2min before it actually starts to compute. I've been trying to find out, why this happens, and nothing really worked so far.</p>
<p dir="auto"><a href="https://www.tensorflow.org/install/install_windows" rel="nofollow">Tensorflow site</a> says, I should use CUDA® Toolkit 9.0 and cuDNN v7.0. I have CUDA 9.0, so I downloaded CuDNN 7.0.5 for CUDA 9.0 and pasted the files to *C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0*, overwriting the ones form cuDNN 7.1.2, which I tested earlier. To make sure, I pip-installed tensorflow-gpu into a fresh anaconda env. See install <a href="https://pastebin.com/rjiV1s3b" rel="nofollow">here</a>. The issue is still the same.</p>
<p dir="auto">CUDA works, since it prints the <em>'Hello, TensorFlow!'</em>, when I use the official test example, but before that it takes like 2minutes every time!</p>
<p dir="auto">When I tested this with <a href="https://drive.google.com/drive/folders/1lVK_ABvVHzVYKs7X5SUhcZFBgKpC41Qw" rel="nofollow">another wheel</a> (<a href="http://www.python36.com/install-tensorflow-gpu-windows/" rel="nofollow">which is linked in this tutorial</a>, I did not compile it myself.) on cuda 9.1/cudnn7.0.5, I had the same issues. A NVIDIA employee <a href="https://stackoverflow.com/questions/49770217/why-does-cuda-initialisation-take-so-long-python-vscode-anaconda-tensorflow" rel="nofollow">on stackoverflow</a> suggested, I may be hitting a lengthy JIT compile step, because the GTX 1080 has compute capability of 6.1, which the wheel I used may not be compiled for.</p>
<p dir="auto">So I tried to find wheels for tensorflow with compute capability 6.1 for windows, but <a href="https://github.com/fo40225/tensorflow-windows-wheel/tree/master/1.5.0/py36/GPU/cuda91cudnn7avx2">the only one I found</a> and tested produced the same problem.</p>
<p dir="auto">Am I doing something wrong here, or do I just have to accept the 2min delay everytime I start my tensorflow/keras scripts?</p>
<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>:<br>
Code:</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import time
start_time = time.time()
import tensorflow as tf
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
c = tf.matmul(a, b)
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
print(sess.run(c))
timer = time.time()
print(timer - start_time)"><pre class="notranslate"><code class="notranslate">import time
start_time = time.time()
import tensorflow as tf
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
c = tf.matmul(a, b)
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
print(sess.run(c))
timer = time.time()
print(timer - start_time)
</code></pre></div>
<p dir="auto">Output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(tf_clean) C:\python_code\test>C:/anaconda/envs/tf_clean/python.exe c:/python_code/test/tf_test.py
2018-04-18 14:36:04.376661: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this
TensorFlow binary was not compiled to use: AVX2
2018-04-18 14:36:04.689661: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1344] Found device 0 with properties:
name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7335
pciBusID: 0000:01:00.0
totalMemory: 8.00GiB freeMemory: 6.60GiB
2018-04-18 14:36:04.699485: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1423] Adding visible gpu devices: 0
2018-04-18 14:38:12.227561: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:911] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-04-18 14:38:12.234504: I T:\src\github\tens2018-04-18 14:38:12.237156: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:930] 0: N
2018-04-18 14:38:12.240997: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1041] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6379 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)
Device mapping:
/job:localhost/replica:0/task:0/device:GPU:0 -> device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1
2018-04-18 14:38:12.548288: I T:\src\github\tensorflow\tensorflow\core\common_runtime\direct_session.cc:297] Device mapping:
/job:localhost/replica:0/task:0/device:GPU:0 -> device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1
MatMul: (MatMul): /job:localhost/replica:0/task:0/device:GPU:0
2018-04-18 14:38:12.559262: I T:\src\github\tensorflow\tensorflow\core\common_runtime\placer.cc:884] MatMul: (MatMul)/job:localhost/replica:0/task:0/device:GPU:0
b: (Const): /job:localhost/replica:0/task:0/device:GPU:0
2018-04-18 14:38:12.564847: I T:\src\github\tensorflow\tensorflow\core\common_runtime\placer.cc:884] b: (Const)/job:localhost/replica:0/task:0/device:GPU:0
a: (Const): /job:localhost/replica:0/task:0/device:GPU:0
2018-04-18 14:38:12.570545: I T:\src\github\tensorflow\tensorflow\core\common_runtime\placer.cc:884] a: (Const)/job:localhost/replica:0/task:0/device:GPU:0
[[22. 28.]
[49. 64.]]
129.14624643325806"><pre class="notranslate"><code class="notranslate">(tf_clean) C:\python_code\test>C:/anaconda/envs/tf_clean/python.exe c:/python_code/test/tf_test.py
2018-04-18 14:36:04.376661: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this
TensorFlow binary was not compiled to use: AVX2
2018-04-18 14:36:04.689661: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1344] Found device 0 with properties:
name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7335
pciBusID: 0000:01:00.0
totalMemory: 8.00GiB freeMemory: 6.60GiB
2018-04-18 14:36:04.699485: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1423] Adding visible gpu devices: 0
2018-04-18 14:38:12.227561: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:911] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-04-18 14:38:12.234504: I T:\src\github\tens2018-04-18 14:38:12.237156: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:930] 0: N
2018-04-18 14:38:12.240997: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1041] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6379 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)
Device mapping:
/job:localhost/replica:0/task:0/device:GPU:0 -> device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1
2018-04-18 14:38:12.548288: I T:\src\github\tensorflow\tensorflow\core\common_runtime\direct_session.cc:297] Device mapping:
/job:localhost/replica:0/task:0/device:GPU:0 -> device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1
MatMul: (MatMul): /job:localhost/replica:0/task:0/device:GPU:0
2018-04-18 14:38:12.559262: I T:\src\github\tensorflow\tensorflow\core\common_runtime\placer.cc:884] MatMul: (MatMul)/job:localhost/replica:0/task:0/device:GPU:0
b: (Const): /job:localhost/replica:0/task:0/device:GPU:0
2018-04-18 14:38:12.564847: I T:\src\github\tensorflow\tensorflow\core\common_runtime\placer.cc:884] b: (Const)/job:localhost/replica:0/task:0/device:GPU:0
a: (Const): /job:localhost/replica:0/task:0/device:GPU:0
2018-04-18 14:38:12.570545: I T:\src\github\tensorflow\tensorflow\core\common_runtime\placer.cc:884] a: (Const)/job:localhost/replica:0/task:0/device:GPU:0
[[22. 28.]
[49. 64.]]
129.14624643325806
</code></pre></div>
<ul dir="auto">
<li>
<p dir="auto"><strong>OS Platform and Distribution</strong>:<br>
Windows 10 Education (Version 10.0.16299 Build 16299)<br>
Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz, 3408 MHz, 4 Cores</p>
</li>
<li>
<p dir="auto"><strong>TensorFlow installed from (source or binary)</strong>:<br>
binary</p>
</li>
<li>
<p dir="auto"><strong>TensorFlow version</strong>:<br>
tensorflow-gpu 1.5.0, 1.7.0</p>
</li>
<li>
<p dir="auto"><strong>Python version</strong>:<br>
3.5.5 & 3.6 (via anaconda, conda 4.5.1.)</p>
</li>
<li>
<p dir="auto"><strong>Bazel Version</strong>:<br>
N/A</p>
</li>
<li>
<p dir="auto"><strong>CUDA/cuDNN version</strong>:<br>
Tested combinations:<br>
CUDA 9.0 and CuDNN 7.1.2 (tested on tensorflow 1.5.0, 1.7.0 and 1.8.0-dev20180329)<br>
CUDA 9.1 and CuDNN 7.0.5 (tested on tensorflow 1.5.0 and 1.7.0)</p>
</li>
<li>
<p dir="auto"><strong>GPU model and memory</strong>:<br>
NVIDIA GeForce GTX 1080 (GP104-400) [Hewlett-Packard], 8192 MBytes of GDDR5X SDRAM [Micron]</p>
</li>
<li>
<p dir="auto"><strong>Exact command to reproduce</strong>:<br>
See: <em>Have I written custom code...</em></p>
</li>
</ul>
<p dir="auto">=================================================================<br>
EDIT:</p>
<p dir="auto">Threadstarter here, hello.</p>
<blockquote>
<p dir="auto">Could you try with the latest nightly?<br>
<a href="https://files.pythonhosted.org/packages/67/c0/e68a4f0400340b54c887703baa8eee188042c3d65a0cf535dda71abffbc2/tf_nightly_gpu-1.13.0.dev20190205-cp37-cp37m-win_amd64.whl" rel="nofollow">https://files.pythonhosted.org/packages/67/c0/e68a4f0400340b54c887703baa8eee188042c3d65a0cf535dda71abffbc2/tf_nightly_gpu-1.13.0.dev20190205-cp37-cp37m-win_amd64.whl</a></p>
</blockquote>
<p dir="auto"><strong>This works!</strong> I checked with that wheel, and then with <code class="notranslate">tf-nightly-gpu-2.0-preview</code> on PYPI, which also worked.<br>
I initially wanted to use the anaconda cudatoolkit and cudnn packages, but currently, cudnn is only available up to version 7.3.1 on anaconda-cloud. Tensorflow 2.0 however, is compiled with 7.4.1, so I had to do this the oldschool way, and download the setups from Nvidia.<br>
Soon, though...<a href="https://imgur.com/a/A2jZizt" rel="nofollow">soon</a>.</p>
<p dir="auto">For everyone, here's what I did, as a guide:</p>
<h3 dir="auto">How to install Tensorflow Nightly 2.0 GPU in Anaconda on Windows 10 x64</h3>
<p dir="auto">• I installed these CUDA/CuDnn Versions:<br>
– cuda_10.0.130_win10_network (Nvidia CUDA Download: <a href="https://developer.nvidia.com/cuda-toolkit" rel="nofollow">https://developer.nvidia.com/cuda-toolkit</a>)<br>
– cuDNN v7.4.1 (Nov 8, 2018), for CUDA 10.0 (Nvidia CuDnn Download: <a href="https://developer.nvidia.com/cudnn" rel="nofollow">https://developer.nvidia.com/cudnn</a>)<br>
– Don't forget to check, whether the Cuda setup has correctly written itself to the PATH system variable.<br>
– Reboot.<br>
• Now make a new environment in Anaconda and activate it:<br>
– <code class="notranslate">conda create --name tf2-nightly-gpu python=3.6</code><br>
– <code class="notranslate">activate tf2-nightly-gpu</code><br>
• Now, with the new env still activated, install the latest Tensorflow 2.0 nightly GPU build from PYPI:<br>
– <code class="notranslate">pip install tf-nightly-gpu-2.0-preview</code><br>
• For machine learning in Jupyter notebook (or Jupyter Lab) , you need these as well:<br>
– <code class="notranslate">conda install nb_conda matplotlib scipy Pillow pandas scikit-learn</code><br>
• Check, if your GPU is recognized by Tensorflow. Open the Anaconda prompt, activate the new environment and type <code class="notranslate">python</code>, then press Enter. Now type:<br>
<code class="notranslate">import tensorflow as tf</code><br>
<code class="notranslate">tf.test.is_gpu_available(cuda_only=False,min_cuda_compute_capability=None) </code><br>
• Output should be something like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(tf2-nightly-gpu) C:\Users\___>python
>>> import tensorflow as tf
>>> tf.test.is_gpu_available(cuda_only=False,min_cuda_compute_capability=None)
2019-03-19 17:46:25.722209: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2019-03-19 17:46:25.729724: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library nvcuda.dll
2019-03-19 17:46:25.922934: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1551] Found device 0 with properties:
name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7335
pciBusID: 0000:01:00.0
totalMemory: 8.00GiB freeMemory: 6.61GiB
2019-03-19 17:46:25.938231: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1674] Adding visible gpu devices: 0
2019-03-19 17:46:26.539185: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1082] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-03-19 17:46:26.546009: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1088] 0
2019-03-19 17:46:26.550123: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1101] 0: N
2019-03-19 17:46:26.554188: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1222] Created TensorFlow device (/device:GPU:0 with 6360 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)
True"><pre class="notranslate"><code class="notranslate">(tf2-nightly-gpu) C:\Users\___>python
>>> import tensorflow as tf
>>> tf.test.is_gpu_available(cuda_only=False,min_cuda_compute_capability=None)
2019-03-19 17:46:25.722209: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2019-03-19 17:46:25.729724: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library nvcuda.dll
2019-03-19 17:46:25.922934: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1551] Found device 0 with properties:
name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7335
pciBusID: 0000:01:00.0
totalMemory: 8.00GiB freeMemory: 6.61GiB
2019-03-19 17:46:25.938231: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1674] Adding visible gpu devices: 0
2019-03-19 17:46:26.539185: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1082] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-03-19 17:46:26.546009: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1088] 0
2019-03-19 17:46:26.550123: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1101] 0: N
2019-03-19 17:46:26.554188: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1222] Created TensorFlow device (/device:GPU:0 with 6360 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)
True
</code></pre></div>
<p dir="auto">• Done.</p> | 1 |
<p dir="auto">This issue is explained in details in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="69690167" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/2839" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/2839/hovercard" href="https://github.com/microsoft/TypeScript/issues/2839">#2839</a></p>
<h2 dir="auto">Terminology</h2>
<p dir="auto">Through out this issue, i will be referring to different ways of declaring external modules, here are what i mean by them.</p>
<h4 dir="auto">Ambient external module declaration</h4>
<p dir="auto">Module declarations of the form:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="declare module "mod" {
....
}"><pre class="notranslate"><span class="pl-k">declare</span> module <span class="pl-s">"mod"</span> <span class="pl-kos">{</span>
...<span class="pl-kos">.</span>
<span class="pl-kos">}</span></pre></div>
<h4 dir="auto">Proper external modules</h4>
<p dir="auto">The other way of writing a declaration of a module, i.e. a declaration file with a top level <code class="notranslate">import</code> or <code class="notranslate">export</code>; e.g.:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { Contract } from ".\core"
export var MyContract: Contract;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">Contract</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">".\core"</span>
<span class="pl-k">export</span> <span class="pl-k">var</span> <span class="pl-smi">MyContract</span>: <span class="pl-smi">Contract</span><span class="pl-kos">;</span></pre></div>
<h4 dir="auto">Script file</h4>
<p dir="auto">A file that is not a module, i.e. does not include a top level <code class="notranslate">import</code> or <code class="notranslate">export</code>. it could however, include ambient external module declarations as described above.</p>
<h2 dir="auto">Background</h2>
<p dir="auto">With module resolution work done in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="99076428" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/4154" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/TypeScript/pull/4154/hovercard" href="https://github.com/microsoft/TypeScript/pull/4154">#4154</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="101743391" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/4352" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/TypeScript/pull/4352/hovercard" href="https://github.com/microsoft/TypeScript/pull/4352">#4352</a>, it is possible for node package authors to distribute typings with their packages. For these packages, users do not have to independently acquire the typings from definitely typed, but will just <code class="notranslate">import</code> the package, the the compiler will locate the typings in the package directory (either <code class="notranslate">index.d.ts</code> or by following <code class="notranslate">typings</code> property in <code class="notranslate">package.json</code> in the package directory).</p>
<p dir="auto">As noted in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="69690167" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/2839" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/2839/hovercard" href="https://github.com/microsoft/TypeScript/issues/2839">#2839</a>, for a package author interested in distributing their typings with their package, there are dependencies that they need typings for; the most common would be <code class="notranslate">node.d.ts</code>, which is possibly referenced by each package.</p>
<p dir="auto">The way they dependency typing are authored today on definitely typed is using <em>ambient external module declaration</em>; this indicates that these typings exist in the global scope, and thus are susceptible to conflicts. The classic the diamond dependency issue (courtesy of <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/poelstra/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/poelstra">@poelstra</a>):</p>
<ul dir="auto">
<li>myprogram
<ul dir="auto">
<li>mylib
<ul dir="auto">
<li>[email protected]</li>
</ul>
</li>
<li>myotherlib
<ul dir="auto">
<li>[email protected]</li>
</ul>
</li>
</ul>
</li>
</ul>
<p dir="auto">Now, if <code class="notranslate">myUtils.d.ts</code> uses <em>ambient external module declaration</em>, this is guaranteed to result in re-declaration errors.</p>
<h2 dir="auto">Proposal</h2>
<p dir="auto">When resolving an <code class="notranslate">import</code> target in a node module, it is an <strong>error</strong> to include files that are <strong>not</strong> either:</p>
<ol dir="auto">
<li><strong>Proper external modules</strong>, or</li>
<li>A <strong>Versioned script file</strong> - see below</li>
</ol>
<p dir="auto">For proper external modules, there are no conflicts expected, as external modules do no polute the global namespace.</p>
<p dir="auto">For versioned files, referring to the same library, the compiler will follow a <em>conflict resolution</em> logic picking only the <strong>latest</strong> copy (as described by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/basarat/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/basarat">@basarat</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="69690167" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/2839" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/2839/hovercard?comment_id=94630741&comment_type=issue_comment" href="https://github.com/microsoft/TypeScript/issues/2839#issuecomment-94630741">#2839 (comment)</a>). The files provided on the command line will be allowed to override this conflict resolution policy.</p>
<h2 dir="auto">Versioned files</h2>
<p dir="auto">These are files declaring an <strong>identity</strong>, i.e. a name and a version. A versioned file is expected to contain a comment at the top of the form</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/// <library name="myLibraryName" version="1.0.23.2-beta" />"><pre class="notranslate"><span class="pl-c">/// <library name="myLibraryName" version="1.0.23.2-beta" /></span></pre></div>
<p dir="auto">Where the <code class="notranslate">name</code> field is optional, and if committed, the file name is used instead, and the <code class="notranslate">version</code> field follows the version definition in <a href="http://semver.org/" rel="nofollow">http://semver.org/</a></p> | <p dir="auto">TypeScript support only two way of TSX transformation:</p>
<ol dir="auto">
<li>Preserve. I can compile to preserve and process file by classic JSX transform. This way support many framework.</li>
<li>React. This is hard coded transformation only for React. This way is not honest in relation to other frameworks.</li>
</ol>
<p dir="auto">I want to use TSX view on difference frameworks, such as angular 1/2, mithril, vanilajs and others. Maybe well be better make not a hard coded transformation? Maybe better way well be make customizable transformation rule, based on d.ts.</p> | 0 |
<h3 dir="auto">Apache Airflow Provider(s)</h3>
<p dir="auto">vertica</p>
<h3 dir="auto">Versions of Apache Airflow Providers</h3>
<p dir="auto">3.1.0</p>
<h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">2.3.2</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">MacOS - arm64</p>
<h3 dir="auto">Deployment</h3>
<p dir="auto">Virtualenv installation</p>
<h3 dir="auto">Deployment details</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">What happened</h3>
<p dir="auto">Rendered SQL duplicated in task log</p>
<h3 dir="auto">What you think should happen instead</h3>
<p dir="auto">When VerticaOperator is being executed, we should disable log_sql when initializing VerticaHook</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">Simply execute a sql statement using VerticaOperator</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.2.0</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">Debian buster</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">astro dev start</p>
<h3 dir="auto">What happened</h3>
<p dir="auto">When I have tried to duplicate a connection first time it has created a connection with hello_copy1 and duplicating the same connection second time giving me an error of<br>
<code class="notranslate">Connection hello_copy2 can't be added. Integrity error, probably unique constraint.</code></p>
<h3 dir="auto">What you expected to happen</h3>
<p dir="auto">It should create a connection with name hello_copy3 or the error message should be more user friendly.</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="870020355" data-permission-text="Title is private" data-url="https://github.com/apache/airflow/issues/15574" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/15574/hovercard?comment_id=912438705&comment_type=issue_comment" href="https://github.com/apache/airflow/pull/15574#issuecomment-912438705">#15574 (comment)</a></p>
<h3 dir="auto">Anything else</h3>
<p dir="auto">Suggested Error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Connection hello_copy2 can't be added because it already exists."><pre class="notranslate"><code class="notranslate">Connection hello_copy2 can't be added because it already exists.
</code></pre></div>
<p dir="auto">or<br>
Change the number logic in _copyN so the new name will be always unique.</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> | 0 |
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">cloudflare_dns</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.0.0
"><pre class="notranslate"><code class="notranslate">ansible 2.3.0.0
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">ansible_python_interpreter=/usr/bin/python3</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">run: MacOS<br>
man: Ubuntu 16.04</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">python3 is not working as PY3 has urllib.parse.urlencode instead of urllib.urlencode</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">cloudflare_dns module</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible_module_cloudflare_dns.py\", line 451, in get_zones\r\n param = '?' + urllib.urlencode({'name' : name})\r\nAttributeError: module 'urllib' has no attribute 'urlencode'\r\n", "msg": "MODULE FAILURE""><pre class="notranslate"><code class="notranslate">ansible_module_cloudflare_dns.py\", line 451, in get_zones\r\n param = '?' + urllib.urlencode({'name' : name})\r\nAttributeError: module 'urllib' has no attribute 'urlencode'\r\n", "msg": "MODULE FAILURE"
</code></pre></div> | <h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">mount module</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.1.0
config file = /home/user/project/ansible.cfg
configured module search path = Default w/o overrides
"><pre class="notranslate"><code class="notranslate">ansible 2.2.1.0
config file = /home/user/project/ansible.cfg
configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">None</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Running Ansible on Ubuntu Mate 16.10<br>
Managing Ubuntu Server 16.04</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Using the mount module to create a mount for a cifs share. In the options argument<br>
using the credentials option fails to create the mount.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- name: add mount remote backup
mount:
name: /mnt/RemoteBackups
src: //server/RemoteBackups$
opts: "credentials=/root/smbcred,gid=999,uid=999"
fstype: cifs
state: mounted
become: true # as root"><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">add mount remote backup</span>
<span class="pl-ent">mount</span>:
<span class="pl-ent">name</span>: <span class="pl-s">/mnt/RemoteBackups</span>
<span class="pl-ent">src</span>: <span class="pl-s">//server/RemoteBackups$</span>
<span class="pl-ent">opts</span>: <span class="pl-s"><span class="pl-pds">"</span>credentials=/root/smbcred,gid=999,uid=999<span class="pl-pds">"</span></span>
<span class="pl-ent">fstype</span>: <span class="pl-s">cifs</span>
<span class="pl-ent">state</span>: <span class="pl-s">mounted</span>
<span class="pl-ent">become</span>: <span class="pl-s">true </span><span class="pl-c"><span class="pl-c">#</span> as root</span></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">I expected the mount to be created.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" "invocation": { [1728/4589]
"module_args": {
"boot": "yes",
"dump": null,
"fstab": "/etc/fstab",
"fstype": "cifs",
"name": "/mnt/RemoteBackups",
"opts": "credentials=/root/smbcred",
"passno": null,
"src": "//server/RemoteBackups$",
"state": "mounted"
},
"module_name": "mount"
},
"msg": "Error mounting /mnt/RemoteBackups: mount: wrong fs type, bad option, bad superblock on //server/RemoteBackups$,\n miss
ing codepage or helper program, or other error\n (for several filesystems (e.g. nfs, cifs) you might\n need a /sbin/mount.<type>
helper program)\n\n In some cases useful info is found in syslog - try\n dmesg | tail or so.\n"
"><pre class="notranslate"><code class="notranslate"> "invocation": { [1728/4589]
"module_args": {
"boot": "yes",
"dump": null,
"fstab": "/etc/fstab",
"fstype": "cifs",
"name": "/mnt/RemoteBackups",
"opts": "credentials=/root/smbcred",
"passno": null,
"src": "//server/RemoteBackups$",
"state": "mounted"
},
"module_name": "mount"
},
"msg": "Error mounting /mnt/RemoteBackups: mount: wrong fs type, bad option, bad superblock on //server/RemoteBackups$,\n miss
ing codepage or helper program, or other error\n (for several filesystems (e.g. nfs, cifs) you might\n need a /sbin/mount.<type>
helper program)\n\n In some cases useful info is found in syslog - try\n dmesg | tail or so.\n"
</code></pre></div> | 0 |
<p dir="auto">Text inside of tooltips will not be wrapped if the element is inside a ´.btn-group´.</p>
<p dir="auto">See here:<br>
<a href="http://jsfiddle.net/VGuTj/" rel="nofollow">http://jsfiddle.net/VGuTj/</a></p> | <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<div class="btn-group">
<a class="btn" rel="popover" data-content="Lorem ipsum dolor sit amet.">Click me!</a>
</div>"><pre lang="ħtml" class="notranslate"><code class="notranslate"><div class="btn-group">
<a class="btn" rel="popover" data-content="Lorem ipsum dolor sit amet.">Click me!</a>
</div>
</code></pre></div>
<p dir="auto">Clicking the button results in a blank popover appearing. Am I doing something wrong or is this an issue? If so, is there any workaround in the meantime?</p>
<p dir="auto">Thanks in advance.</p> | 1 |
<p dir="auto">It would be great if we can allow user to adjust position of the "debug-actions-widget" according to their choice.<br>
What we will get out of it:</p>
<ol dir="auto">
<li>We have one open issue (# 4332) where user not able to see the linter error message as it is covered by debug-actions-widget .</li>
<li>When user is working with small screen size (with chrome debugger tool window opened), some time file name is covered by debug-actions-widget.</li>
</ol>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/17735796/14399953/0f48d082-fda7-11e5-86f9-2c3f93e861dc.png"><img src="https://cloud.githubusercontent.com/assets/17735796/14399953/0f48d082-fda7-11e5-86f9-2c3f93e861dc.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Expected:</p>
<ol dir="auto">
<li>Make the "debug-actions-widget" position configurable (Horizontal, vertical etc.)</li>
<li>Allow user to adjust position by dragging.</li>
</ol> | <p dir="auto">I have two screens which I regularly switch between. My font size is configured to be just right on one of them, but it appears far too large on the other monitor.</p>
<p dir="auto">This is probably an advanced feature request, but I would like to have a way to configure the font size differently for each display I have.</p> | 0 |
<p dir="auto">As per <a href="https://groups.google.com/forum/#!topic/flutter-dev/mcbtlgRea-g" rel="nofollow">this thread</a>, platforms messages are relayed on and must be responded to on the main thread.</p>
<p dir="auto">This should probably be documented, both at the <a href="https://github.com/flutter/website/blob/master/platform-channels.md">platform-channels page</a> and in code documentation if relevant (FlutterResult, somewhere in FlutterBinaryMessenger, FlutterTextureRegister.textureFrameAvailable for a start).</p>
<p dir="auto">I started trying to write something to go into the platform-channels page at least but then realized that this is probably something that would warrant code examples at least in the page, if not an entire example project (unfortunately I don't have time right now to help with either of those).</p>
<p dir="auto">If it is something that might be considered for adding to the roadmap to be changed at some point, then maybe minimal documentation would be enough.</p>
<p dir="auto">This is what I started, if it's useful feel free to use it:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="## Threading in platform-specific code
Platform messages (including MethodChannel calls) are relayed and must be replied to
on the platform's main thread. Any tasks that run in background threads must relay
back to the main thread before responding.
This can be accomplished several different ways on each platform. A simple solution on
iOS is post tasks to [`Dispatch Queues`], while on android [`AsyncTask`] can
be used to process data and then handle the response from the initial thread.
[AsyncTask]:https://developer.apple.com/documentation/dispatch
[Dispatch Queues]:https://developer.android.com/reference/android/os/AsyncTask.html"><pre class="notranslate"><code class="notranslate">## Threading in platform-specific code
Platform messages (including MethodChannel calls) are relayed and must be replied to
on the platform's main thread. Any tasks that run in background threads must relay
back to the main thread before responding.
This can be accomplished several different ways on each platform. A simple solution on
iOS is post tasks to [`Dispatch Queues`], while on android [`AsyncTask`] can
be used to process data and then handle the response from the initial thread.
[AsyncTask]:https://developer.apple.com/documentation/dispatch
[Dispatch Queues]:https://developer.android.com/reference/android/os/AsyncTask.html
</code></pre></div> | <h2 dir="auto">Steps to Reproduce</h2>
<p dir="auto">Honestly, a bunch of things can cause Flutter to segfault.</p>
<ul dir="auto">
<li>
<p dir="auto">Scrolling a list with a bunch of images sometimes causes a segfault.</p>
</li>
<li>
<p dir="auto">Using the observatory sometimes causes a segfault.</p>
</li>
</ul>
<p dir="auto">Sometimes the segfaults don't even occur, which is even weirder.</p>
<h2 dir="auto">Backtrace</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="* thread #1, name = 'roid.synsthetic', stop reason = signal SIGSEGV: invalid address (fault address: 0x5)
* frame #0: 0x96879d38 libflutter.so
frame #1: 0x96878414 libflutter.so
frame #2: 0x968782e8 libflutter.so
frame #3: 0x96898736 libflutter.so
frame #4: 0x9688026a libflutter.so
frame #5: 0x96882dd8 libflutter.so
frame #6: 0xb0eade88 libutils.so`android::Looper::pollInner(int) + 612
frame #7: 0xb0eadb9a libutils.so`android::Looper::pollOnce(int, int*, int*, void**) + 30
frame #8: 0xb16c8c9c libandroid_runtime.so`android::NativeMessageQueue::pollOnce(_JNIEnv*, _jobject*, int) + 26
frame #9: 0x73859efe boot-framework.oat`nativePollOnce(this=<unavailable>, (null)=<unavailable>, (null)=<unavailable>) + 98
frame #10: 0x9a31520d"><pre class="notranslate"><code class="notranslate">* thread #1, name = 'roid.synsthetic', stop reason = signal SIGSEGV: invalid address (fault address: 0x5)
* frame #0: 0x96879d38 libflutter.so
frame #1: 0x96878414 libflutter.so
frame #2: 0x968782e8 libflutter.so
frame #3: 0x96898736 libflutter.so
frame #4: 0x9688026a libflutter.so
frame #5: 0x96882dd8 libflutter.so
frame #6: 0xb0eade88 libutils.so`android::Looper::pollInner(int) + 612
frame #7: 0xb0eadb9a libutils.so`android::Looper::pollOnce(int, int*, int*, void**) + 30
frame #8: 0xb16c8c9c libandroid_runtime.so`android::NativeMessageQueue::pollOnce(_JNIEnv*, _jobject*, int) + 26
frame #9: 0x73859efe boot-framework.oat`nativePollOnce(this=<unavailable>, (null)=<unavailable>, (null)=<unavailable>) + 98
frame #10: 0x9a31520d
</code></pre></div>
<h2 dir="auto">Memory map for libflutter.so</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Sections for 'C:\Users\ds841\.lldb\module_cache\remote-android\.cache\62357273-0000-0000-0000-000000000000\libflutter.so' (arm):
SectID Type Load Address Perm File Off. File Size Flags Section Name
---------- ---------------- --------------------------------------- ---- ---------- ---------- ---------- ----------------------------
0x00000001 regular --- 0x00000000 0x00000000 0x00000000 libflutter.so.
0x00000002 elf-dynamic-symbols [0x00000000967ea114-0x00000000967edd64) r-- 0x00000114 0x00003c50 0x00000002 libflutter.so..dynsym
0x00000003 regular [0x00000000967edd64-0x00000000967f3d23) r-- 0x00003d64 0x00005fbf 0x00000002 libflutter.so..dynstr
0x00000004 regular [0x00000000967f3d24-0x00000000967f5464) r-- 0x00009d24 0x00001740 0x00000002 libflutter.so..hash
0x00000005 regular [0x00000000967f5464-0x00000000967f5bee) r-- 0x0000b464 0x0000078a 0x00000002 libflutter.so..gnu.version
0x00000006 regular [0x00000000967f5bf0-0x00000000967f5c0c) r-- 0x0000bbf0 0x0000001c 0x00000002 libflutter.so..gnu.version_d
0x00000007 regular [0x00000000967f5c0c-0x00000000967f5c6c) r-- 0x0000bc0c 0x00000060 0x00000002 libflutter.so..gnu.version_r
0x00000008 elf-relocation-entries [0x00000000967f5c6c-0x000000009686fc84) r-- 0x0000bc6c 0x0007a018 0x00000002 libflutter.so..rel.dyn
0x00000009 elf-relocation-entries [0x000000009686fc84-0x00000000968705cc) r-- 0x00085c84 0x00000948 0x00000042 libflutter.so..rel.plt
0x0000000a regular [0x00000000968705cc-0x00000000968713cc) r-x 0x000865cc 0x00000e00 0x00000006 libflutter.so..plt
0x0000000b code [0x0000000096871400-0x0000000096eeda84) r-x 0x00087400 0x0067c684 0x00000006 libflutter.so..text
0x0000000c ARM.exidx [0x0000000096eeda84-0x0000000096f1b17c) r-- 0x00703a84 0x0002d6f8 0x00000082 libflutter.so..ARM.exidx
0x0000000d regular [0x0000000096f1b180-0x00000000974b3cf6) r-- 0x00731180 0x00598b76 0x00000002 libflutter.so..rodata
0x0000000e ARM.extab [0x00000000974b3cf8-0x00000000974bcf08) r-- 0x00cc9cf8 0x00009210 0x00000002 libflutter.so..ARM.extab
0x0000000f regular [0x00000000974be400-0x0000000097507ff0) rw- 0x00cd3400 0x00049bf0 0x00000003 libflutter.so..data.rel.ro
0x00000010 regular [0x0000000097507ff0-0x0000000097508108) rw- 0x00d1cff0 0x00000118 0x00000003 libflutter.so..init_array
0x00000011 regular [0x0000000097508108-0x0000000097508110) rw- 0x00d1d108 0x00000008 0x00000003 libflutter.so..fini_array
0x00000012 elf-dynamic-link-info [0x0000000097508110-0x0000000097508240) rw- 0x00d1d110 0x00000130 0x00000003 libflutter.so..dynamic
0x00000013 regular [0x0000000097508244-0x000000009750a000) rw- 0x00d1d244 0x00001dbc 0x00000003 libflutter.so..got
0x00000014 data [0x000000009750a000-0x000000009750b298) rw- 0x00d1f000 0x00001298 0x00000003 libflutter.so..data
0x00000015 zero-fill [0x000000009750b2a0-0x0000000097516dcc) rw- 0x00d20298 0x00000000 0x00000003 libflutter.so..bss
0x00000016 regular --- 0x00d20298 0x00000188 0x00000030 libflutter.so..comment
0x00000017 regular --- 0x00d20420 0x0000001c 0x00000000 libflutter.so..note.gnu.gold-version
0x00000018 regular --- 0x00d2043c 0x00000038 0x00000000 libflutter.so..ARM.attributes
0x00000019 regular --- 0x00d20474 0x000000f0 0x00000000 libflutter.so..shstrtab"><pre class="notranslate"><code class="notranslate">Sections for 'C:\Users\ds841\.lldb\module_cache\remote-android\.cache\62357273-0000-0000-0000-000000000000\libflutter.so' (arm):
SectID Type Load Address Perm File Off. File Size Flags Section Name
---------- ---------------- --------------------------------------- ---- ---------- ---------- ---------- ----------------------------
0x00000001 regular --- 0x00000000 0x00000000 0x00000000 libflutter.so.
0x00000002 elf-dynamic-symbols [0x00000000967ea114-0x00000000967edd64) r-- 0x00000114 0x00003c50 0x00000002 libflutter.so..dynsym
0x00000003 regular [0x00000000967edd64-0x00000000967f3d23) r-- 0x00003d64 0x00005fbf 0x00000002 libflutter.so..dynstr
0x00000004 regular [0x00000000967f3d24-0x00000000967f5464) r-- 0x00009d24 0x00001740 0x00000002 libflutter.so..hash
0x00000005 regular [0x00000000967f5464-0x00000000967f5bee) r-- 0x0000b464 0x0000078a 0x00000002 libflutter.so..gnu.version
0x00000006 regular [0x00000000967f5bf0-0x00000000967f5c0c) r-- 0x0000bbf0 0x0000001c 0x00000002 libflutter.so..gnu.version_d
0x00000007 regular [0x00000000967f5c0c-0x00000000967f5c6c) r-- 0x0000bc0c 0x00000060 0x00000002 libflutter.so..gnu.version_r
0x00000008 elf-relocation-entries [0x00000000967f5c6c-0x000000009686fc84) r-- 0x0000bc6c 0x0007a018 0x00000002 libflutter.so..rel.dyn
0x00000009 elf-relocation-entries [0x000000009686fc84-0x00000000968705cc) r-- 0x00085c84 0x00000948 0x00000042 libflutter.so..rel.plt
0x0000000a regular [0x00000000968705cc-0x00000000968713cc) r-x 0x000865cc 0x00000e00 0x00000006 libflutter.so..plt
0x0000000b code [0x0000000096871400-0x0000000096eeda84) r-x 0x00087400 0x0067c684 0x00000006 libflutter.so..text
0x0000000c ARM.exidx [0x0000000096eeda84-0x0000000096f1b17c) r-- 0x00703a84 0x0002d6f8 0x00000082 libflutter.so..ARM.exidx
0x0000000d regular [0x0000000096f1b180-0x00000000974b3cf6) r-- 0x00731180 0x00598b76 0x00000002 libflutter.so..rodata
0x0000000e ARM.extab [0x00000000974b3cf8-0x00000000974bcf08) r-- 0x00cc9cf8 0x00009210 0x00000002 libflutter.so..ARM.extab
0x0000000f regular [0x00000000974be400-0x0000000097507ff0) rw- 0x00cd3400 0x00049bf0 0x00000003 libflutter.so..data.rel.ro
0x00000010 regular [0x0000000097507ff0-0x0000000097508108) rw- 0x00d1cff0 0x00000118 0x00000003 libflutter.so..init_array
0x00000011 regular [0x0000000097508108-0x0000000097508110) rw- 0x00d1d108 0x00000008 0x00000003 libflutter.so..fini_array
0x00000012 elf-dynamic-link-info [0x0000000097508110-0x0000000097508240) rw- 0x00d1d110 0x00000130 0x00000003 libflutter.so..dynamic
0x00000013 regular [0x0000000097508244-0x000000009750a000) rw- 0x00d1d244 0x00001dbc 0x00000003 libflutter.so..got
0x00000014 data [0x000000009750a000-0x000000009750b298) rw- 0x00d1f000 0x00001298 0x00000003 libflutter.so..data
0x00000015 zero-fill [0x000000009750b2a0-0x0000000097516dcc) rw- 0x00d20298 0x00000000 0x00000003 libflutter.so..bss
0x00000016 regular --- 0x00d20298 0x00000188 0x00000030 libflutter.so..comment
0x00000017 regular --- 0x00d20420 0x0000001c 0x00000000 libflutter.so..note.gnu.gold-version
0x00000018 regular --- 0x00d2043c 0x00000038 0x00000000 libflutter.so..ARM.attributes
0x00000019 regular --- 0x00d20474 0x000000f0 0x00000000 libflutter.so..shstrtab
</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 (on Microsoft Windows [Version 10.0.14393], locale en-US, channel master)
• Flutter at C:\Users\ds841\Documents\flutter
• Framework revision 9fb6fd81b9 (30 hours ago), 2017-09-15 07:37:08 -0700
• Engine revision 0e8ffa24e0
• Tools Dart version 1.25.0-dev.11.0
[√] Android toolchain - develop for Android devices (Android SDK 26.0.1)
• Android SDK at C:\Users\ds841\AppData\Local\Android\sdk
• Platform android-26, build-tools 26.0.1
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)
[√] Android Studio (version 2.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)
[√] IntelliJ IDEA Community Edition (version 2017.2)
• Flutter plugin version 17.0
• Dart plugin version 172.3968.27
[√] Connected devices
• XT1635 01 • ZY223J6829 • android-arm • Android 7.1.1 (API 25)"><pre class="notranslate"><code class="notranslate">[√] Flutter (on Microsoft Windows [Version 10.0.14393], locale en-US, channel master)
• Flutter at C:\Users\ds841\Documents\flutter
• Framework revision 9fb6fd81b9 (30 hours ago), 2017-09-15 07:37:08 -0700
• Engine revision 0e8ffa24e0
• Tools Dart version 1.25.0-dev.11.0
[√] Android toolchain - develop for Android devices (Android SDK 26.0.1)
• Android SDK at C:\Users\ds841\AppData\Local\Android\sdk
• Platform android-26, build-tools 26.0.1
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)
[√] Android Studio (version 2.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)
[√] IntelliJ IDEA Community Edition (version 2017.2)
• Flutter plugin version 17.0
• Dart plugin version 172.3968.27
[√] Connected devices
• XT1635 01 • ZY223J6829 • android-arm • Android 7.1.1 (API 25)
</code></pre></div> | 1 |
<p dir="auto">Hello! I've updated <code class="notranslate">matplotlib</code> to the latest version (3.1.1) and got an issue: imshow draws half of the first and last lines when I use <code class="notranslate">set_yticks</code>.</p>
<p dir="auto">Example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np
from matplotlib import pyplot as plt
oneDim = np.array([0.5,1,2.5,3.7])
twoDim = np.random.rand(8,4)
plt.figure(figsize=(twoDim.shape[1]/2,twoDim.shape[0]/2))
ax = plt.gca()
ax.imshow(twoDim, cmap='Purples', interpolation='nearest', aspect='auto')
ax.set_xticks(np.arange(0,twoDim.shape[1],1))
ax.set_yticks(np.arange(0,twoDim.shape[0],1))
ax.set_yticklabels(np.arange(0,twoDim.shape[0],1))
ax.grid()"><pre class="notranslate"><code class="notranslate">import numpy as np
from matplotlib import pyplot as plt
oneDim = np.array([0.5,1,2.5,3.7])
twoDim = np.random.rand(8,4)
plt.figure(figsize=(twoDim.shape[1]/2,twoDim.shape[0]/2))
ax = plt.gca()
ax.imshow(twoDim, cmap='Purples', interpolation='nearest', aspect='auto')
ax.set_xticks(np.arange(0,twoDim.shape[1],1))
ax.set_yticks(np.arange(0,twoDim.shape[0],1))
ax.set_yticklabels(np.arange(0,twoDim.shape[0],1))
ax.grid()
</code></pre></div>
<p dir="auto">Result:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1708680/63940647-9b2cd580-ca72-11e9-9377-4939e14c93c0.png"><img src="https://user-images.githubusercontent.com/1708680/63940647-9b2cd580-ca72-11e9-9377-4939e14c93c0.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">How I can back to full square in line instead of the half?</p> | <h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">The very top and bottom of the heatmaps are getting truncated to 1/2 height in version <code class="notranslate">3.1.1</code>. This does not happen for version <code class="notranslate">3.0.3</code>.</p>
<p dir="auto">This is the code from a Jupyter Notebook</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib
import pandas as pd
import numpy as np
import seaborn as sb
%pylab inline
print(matplotlib.__version__)
print(sb.__version__)
grid = pd.DataFrame(np.arange(9).reshape((3,3))/10)
fig, ax = subplots(1, 1, figsize=(5, 5))
sb.heatmap(grid, annot=True, fmt=".0f", ax=ax, cmap='RdBu', vmin=0, vmax=1, cbar=True);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</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">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">sb</span>
<span class="pl-c1">%</span><span class="pl-s1">pylab</span> <span class="pl-s1">inline</span>
<span class="pl-en">print</span>(<span class="pl-s1">matplotlib</span>.<span class="pl-s1">__version__</span>)
<span class="pl-en">print</span>(<span class="pl-s1">sb</span>.<span class="pl-s1">__version__</span>)
<span class="pl-s1">grid</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-en">arange</span>(<span class="pl-c1">9</span>).<span class="pl-en">reshape</span>((<span class="pl-c1">3</span>,<span class="pl-c1">3</span>))<span class="pl-c1">/</span><span class="pl-c1">10</span>)
<span class="pl-s1">fig</span>, <span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-en">subplots</span>(<span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-s1">figsize</span><span class="pl-c1">=</span>(<span class="pl-c1">5</span>, <span class="pl-c1">5</span>))
<span class="pl-s1">sb</span>.<span class="pl-en">heatmap</span>(<span class="pl-s1">grid</span>, <span class="pl-s1">annot</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, <span class="pl-s1">fmt</span><span class="pl-c1">=</span><span class="pl-s">".0f"</span>, <span class="pl-s1">ax</span><span class="pl-c1">=</span><span class="pl-s1">ax</span>, <span class="pl-s1">cmap</span><span class="pl-c1">=</span><span class="pl-s">'RdBu'</span>, <span class="pl-s1">vmin</span><span class="pl-c1">=</span><span class="pl-c1">0</span>, <span class="pl-s1">vmax</span><span class="pl-c1">=</span><span class="pl-c1">1</span>, <span class="pl-s1">cbar</span><span class="pl-c1">=</span><span class="pl-c1">True</span>);</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Populating the interactive namespace from numpy and matplotlib
3.1.1
0.9.0"><pre class="notranslate"><code class="notranslate">Populating the interactive namespace from numpy and matplotlib
3.1.1
0.9.0
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1696066/60530345-87f5c780-9cc6-11e9-9e31-a251283f3f7e.png"><img src="https://user-images.githubusercontent.com/1696066/60530345-87f5c780-9cc6-11e9-9e31-a251283f3f7e.png" alt="download" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Matplotlib version</strong></p>
<ul dir="auto">
<li>Operating system: Ubuntu Linux</li>
<li>Matplotlib version: 3.1.1</li>
<li>Matplotlib backend: module://ipykernel.pylab.backend_inline</li>
<li>Python version: 3.6</li>
<li>Jupyter version (if applicable): 4.4.0</li>
<li>Other libraries:</li>
</ul> | 1 |
<h1 dir="auto">Why Mypy re-enable</h1>
<p dir="auto">For a few weeks MyPy checks have been disabled after the switch to Python 3.7 (per <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1039799030" data-permission-text="Title is private" data-url="https://github.com/apache/airflow/issues/19317" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/19317/hovercard" href="https://github.com/apache/airflow/pull/19317">#19317</a>).</p>
<p dir="auto">We should, however, re-enable it back as it is very useful in catching a number of mistakes.</p>
<h1 dir="auto">How does it work</h1>
<p dir="auto">We 've re-added the mypy pre-commit now - with mypy bumped to 0.910. This version detects far more errors and we should fix them all before we switch the CI check back.</p>
<ul dir="auto">
<li>
<p dir="auto">mypy will be running for incremental changes in pre-commit, same as before. This will enable incremental fixes of the code changed by committers who use pre-commits locally</p>
</li>
<li>
<p dir="auto">mypy on CI runs in non-failing mode. When the main pre-commit check is run, mypy is disabled, but then it is run as a separate step (which does not fail but will show the result of running mypy on all our code). This will enable us to track the progress of fixes</p>
</li>
</ul>
<h1 dir="auto">Can I help with the effort, you ask?</h1>
<p dir="auto">We started concerted effort now and incrementally fix all the mypy incompatibilities - ideally package/by/package to avoid huge code reviews. We'd really appreciate a number of people to contribute, so that we can re-enable mypy back fully and quickly :).</p>
<h1 dir="auto">How can I help?</h1>
<p dir="auto">What you need is:</p>
<ul dir="auto">
<li>checkout <code class="notranslate">main</code></li>
<li><code class="notranslate">./breeeze build-image</code></li>
<li><code class="notranslate">pip install pre-commit</code></li>
<li><code class="notranslate">pre-commit install</code></li>
</ul>
<p dir="auto">This will enable automated checks for when you do a regular contribution. When you make your change, any MyPy issues will be reporteed and you need to fix them all to commit. You can also commit with <code class="notranslate">--no-verify</code> flag to skip that, bu, well, if you can improve airlfow a little - why not?</p>
<h1 dir="auto">How can I help more ?</h1>
<p dir="auto">You can add PRs that are fixing whole packages, without contributing features or bugfixes. Please refer to this issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1067158141" data-permission-text="Title is private" data-url="https://github.com/apache/airflow/issues/19891" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/19891/hovercard" href="https://github.com/apache/airflow/issues/19891">#19891</a> and ideally comment below in the issue that you want to take care of a package (to avoid duplicate work).</p>
<p dir="auto">An easy way to run MyPy check for package can be done either from the host:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="find DIRECTORY -name "*.py" | xargs pre-commit run mypy --files"><pre class="notranslate"><code class="notranslate">find DIRECTORY -name "*.py" | xargs pre-commit run mypy --files
</code></pre></div>
<p dir="auto">or from ./breeze shell:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="mypy --namespace-packages DIRECTORY"><pre class="notranslate"><code class="notranslate">mypy --namespace-packages DIRECTORY
</code></pre></div>
<h1 dir="auto">Current list of mypy PRs:</h1>
<p dir="auto"><a href="https://github.com/apache/airflow/pulls?q=is%3Aopen+is%3Apr+label%3Amypy">https://github.com/apache/airflow/pulls?q=is%3Aopen+is%3Apr+label%3Amypy</a></p>
<h1 dir="auto">Remaining packages</h1>
<p dir="auto">Here is the list of remaining packages to be "mypy compliant" generated with:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pre-commit run mypy --all-files 2>&1 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | grep "error:" | sort | awk 'FS=":" { print $1 }' | xargs dirname | sort | uniq -c | xargs -n 2 printf "* [ ] (%4d) %s\n""><pre class="notranslate"><code class="notranslate">pre-commit run mypy --all-files 2>&1 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | grep "error:" | sort | awk 'FS=":" { print $1 }' | xargs dirname | sort | uniq -c | xargs -n 2 printf "* [ ] (%4d) %s\n"
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ( 1) airflow/api/common/experimental</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ( 1) airflow/contrib/sensors</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ( 1) airflow/example_dags</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ( 1) airflow/jobs</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ( 4) airflow/models</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ( 1) airflow/providers/microsoft/winrm/hooks</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ( 1) airflow/providers/ssh/hooks</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ( 1) tests/providers/amazon/aws/hooks</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ( 1) tests/providers/google/cloud/hooks</li>
</ul>
<h3 dir="auto">Committer</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I acknowledge that I am a maintainer/committer of the Apache Airflow project.</li>
</ul> | <p dir="auto"><strong>Description</strong><br>
Allow DAG to accept list of cron expression and schedule the dag in correlation to all of them.<br>
Similar to how it can be done in cron job</p>
<p dir="auto"><strong>Use case / motivation</strong><br>
Some scheduling like: every 10 min between 16:30 to 18:10 can not be obtained with single cron expression. The idea is that DAG will have the ability to be set according to more than 1 cron but without duplicating the DAG code or the DAG entry in the UI</p>
<p dir="auto">Even simple scheduling which is common for ETL : bi-weekly can not be done with single cron expression: <a href="https://serverfault.com/questions/404398/how-to-schedule-a-biweekly-cronjob" rel="nofollow">https://serverfault.com/questions/404398/how-to-schedule-a-biweekly-cronjob</a></p> | 0 |
<p dir="auto">Got the following when building (app still runs though):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="flutter: The following assertion was thrown building MaterialApp(dirty, state: _MaterialAppState#c51fa):
flutter: 'package:flutter/src/widgets/app.dart': Failed assertion: line 169 pos 15: 'navigatorObservers !=
flutter: null': is not true.
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter: https://github.com/flutter/flutter/issues/new?template=BUG.md
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #2 new WidgetsApp (package:flutter/src/widgets/app.dart:169:15)
flutter: #3 _MaterialAppState.build (package:flutter/src/material/app.dart:410:14)
flutter: #4 StatefulElement.build (package:flutter/src/widgets/framework.dart:3809:27)
flutter: #5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3721:15)
flutter: #6 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
flutter: #7 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
flutter: #8 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
flutter: #9 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
flutter: #10 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
flutter: #11 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
flutter: #12 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
flutter: #13 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
flutter: #14 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
flutter: #15 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
flutter: #16 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
flutter: #17 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
flutter: #18 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
flutter: #19 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:909:16)
flutter: #20 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:880:5)
flutter: #21 RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/binding.dart:826:17)
flutter: #22 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2266:19)
flutter: #23 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:825:13)
flutter: #24 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:712:7)
flutter: #25 runApp (package:flutter/src/widgets/binding.dart:756:7)"><pre class="notranslate"><code class="notranslate">flutter: The following assertion was thrown building MaterialApp(dirty, state: _MaterialAppState#c51fa):
flutter: 'package:flutter/src/widgets/app.dart': Failed assertion: line 169 pos 15: 'navigatorObservers !=
flutter: null': is not true.
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter: https://github.com/flutter/flutter/issues/new?template=BUG.md
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #2 new WidgetsApp (package:flutter/src/widgets/app.dart:169:15)
flutter: #3 _MaterialAppState.build (package:flutter/src/material/app.dart:410:14)
flutter: #4 StatefulElement.build (package:flutter/src/widgets/framework.dart:3809:27)
flutter: #5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3721:15)
flutter: #6 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
flutter: #7 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
flutter: #8 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
flutter: #9 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
flutter: #10 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
flutter: #11 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
flutter: #12 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
flutter: #13 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
flutter: #14 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
flutter: #15 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
flutter: #16 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
flutter: #17 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
flutter: #18 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
flutter: #19 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:909:16)
flutter: #20 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:880:5)
flutter: #21 RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/binding.dart:826:17)
flutter: #22 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2266:19)
flutter: #23 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:825:13)
flutter: #24 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:712:7)
flutter: #25 runApp (package:flutter/src/widgets/binding.dart:756:7)
</code></pre></div> | <p dir="auto">By specifying the <code class="notranslate">builder</code> of a <code class="notranslate">MaterialApp</code> widget, it should be possible to use a custom <code class="notranslate">Navigator</code> (or no navigator at all. The assertions of the <code class="notranslate">WidgetsApp</code> constructor make it impossible.</p>
<p dir="auto">Error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="I/flutter (19749): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (19749): The following assertion was thrown building MaterialApp(dirty, state: _MaterialAppState#f5965):
I/flutter (19749): 'package:flutter/src/widgets/app.dart': Failed assertion: line 93 pos 15: 'navigatorObservers !=
I/flutter (19749): null': is not true."><pre class="notranslate"><code class="notranslate">I/flutter (19749): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (19749): The following assertion was thrown building MaterialApp(dirty, state: _MaterialAppState#f5965):
I/flutter (19749): 'package:flutter/src/widgets/app.dart': Failed assertion: line 93 pos 15: 'navigatorObservers !=
I/flutter (19749): null': is not true.
</code></pre></div>
<p dir="auto">Removing these 2 assertions fixes the problem:</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="assert(navigatorObservers != null),
assert(onGenerateRoute != null || navigatorObservers == const <NavigatorObserver>[]),"><pre class="notranslate"><span class="pl-k">assert</span>(navigatorObservers <span class="pl-k">!=</span> <span class="pl-c1">null</span>),
<span class="pl-k">assert</span>(onGenerateRoute <span class="pl-k">!=</span> <span class="pl-c1">null</span> <span class="pl-k">||</span> navigatorObservers <span class="pl-k">==</span> <span class="pl-k">const</span> <span class="pl-k"><</span><span class="pl-c1">NavigatorObserver</span><span class="pl-k">></span>[]),</pre></div>
<p dir="auto">Example App:</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
final Map<String, WidgetBuilder> routes = {
'/': (context) => HomePage(),
'/credits': (context) => CreditsPage(),
};
RouteFactory customOnGenerateRoute = (RouteSettings settings) {
var name = settings.name;
print('going to route $name');
return new MaterialPageRoute(
builder: routes[name],
settings: settings,
);
};
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Navigator Demo',
theme: new ThemeData(primarySwatch: Colors.blue),
builder: (BuildContext context, Widget child) {
return Navigator(
onGenerateRoute: customOnGenerateRoute,
);
},
);
}
}
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Home')),
body: Center(
child: RaisedButton(
child: Text('Credits'),
onPressed: () {
Navigator.of(context).pushNamed('/credits');
},
),
),
);
}
}
class CreditsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Credits')),
body: Center(
child: Text('made by boformer'),
),
);
}
}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s">'package:flutter/material.dart'</span>;
<span class="pl-k">void</span> <span class="pl-en">main</span>() <span class="pl-k">=></span> <span class="pl-en">runApp</span>(<span class="pl-k">new</span> <span class="pl-c1">MyApp</span>());
<span class="pl-k">final</span> <span class="pl-c1">Map</span><<span class="pl-c1">String</span>, <span class="pl-c1">WidgetBuilder</span>> routes <span class="pl-k">=</span> {
<span class="pl-s">'/'</span><span class="pl-k">:</span> (context) <span class="pl-k">=></span> <span class="pl-c1">HomePage</span>(),
<span class="pl-s">'/credits'</span><span class="pl-k">:</span> (context) <span class="pl-k">=></span> <span class="pl-c1">CreditsPage</span>(),
};
<span class="pl-c1">RouteFactory</span> customOnGenerateRoute <span class="pl-k">=</span> (<span class="pl-c1">RouteSettings</span> settings) {
<span class="pl-k">var</span> name <span class="pl-k">=</span> settings.name;
<span class="pl-en">print</span>(<span class="pl-s">'going to route $<span class="pl-v">name</span>'</span>);
<span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">MaterialPageRoute</span>(
builder<span class="pl-k">:</span> routes[name],
settings<span class="pl-k">:</span> settings,
);
};
<span class="pl-k">class</span> <span class="pl-c1">MyApp</span> <span class="pl-k">extends</span> <span class="pl-c1">StatelessWidget</span> {
<span class="pl-k">@override</span>
<span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {
<span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-c1">MaterialApp</span>(
title<span class="pl-k">:</span> <span class="pl-s">'Navigator Demo'</span>,
theme<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">ThemeData</span>(primarySwatch<span class="pl-k">:</span> <span class="pl-c1">Colors</span>.blue),
builder<span class="pl-k">:</span> (<span class="pl-c1">BuildContext</span> context, <span class="pl-c1">Widget</span> child) {
<span class="pl-k">return</span> <span class="pl-c1">Navigator</span>(
onGenerateRoute<span class="pl-k">:</span> customOnGenerateRoute,
);
},
);
}
}
<span class="pl-k">class</span> <span class="pl-c1">HomePage</span> <span class="pl-k">extends</span> <span class="pl-c1">StatelessWidget</span> {
<span class="pl-k">@override</span>
<span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {
<span class="pl-k">return</span> <span class="pl-c1">Scaffold</span>(
appBar<span class="pl-k">:</span> <span class="pl-c1">AppBar</span>(title<span class="pl-k">:</span> <span class="pl-c1">Text</span>(<span class="pl-s">'Home'</span>)),
body<span class="pl-k">:</span> <span class="pl-c1">Center</span>(
child<span class="pl-k">:</span> <span class="pl-c1">RaisedButton</span>(
child<span class="pl-k">:</span> <span class="pl-c1">Text</span>(<span class="pl-s">'Credits'</span>),
onPressed<span class="pl-k">:</span> () {
<span class="pl-c1">Navigator</span>.<span class="pl-en">of</span>(context).<span class="pl-en">pushNamed</span>(<span class="pl-s">'/credits'</span>);
},
),
),
);
}
}
<span class="pl-k">class</span> <span class="pl-c1">CreditsPage</span> <span class="pl-k">extends</span> <span class="pl-c1">StatelessWidget</span> {
<span class="pl-k">@override</span>
<span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {
<span class="pl-k">return</span> <span class="pl-c1">Scaffold</span>(
appBar<span class="pl-k">:</span> <span class="pl-c1">AppBar</span>(title<span class="pl-k">:</span> <span class="pl-c1">Text</span>(<span class="pl-s">'Credits'</span>)),
body<span class="pl-k">:</span> <span class="pl-c1">Center</span>(
child<span class="pl-k">:</span> <span class="pl-c1">Text</span>(<span class="pl-s">'made by boformer'</span>),
),
);
}
}</pre></div> | 1 |
<p dir="auto">Using {% raw %} in templates does not stop jinja2 variable substitution</p>
<ul dir="auto">
<li>ansible 1.4 -devel <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/4f139673865b713ad6b5e90aa79575a19b2b237e/hovercard" href="https://github.com/ansible/ansible/commit/4f139673865b713ad6b5e90aa79575a19b2b237e"><tt>4f13967</tt></a></li>
</ul>
<p dir="auto">[playbook.yml]</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
---
- name: "test raw template output"
hosts: localhost
vars:
myvar: "foo"
tasks:
- local_action: template src="mytemplate.j2" dest="/tmp/myoutput.txt""><pre class="notranslate"><code class="notranslate">
---
- name: "test raw template output"
hosts: localhost
vars:
myvar: "foo"
tasks:
- local_action: template src="mytemplate.j2" dest="/tmp/myoutput.txt"
</code></pre></div>
<p dir="auto">[mytemplate.j2]</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Test: Preserve curly braces, and NOT perform variable substitution:
First Attempt:
{% raw %}
- { include: "{{ myvar }}" }
{% endraw %}"><pre class="notranslate"><code class="notranslate">Test: Preserve curly braces, and NOT perform variable substitution:
First Attempt:
{% raw %}
- { include: "{{ myvar }}" }
{% endraw %}
</code></pre></div>
<p dir="auto">[/tmp/myoutput.txt]</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Test: Preserve curly braces, and NOT perform variable substitution:
First Attempt:
- { include: "foo" }"><pre class="notranslate"><code class="notranslate">Test: Preserve curly braces, and NOT perform variable substitution:
First Attempt:
- { include: "foo" }
</code></pre></div>
<p dir="auto">NOTE: template output performs variable substitution even inside the {% raw %} block.</p>
<p dir="auto">REFERENCE: Workaround suggested by Brian Coa <a href="https://groups.google.com/forum/#!topic/ansible-project/Bn1ZFu5Pfb0" rel="nofollow">https://groups.google.com/forum/#!topic/ansible-project/Bn1ZFu5Pfb0</a></p> | <p dir="auto">I have a variable <code class="notranslate">hbase_standalone</code> that's set to <code class="notranslate">false</code> in defaults but for my current host it's <code class="notranslate">true</code>. And here's how my dependencies look like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dependencies:
- { role: hadoop, when: not hbase_standalone }
- { role: oracle-jdk }"><pre class="notranslate"><code class="notranslate">dependencies:
- { role: hadoop, when: not hbase_standalone }
- { role: oracle-jdk }
</code></pre></div>
<p dir="auto">So <code class="notranslate">hadoop</code> role is not included, that's fine, but <code class="notranslate">oracle-jdk</code> is also ignored! Works fine if I change the order though:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dependencies:
- { role: oracle-jdk }
- { role: hadoop, when: not hbase_standalone }"><pre class="notranslate"><code class="notranslate">dependencies:
- { role: oracle-jdk }
- { role: hadoop, when: not hbase_standalone }
</code></pre></div>
<p dir="auto">Mac OS, ansible 1.8.1.</p> | 0 |
<h1 dir="auto">Bug report</h1>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">I use facebook sdk for live video and import fb sdk, i also have a file named sdk.js, when building with webpack, the fb sdk file will be add hash.</p>
<ul dir="auto">
<li>
<p dir="auto">Before<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/24260845/99479373-03761880-2991-11eb-968c-7f6b46110550.png"><img src="https://user-images.githubusercontent.com/24260845/99479373-03761880-2991-11eb-968c-7f6b46110550.png" alt="image" style="max-width: 100%;"></a></p>
</li>
<li>
<p dir="auto">After<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/24260845/99479812-de35da00-2991-11eb-8530-b43e4ec6b5ef.png"><img src="https://user-images.githubusercontent.com/24260845/99479812-de35da00-2991-11eb-8530-b43e4ec6b5ef.png" alt="image" style="max-width: 100%;"></a></p>
</li>
</ul>
<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"><strong>Other relevant information:</strong><br>
webpack version: v4.41.0<br>
Node.js version: v12.18.2<br>
Operating System: mac os<br>
Additional tools:</p> | <p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br>
Bug</p>
<p dir="auto"><strong>What is the current behavior?</strong><br>
Uncaught ReferenceError: vendor_dll is not defined<br>
Possibly because output.library Template variables are not replaced<br>
<strong>If the current behavior is a bug, please provide the steps to reproduce.</strong><br>
See below</p>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
No reference errors when using the bundles in browser<br>
[name] replaced<br>
<strong>If this is a feature request, what is motivation or use case for changing the behavior?</strong></p>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong><br>
Version: webpack 3.4.1<br>
Typescript</p>
<p dir="auto">Currently I have a single DLL, its getting quite big, which means that "time to interactive" when I refresh pages is getting really long<br>
So I thought it may be possible to split the DLL into similar small chunks as my PROD build (pure CommonsChunkPlugin)<br>
Not sure if this is a supported scenario, it was eluded to here:<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="198951088" data-permission-text="Title is private" data-url="https://github.com/webpack/webpack/issues/3783" data-hovercard-type="issue" data-hovercard-url="/webpack/webpack/issues/3783/hovercard?comment_id=270655641&comment_type=issue_comment" href="https://github.com/webpack/webpack/issues/3783#issuecomment-270655641">#3783 (comment)</a><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="199740311" data-permission-text="Title is private" data-url="https://github.com/webpack/webpack/issues/3871" data-hovercard-type="issue" data-hovercard-url="/webpack/webpack/issues/3871/hovercard" href="https://github.com/webpack/webpack/issues/3871">#3871</a></p>
<p dir="auto">The split I want is, one chunk for homepage, one chunk for standard pages and another chunk for "editing" pages<br>
This seems to work, the DLL compiles, the DLL can be used by DllReferencePlugin without webpack generation errors, the modules are split to the expected files with no duplicatations.<br>
However if I try to use it in the browser, I get a reference failure</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var landingmodules = [
"react",
"react-dom",
"react-router",
];
var mainmodules = landingmodules.concat([
'redux',
'redux-saga',
"immutable",
]);
var maineditmodules = mainmodules.concat([
'redux-form',
"d3",
]);
const dllconfig: webpack.Configuration = mergesmart(basedllconfig, {
entry: {
landing: landingmodules,
main: mainmodules,
mainedit: maineditmodules
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: "vendor",
filename: 'vendor.js',
chunks: ["landing", "main", "mainedit"],
minChunks: 3
}),
new webpack.optimize.CommonsChunkPlugin({
name: "vendormain",
filename: 'vendormain.js',
chunks: ["main", "mainedit"],
minChunks: 2
}),
new webpack.optimize.CommonsChunkPlugin({
name: "vendormainedit",
filename: 'vendormainedit.js',
chunks: ["mainedit"],
minChunks: 1
}),
],
});
const basedllconfig: webpack.Configuration = {
output: {
path: path.resolve("./output/webpack-dll/dev"),
filename: '[name].js', //file gets created as vendor.js correctly
library: '[name]_dll', //[chunkhash] - gets replaced with "chunkhash", [hash] - throws an error
},
plugins: [
new (webpack as any).DllPlugin({
path: path.join("output", "/webpack-dll/dev", "[name]-manifest.json"), //file gets created as vendor.manifest.json correctly
name: '[name]_dll'
context: "."
})
],
}"><pre class="notranslate"><code class="notranslate">var landingmodules = [
"react",
"react-dom",
"react-router",
];
var mainmodules = landingmodules.concat([
'redux',
'redux-saga',
"immutable",
]);
var maineditmodules = mainmodules.concat([
'redux-form',
"d3",
]);
const dllconfig: webpack.Configuration = mergesmart(basedllconfig, {
entry: {
landing: landingmodules,
main: mainmodules,
mainedit: maineditmodules
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: "vendor",
filename: 'vendor.js',
chunks: ["landing", "main", "mainedit"],
minChunks: 3
}),
new webpack.optimize.CommonsChunkPlugin({
name: "vendormain",
filename: 'vendormain.js',
chunks: ["main", "mainedit"],
minChunks: 2
}),
new webpack.optimize.CommonsChunkPlugin({
name: "vendormainedit",
filename: 'vendormainedit.js',
chunks: ["mainedit"],
minChunks: 1
}),
],
});
const basedllconfig: webpack.Configuration = {
output: {
path: path.resolve("./output/webpack-dll/dev"),
filename: '[name].js', //file gets created as vendor.js correctly
library: '[name]_dll', //[chunkhash] - gets replaced with "chunkhash", [hash] - throws an error
},
plugins: [
new (webpack as any).DllPlugin({
path: path.join("output", "/webpack-dll/dev", "[name]-manifest.json"), //file gets created as vendor.manifest.json correctly
name: '[name]_dll'
context: "."
})
],
}
</code></pre></div>
<p dir="auto">Looking at the generated bundles I see that the [name] was not replaced</p>
<p dir="auto">landing.js</p>
<blockquote>
<p dir="auto">var landing_dll =<br>
webpackJsonp_name__dll([1],</p>
</blockquote>
<p dir="auto">main.js</p>
<blockquote>
<p dir="auto">var main_dll =<br>
webpackJsonp_name__dll([0]</p>
</blockquote>
<p dir="auto">mainedit.js</p>
<blockquote>
<p dir="auto">var mainedit_dll =<br>
webpackJsonp_name__dll([2]</p>
</blockquote>
<p dir="auto">vendor.js</p>
<blockquote>
<p dir="auto">/<strong>/ (function(modules) { // webpackBootstrap<br>
/</strong>/ // install a JSONP callback for chunk loading<br>
/<strong>/ var parentJsonpFunction = window["webpackJsonp_name__dll"];<br>
/</strong>/ window["webpackJsonp_name__dll"] = function webpackJsonpCallback</p>
</blockquote>
<p dir="auto">vendormain.js</p>
<blockquote>
<p dir="auto">webpackJsonp_name__dll([3],</p>
</blockquote>
<p dir="auto">vendoredit.js</p>
<blockquote>
<p dir="auto">webpackJsonp_name__dll([5]</p>
</blockquote>
<p dir="auto">Looks like it could be a similar to these</p>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="45554503" data-permission-text="Title is private" data-url="https://github.com/webpack/webpack/issues/527" data-hovercard-type="issue" data-hovercard-url="/webpack/webpack/issues/527/hovercard" href="https://github.com/webpack/webpack/issues/527">#527</a><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="134515469" data-permission-text="Title is private" data-url="https://github.com/webpack/webpack/issues/2066" data-hovercard-type="issue" data-hovercard-url="/webpack/webpack/issues/2066/hovercard" href="https://github.com/webpack/webpack/issues/2066">#2066</a></p>
<p dir="auto">Tried the alternative syntax, however that didnt work either:</p>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="30845047" data-permission-text="Title is private" data-url="https://github.com/webpack/webpack/issues/221" data-hovercard-type="issue" data-hovercard-url="/webpack/webpack/issues/221/hovercard?comment_id=39642737&comment_type=issue_comment" href="https://github.com/webpack/webpack/issues/221#issuecomment-39642737">#221 (comment)</a><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="90590264" data-permission-text="Title is private" data-url="https://github.com/webpack/webpack/issues/1189" data-hovercard-type="issue" data-hovercard-url="/webpack/webpack/issues/1189/hovercard?comment_id=259919350&comment_type=issue_comment" href="https://github.com/webpack/webpack/issues/1189#issuecomment-259919350">#1189 (comment)</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" output: {
path: path.resolve("./output/webpack-dll/dev"),
filename: '[name].js',
library: ["DLL", "[name]"],
},"><pre class="notranslate"><code class="notranslate"> output: {
path: path.resolve("./output/webpack-dll/dev"),
filename: '[name].js',
library: ["DLL", "[name]"],
},
</code></pre></div>
<blockquote>
<p dir="auto">/<strong>/ (function(modules) { // webpackBootstrap<br>
/</strong>/ // install a JSONP callback for chunk loading<br>
/<strong>/ var parentJsonpFunction = window["webpackJsonpDLL__name_"];<br>
/</strong>/ window["webpackJsonpDLL__name_"]</p>
</blockquote> | 0 |
<h3 dir="auto">Version</h3>
<p dir="auto">2.5.22</p>
<h3 dir="auto">Reproduction link</h3>
<p dir="auto"><a href="https://codesandbox.io/embed/vue-template-b6c06?fontsize=14&hidenavigation=1&theme=dark" rel="nofollow">https://codesandbox.io/embed/vue-template-b6c06?fontsize=14&hidenavigation=1&theme=dark</a></p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">When the initial value of <code class="notranslate">a</code> is equal to <code class="notranslate">true</code> and <code class="notranslate">b</code> is equal to <code class="notranslate">false</code>, the child component was created twice.<br>
When the initial value of <code class="notranslate">a</code> is equal to <code class="notranslate">false</code> and <code class="notranslate">b</code> is equal to <code class="notranslate">true</code>, the child component was created once.<br>
When the initial value of <code class="notranslate">a</code> and <code class="notranslate">b</code> are same, the child component was created twice.</p>
<h3 dir="auto">What is expected?</h3>
<p dir="auto">The child component is created the same number of times in different cases</p>
<h3 dir="auto">What is actually happening?</h3>
<p dir="auto">The child component is created the different number of times in different cases</p> | <h3 dir="auto">Version</h3>
<p dir="auto">2.6.10</p>
<h3 dir="auto">Reproduction link</h3>
<p dir="auto"><a href="https://codesandbox.io/s/vue-template-wn53r" rel="nofollow">https://codesandbox.io/s/vue-template-wn53r</a></p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">Just see the code and the console info.</p>
<h3 dir="auto">What is expected?</h3>
<p dir="auto">Child component mounted once.</p>
<h3 dir="auto">What is actually happening?</h3>
<p dir="auto">Child component mounted twice.</p> | 1 |
<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/pandas-dev/pandas/blob/3a7f956c30528736beaae5784f509a76d892e229/pandas/plotting/_core.py#L2649-L2666">pandas/pandas/plotting/_core.py</a>
</p>
<p class="mb-0 color-fg-muted">
Lines 2649 to 2666
in
<a data-pjax="true" class="commit-tease-sha" href="/pandas-dev/pandas/commit/3a7f956c30528736beaae5784f509a76d892e229">3a7f956</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="L2649" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2649"></td>
<td id="LC2649" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">bar</span>(<span class="pl-s1">self</span>, <span class="pl-s1">x</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">y</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-c1">**</span><span class="pl-s1">kwds</span>): </td>
</tr>
<tr class="border-0">
<td id="L2650" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2650"></td>
<td id="LC2650" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">"""</span> </td>
</tr>
<tr class="border-0">
<td id="L2651" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2651"></td>
<td id="LC2651" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"> Vertical bar plot</span> </td>
</tr>
<tr class="border-0">
<td id="L2652" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2652"></td>
<td id="LC2652" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"></span> </td>
</tr>
<tr class="border-0">
<td id="L2653" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2653"></td>
<td id="LC2653" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"> .. versionadded:: 0.17.0</span> </td>
</tr>
<tr class="border-0">
<td id="L2654" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2654"></td>
<td id="LC2654" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"></span> </td>
</tr>
<tr class="border-0">
<td id="L2655" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2655"></td>
<td id="LC2655" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"> Parameters</span> </td>
</tr>
<tr class="border-0">
<td id="L2656" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2656"></td>
<td id="LC2656" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"> ----------</span> </td>
</tr>
<tr class="border-0">
<td id="L2657" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2657"></td>
<td id="LC2657" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"> x, y : label or position, optional</span> </td>
</tr>
<tr class="border-0">
<td id="L2658" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2658"></td>
<td id="LC2658" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"> Coordinates for each point.</span> </td>
</tr>
<tr class="border-0">
<td id="L2659" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2659"></td>
<td id="LC2659" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"> **kwds : optional</span> </td>
</tr>
<tr class="border-0">
<td id="L2660" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2660"></td>
<td id="LC2660" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"> Keyword arguments to pass on to :py:meth:`pandas.DataFrame.plot`.</span> </td>
</tr>
<tr class="border-0">
<td id="L2661" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2661"></td>
<td id="LC2661" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"></span> </td>
</tr>
<tr class="border-0">
<td id="L2662" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2662"></td>
<td id="LC2662" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"> Returns</span> </td>
</tr>
<tr class="border-0">
<td id="L2663" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2663"></td>
<td id="LC2663" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"> -------</span> </td>
</tr>
<tr class="border-0">
<td id="L2664" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2664"></td>
<td id="LC2664" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"> axes : matplotlib.AxesSubplot or np.array of them</span> </td>
</tr>
<tr class="border-0">
<td id="L2665" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2665"></td>
<td id="LC2665" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"> """</span> </td>
</tr>
<tr class="border-0">
<td id="L2666" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2666"></td>
<td id="LC2666" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-en">self</span>(<span class="pl-s1">kind</span><span class="pl-c1">=</span><span class="pl-s">'bar'</span>, <span class="pl-s1">x</span><span class="pl-c1">=</span><span class="pl-s1">x</span>, <span class="pl-s1">y</span><span class="pl-c1">=</span><span class="pl-s1">y</span>, <span class="pl-c1">**</span><span class="pl-s1">kwds</span>) </td>
</tr>
</tbody></table>
</div>
</div>
<p></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd
import numpy as np
import matplotlib
get_ipython().magic(u'pylab inline')
# In[17]:
df = pd.DataFrame({'id': range(1,11), 'normcolor': np.random.rand(10), 'count': np.random.randint(0,100,(10))})
# In[21]:
colors = matplotlib.cm.hsv(df['normcolor'])
df.plot.bar('id','count', color=colors) # return plot with not color variation
# In[22]:
plt.bar(df['id'], df['count'], color=colors) # returns plot as expected"><pre class="notranslate"><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">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>
<span class="pl-en">get_ipython</span>().<span class="pl-en">magic</span>(<span class="pl-s">u'pylab inline'</span>)
<span class="pl-c"># In[17]:</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">'id'</span>: <span class="pl-en">range</span>(<span class="pl-c1">1</span>,<span class="pl-c1">11</span>), <span class="pl-s">'normcolor'</span>: <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">rand</span>(<span class="pl-c1">10</span>), <span class="pl-s">'count'</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">100</span>,(<span class="pl-c1">10</span>))})
<span class="pl-c"># In[21]:</span>
<span class="pl-s1">colors</span> <span class="pl-c1">=</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">cm</span>.<span class="pl-en">hsv</span>(<span class="pl-s1">df</span>[<span class="pl-s">'normcolor'</span>])
<span class="pl-s1">df</span>.<span class="pl-s1">plot</span>.<span class="pl-en">bar</span>(<span class="pl-s">'id'</span>,<span class="pl-s">'count'</span>, <span class="pl-s1">color</span><span class="pl-c1">=</span><span class="pl-s1">colors</span>) <span class="pl-c"># return plot with not color variation</span>
<span class="pl-c"># In[22]:</span>
<span class="pl-s1">plt</span>.<span class="pl-en">bar</span>(<span class="pl-s1">df</span>[<span class="pl-s">'id'</span>], <span class="pl-s1">df</span>[<span class="pl-s">'count'</span>], <span class="pl-s1">color</span><span class="pl-c1">=</span><span class="pl-s1">colors</span>) <span class="pl-c"># returns plot as expected</span></pre></div>
<h1 dir="auto">Current Output</h1>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6607313/29251984-dabee23e-807c-11e7-80a3-bd3d57cfefba.png"><img src="https://user-images.githubusercontent.com/6607313/29251984-dabee23e-807c-11e7-80a3-bd3d57cfefba.png" alt="image" style="max-width: 100%;"></a></p>
<h1 dir="auto">Correct Output</h1>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6607313/29251985-e421e4e8-807c-11e7-9fb0-f68da61a8089.png"><img src="https://user-images.githubusercontent.com/6607313/29251985-e421e4e8-807c-11e7-9fb0-f68da61a8089.png" alt="image" style="max-width: 100%;"></a></p> | <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=">>> df = pd.DataFrame({"A": range(4), "color": ['red', 'blue', 'blue', 'red']})
>>> ax = df.plot.bar(y='A', color=df['color'])
>>> [p.get_facecolor() for p in ax.patches]
[(1.0, 0.0, 0.0, 1.0),
(1.0, 0.0, 0.0, 1.0),
(1.0, 0.0, 0.0, 1.0),
(1.0, 0.0, 0.0, 1.0)]"><pre class="notranslate"><span class="pl-c1">>></span><span class="pl-c1">></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">"A"</span>: <span class="pl-en">range</span>(<span class="pl-c1">4</span>), <span class="pl-s">"color"</span>: [<span class="pl-s">'red'</span>, <span class="pl-s">'blue'</span>, <span class="pl-s">'blue'</span>, <span class="pl-s">'red'</span>]})
<span class="pl-c1">>></span><span class="pl-c1">></span> <span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-s1">plot</span>.<span class="pl-en">bar</span>(<span class="pl-s1">y</span><span class="pl-c1">=</span><span class="pl-s">'A'</span>, <span class="pl-s1">color</span><span class="pl-c1">=</span><span class="pl-s1">df</span>[<span class="pl-s">'color'</span>])
<span class="pl-c1">>></span><span class="pl-c1">></span> [<span class="pl-s1">p</span>.<span class="pl-en">get_facecolor</span>() <span class="pl-k">for</span> <span class="pl-s1">p</span> <span class="pl-c1">in</span> <span class="pl-s1">ax</span>.<span class="pl-s1">patches</span>]
[(<span class="pl-c1">1.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">1.0</span>),
(<span class="pl-c1">1.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">1.0</span>),
(<span class="pl-c1">1.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">1.0</span>),
(<span class="pl-c1">1.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">1.0</span>)]</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">It plots correctly but it does not pick the right color per bar. it only pick the color of the first value in the list.<br>
it was working perfectly in pandas 0.19.2</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">the plot should contain a different color as the list is being passed. Similar to matplotlib behavior and the old pandas version</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<p dir="auto">pandas: 0.20.2<br>
pytest: None<br>
pip: 9.0.1<br>
setuptools: 36.0.1<br>
Cython: None<br>
numpy: 1.12.1<br>
scipy: 0.19.1<br>
xarray: None<br>
IPython: 5.4.1<br>
sphinx: None<br>
patsy: None<br>
dateutil: 2.6.0<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: None<br>
feather: None<br>
matplotlib: 2.0.2<br>
openpyxl: None<br>
xlrd: 1.0.0<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: None<br>
html5lib: 0.9999999<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: 2.7.1 (dt dec pq3 ext lo64)<br>
jinja2: 2.9.6<br>
s3fs: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details> | 1 |
<h1 dir="auto">Bug report</h1>
<p dir="auto">Webpack v4.12 is not respecting setting the mode via config file.</p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">If I set the mode with module.exports in the webpack.config.js, I receive the configuration warning that the mode is not set.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">If I make a <code class="notranslate">webpack.config.js</code> in the root with this configuration:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="module.exports = {
mode: 'none'
};"><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">mode</span>: <span class="pl-s">'none'</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">And I run <code class="notranslate">npm run webpack</code> via the webpack in scripts in my package.json:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" "scripts": {
"webpack": "webpack",
}"><pre class="notranslate"> <span class="pl-s">"scripts"</span>: <span class="pl-kos">{</span>
<span class="pl-s">"webpack"</span>: <span class="pl-s">"webpack"</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">But I receive the configuration warning that the mode is not set.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="configuration
0:0 warning The 'mode' option has not been set, webpack will fallback to
'production' for this value. Set 'mode' option to 'development' or
'production' to enable defaults for each environment."><pre class="notranslate"><code class="notranslate">configuration
0:0 warning The 'mode' option has not been set, webpack will fallback to
'production' for this value. Set 'mode' option to 'development' or
'production' to enable defaults for each environment.
</code></pre></div>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">Same exact config sets the mode just fine in v4.8 with no configuration warning.... but not in v4.12. The webpack documentation does not outline any sort of changes with this process <a href="https://webpack.js.org/concepts/mode/#mode-none" rel="nofollow">https://webpack.js.org/concepts/mode/#mode-none</a> -- so I'm guessing this is a bug.</p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version: v4.12<br>
Node.js version: v9.9<br>
Operating System: macOS<br>
Additional tools: VS Code</p> | <p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p>
<p dir="auto">Report a bug</p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">When i load the files from <code class="notranslate">scss</code> in webpack.dev the filepath is good:</p>
<p dir="auto"><code class="notranslate">background: url('../imgs/photo.jpg');</code></p>
<p dir="auto">But after build filepath is:</p>
<p dir="auto"><code class="notranslate">background: url('assets/imgs/photo.jpg');</code></p>
<p dir="auto">I don't know why it changes <code class="notranslate">../</code> with <code class="notranslate">assets</code>.</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">after <code class="notranslate">npm run build</code> the url image from <code class="notranslate">css</code> should be same as in <code class="notranslate">scss </code>file</p>
<p dir="auto"><strong>If this is a feature request, what is motivation or use case for changing the behavior?</strong></p>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.</strong></p>
<p dir="auto">Node.js version: <code class="notranslate">v10.16.0</code>,<br>
Webpack version: <code class="notranslate">4.36.1</code>,<br>
OS: <code class="notranslate">Windows 10</code></p>
<p dir="auto">Main Config:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63080802-b663f500-bf4a-11e9-8296-a33795b07636.png"><img src="https://user-images.githubusercontent.com/37197922/63080802-b663f500-bf4a-11e9-8296-a33795b07636.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Development Config:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63080836-cda2e280-bf4a-11e9-8cee-bde7be93bbac.png"><img src="https://user-images.githubusercontent.com/37197922/63080836-cda2e280-bf4a-11e9-8cee-bde7be93bbac.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Build / Production Config:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63080858-d98ea480-bf4a-11e9-8321-6ed43de79d97.png"><img src="https://user-images.githubusercontent.com/37197922/63080858-d98ea480-bf4a-11e9-8321-6ed43de79d97.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">And this is my folder structure for development files:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63080880-e27f7600-bf4a-11e9-9c93-e75ef0ea9c1d.png"><img src="https://user-images.githubusercontent.com/37197922/63080880-e27f7600-bf4a-11e9-9c93-e75ef0ea9c1d.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">And end build files:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63080904-ef03ce80-bf4a-11e9-8296-c63cca0a599f.png"><img src="https://user-images.githubusercontent.com/37197922/63080904-ef03ce80-bf4a-11e9-8296-c63cca0a599f.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">As you can see from style.scss, the filepath: <code class="notranslate">../imgs/photo,jpg works perfectly</code>.<br>
But from the dist folder it changes to <code class="notranslate">assets/imgs/photo.jpg</code>.</p>
<p dir="auto">And after i tried with <code class="notranslate">resolve-url-loader</code> it gives me this error after build:</p>
<p dir="auto">config with <code class="notranslate">resolve-url-loader</code>:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63081295-f081c680-bf4b-11e9-869e-60f0616d798c.png"><img src="https://user-images.githubusercontent.com/37197922/63081295-f081c680-bf4b-11e9-869e-60f0616d798c.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63081242-ce884400-bf4b-11e9-8702-ce858cabddd7.png"><img src="https://user-images.githubusercontent.com/37197922/63081242-ce884400-bf4b-11e9-8702-ce858cabddd7.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63081262-d8aa4280-bf4b-11e9-964b-048a57e111e3.png"><img src="https://user-images.githubusercontent.com/37197922/63081262-d8aa4280-bf4b-11e9-964b-048a57e111e3.png" alt="image" style="max-width: 100%;"></a></p> | 0 |
<p dir="auto"><em>Please make sure that this is a bug. As per our <a href="https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md">GitHub Policy</a>, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template</em></p>
<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>Have I written custom code (as opposed to using a stock example script provided in TensorFlow): yes</li>
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS 10.14.5</li>
<li>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:</li>
<li>TensorFlow installed from (source or binary): binary</li>
<li>TensorFlow version (use command below): 2.0.0-beta1</li>
<li>Python version: 3.6</li>
<li>Bazel version (if compiling from source):</li>
<li>GCC/Compiler version (if compiling from source):</li>
<li>CUDA/cuDNN version:</li>
<li>GPU model and memory:</li>
</ul>
<p dir="auto"><strong>Describe the current behavior</strong><br>
Using <code class="notranslate">tf.function</code> when enumerating a dataset will cause an infinite loop.</p>
<p dir="auto"><strong>Describe the expected behavior</strong><br>
Using <code class="notranslate">tf.function</code> when enumerating a dataset should not change the looping behavior.</p>
<p dir="auto"><strong>Code to reproduce the issue</strong><br>
The code snippet below will hang after the last function call. I'm not printing anything because calling <code class="notranslate">tf.print</code> results in a syntax error on colab and I know that these snippets are being run on colab by you. When printing the variable <code class="notranslate">i</code>, it's clear that the loop just never stops, i.e. <code class="notranslate">i</code> increase indefinitely.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import tensorflow as tf
ds = tf.data.Dataset.from_tensor_slices([1,2,3,4])
def test_loop_without_enumerate_without_decorator(ds):
for val in ds:
pass
@tf.function
def test_loop_without_enumerate_with_decorator(ds):
for val in ds:
pass
def test_loop_with_enumerate_without_decorator(ds):
for i, val in enumerate(ds):
pass
@tf.function
def test_loop_with_enumerate_with_decorator(ds):
for i, val in enumerate(ds):
pass
print("Without tf.function and without enumerate")
test_loop_without_enumerate_without_decorator(ds)
print("Without tf.function and with enumerate")
test_loop_with_enumerate_without_decorator(ds)
print("With tf.function and without enumerate")
test_loop_without_enumerate_with_decorator(ds)
print("With tf.function and with enumerate")
test_loop_with_enumerate_with_decorator(ds)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">tensorflow</span> <span class="pl-k">as</span> <span class="pl-s1">tf</span>
<span class="pl-s1">ds</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">data</span>.<span class="pl-v">Dataset</span>.<span class="pl-en">from_tensor_slices</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-k">def</span> <span class="pl-en">test_loop_without_enumerate_without_decorator</span>(<span class="pl-s1">ds</span>):
<span class="pl-k">for</span> <span class="pl-s1">val</span> <span class="pl-c1">in</span> <span class="pl-s1">ds</span>:
<span class="pl-k">pass</span>
<span class="pl-en">@<span class="pl-s1">tf</span>.<span class="pl-s1">function</span></span>
<span class="pl-k">def</span> <span class="pl-en">test_loop_without_enumerate_with_decorator</span>(<span class="pl-s1">ds</span>):
<span class="pl-k">for</span> <span class="pl-s1">val</span> <span class="pl-c1">in</span> <span class="pl-s1">ds</span>:
<span class="pl-k">pass</span>
<span class="pl-k">def</span> <span class="pl-en">test_loop_with_enumerate_without_decorator</span>(<span class="pl-s1">ds</span>):
<span class="pl-k">for</span> <span class="pl-s1">i</span>, <span class="pl-s1">val</span> <span class="pl-c1">in</span> <span class="pl-en">enumerate</span>(<span class="pl-s1">ds</span>):
<span class="pl-k">pass</span>
<span class="pl-en">@<span class="pl-s1">tf</span>.<span class="pl-s1">function</span></span>
<span class="pl-k">def</span> <span class="pl-en">test_loop_with_enumerate_with_decorator</span>(<span class="pl-s1">ds</span>):
<span class="pl-k">for</span> <span class="pl-s1">i</span>, <span class="pl-s1">val</span> <span class="pl-c1">in</span> <span class="pl-en">enumerate</span>(<span class="pl-s1">ds</span>):
<span class="pl-k">pass</span>
<span class="pl-en">print</span>(<span class="pl-s">"Without tf.function and without enumerate"</span>)
<span class="pl-en">test_loop_without_enumerate_without_decorator</span>(<span class="pl-s1">ds</span>)
<span class="pl-en">print</span>(<span class="pl-s">"Without tf.function and with enumerate"</span>)
<span class="pl-en">test_loop_with_enumerate_without_decorator</span>(<span class="pl-s1">ds</span>)
<span class="pl-en">print</span>(<span class="pl-s">"With tf.function and without enumerate"</span>)
<span class="pl-en">test_loop_without_enumerate_with_decorator</span>(<span class="pl-s1">ds</span>)
<span class="pl-en">print</span>(<span class="pl-s">"With tf.function and with enumerate"</span>)
<span class="pl-en">test_loop_with_enumerate_with_decorator</span>(<span class="pl-s1">ds</span>)</pre></div>
<p dir="auto"><strong>Other info / logs</strong><br>
Output of the above snippet:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Without tf.function and without enumerate
Without tf.function and with enumerate
With tf.function and without enumerate
With tf.function and with enumerate
**HANGS HERE**"><pre class="notranslate"><code class="notranslate">Without tf.function and without enumerate
Without tf.function and with enumerate
With tf.function and without enumerate
With tf.function and with enumerate
**HANGS HERE**
</code></pre></div> | <h3 dir="auto">Description</h3>
<p dir="auto">I'm trying to understand how TF generates batches from <code class="notranslate">TFRecord</code> file format, how to implement the basic idea of evaluate the whole validation dataset after a full epoch so I've done a small experiment.</p>
<p dir="auto">Basically I've added an <code class="notranslate">image/id</code> key in the <code class="notranslate">TFRecord</code> file that looks like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="'image/id': tf.FixedLenFeature(shape=[], dtype=tf.int64)
'id': slim.tfexample_decoder.Tensor('image/id')"><pre class="notranslate"><code class="notranslate">'image/id': tf.FixedLenFeature(shape=[], dtype=tf.int64)
'id': slim.tfexample_decoder.Tensor('image/id')
</code></pre></div>
<p dir="auto">The values of these ids are just numbers increasing from 0 to <code class="notranslate">num_samples - 1</code>. Then I'm reading the data like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="...
data_provider = slim.dataset_data_provider.DatasetDataProvider(dataset=dataset, shuffle=False)
raw_image, instance_id, label = data_provider.get(items=['image', 'id', 'label'])
...
num_threads = 1
images, instance_ids, labels = tf.train.batch(tensors=[image, instance_id, label],
batch_size=batch_size,
num_threads=num_threads,
capacity = batch_size,
allow_smaller_final_batch=False)
..."><pre class="notranslate"><code class="notranslate">...
data_provider = slim.dataset_data_provider.DatasetDataProvider(dataset=dataset, shuffle=False)
raw_image, instance_id, label = data_provider.get(items=['image', 'id', 'label'])
...
num_threads = 1
images, instance_ids, labels = tf.train.batch(tensors=[image, instance_id, label],
batch_size=batch_size,
num_threads=num_threads,
capacity = batch_size,
allow_smaller_final_batch=False)
...
</code></pre></div>
<p dir="auto">I've used <code class="notranslate">shuffle=False</code>, <code class="notranslate">num_threads=1</code> and <code class="notranslate">capacity=batch_size</code> to ensure we are reading the instances in the validation set in order.</p>
<p dir="auto">I've then defined a <code class="notranslate">train_step_fn</code> that evaluates a mini-batch from the validation set after each step. I'm doing this to check and test we are not returning instances with duplicate ids in the same batch. The code looks like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" def train_step_fn(session, *args, **kwargs):
total_loss, should_stop = train_step(session, *args, **kwargs)
curr_global_step = tf.train.global_step(session, global_step)
curr_epoch = curr_global_step / validation_every_n_steps
image, val_ids, val_loss, accuracy = session.run([validation_images, validation_ids, total_validation_loss, validation_accuracy])
print(val_ids)
def float_formatter(x): return "%.4f" % x
tf.logging.info('after global step {} (epoch {}): validation loss = {}, validation accuracy = {}'
.format(curr_global_step, curr_epoch, float_formatter(val_loss), float_formatter(accuracy)))
return [total_loss, should_stop]"><pre class="notranslate"><code class="notranslate"> def train_step_fn(session, *args, **kwargs):
total_loss, should_stop = train_step(session, *args, **kwargs)
curr_global_step = tf.train.global_step(session, global_step)
curr_epoch = curr_global_step / validation_every_n_steps
image, val_ids, val_loss, accuracy = session.run([validation_images, validation_ids, total_validation_loss, validation_accuracy])
print(val_ids)
def float_formatter(x): return "%.4f" % x
tf.logging.info('after global step {} (epoch {}): validation loss = {}, validation accuracy = {}'
.format(curr_global_step, curr_epoch, float_formatter(val_loss), float_formatter(accuracy)))
return [total_loss, should_stop]
</code></pre></div>
<p dir="auto">Most of the output I'm seeing makes sense but the output from the first batch looks weird.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="INFO:tensorflow:Starting Session.
INFO:tensorflow:Starting Queues.
INFO:tensorflow:global_step/sec: 0
INFO:tensorflow:global step 1: loss = 4.1099 (3.70 sec/step)
[17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32]
INFO:tensorflow:after global step 1 (epoch 0): validation loss = 4.6337, validation accuracy = 0.0000
INFO:tensorflow:global step 2: loss = 4.2118 (0.52 sec/step)
[33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48]
INFO:tensorflow:after global step 2 (epoch 0): validation loss = 3.9538, validation accuracy = 0.0625
INFO:tensorflow:global step 3: loss = 4.0593 (0.75 sec/step)
[49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64]
INFO:tensorflow:after global step 3 (epoch 0): validation loss = 4.0773, validation accuracy = 0.0000
INFO:tensorflow:global step 4: loss = 3.7749 (0.64 sec/step)
[65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80]
INFO:tensorflow:after global step 4 (epoch 0): validation loss = 4.0847, validation accuracy = 0.0625
INFO:tensorflow:global step 5: loss = 3.7973 (0.68 sec/step)
[81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96]
INFO:tensorflow:after global step 5 (epoch 0): validation loss = 3.5591, validation accuracy = 0.1875
INFO:tensorflow:global step 6: loss = 3.5584 (0.72 sec/step)
[ 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112]
INFO:tensorflow:after global step 6 (epoch 0): validation loss = 3.6849, validation accuracy = 0.1250
INFO:tensorflow:global step 7: loss = 3.5303 (0.70 sec/step)
[113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128]
INFO:tensorflow:after global step 7 (epoch 0): validation loss = 3.7812, validation accuracy = 0.1875
INFO:tensorflow:global step 8: loss = 3.2698 (0.85 sec/step)
[129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144]
INFO:tensorflow:after global step 8 (epoch 0): validation loss = 3.3004, validation accuracy = 0.1875
INFO:tensorflow:global step 9: loss = 3.4842 (0.94 sec/step)
INFO:tensorflow:global_step/sec: 0.915008
[145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160]
INFO:tensorflow:after global step 9 (epoch 0): validation loss = 4.0377, validation accuracy = 0.1875
INFO:tensorflow:global step 10: loss = 3.5635 (1.48 sec/step)
[178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193]
INFO:tensorflow:after global step 10 (epoch 0): validation loss = 3.7854, validation accuracy = 0.1875
INFO:tensorflow:global step 11: loss = 3.1773 (0.65 sec/step)
[194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209]"><pre class="notranslate"><code class="notranslate">INFO:tensorflow:Starting Session.
INFO:tensorflow:Starting Queues.
INFO:tensorflow:global_step/sec: 0
INFO:tensorflow:global step 1: loss = 4.1099 (3.70 sec/step)
[17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32]
INFO:tensorflow:after global step 1 (epoch 0): validation loss = 4.6337, validation accuracy = 0.0000
INFO:tensorflow:global step 2: loss = 4.2118 (0.52 sec/step)
[33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48]
INFO:tensorflow:after global step 2 (epoch 0): validation loss = 3.9538, validation accuracy = 0.0625
INFO:tensorflow:global step 3: loss = 4.0593 (0.75 sec/step)
[49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64]
INFO:tensorflow:after global step 3 (epoch 0): validation loss = 4.0773, validation accuracy = 0.0000
INFO:tensorflow:global step 4: loss = 3.7749 (0.64 sec/step)
[65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80]
INFO:tensorflow:after global step 4 (epoch 0): validation loss = 4.0847, validation accuracy = 0.0625
INFO:tensorflow:global step 5: loss = 3.7973 (0.68 sec/step)
[81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96]
INFO:tensorflow:after global step 5 (epoch 0): validation loss = 3.5591, validation accuracy = 0.1875
INFO:tensorflow:global step 6: loss = 3.5584 (0.72 sec/step)
[ 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112]
INFO:tensorflow:after global step 6 (epoch 0): validation loss = 3.6849, validation accuracy = 0.1250
INFO:tensorflow:global step 7: loss = 3.5303 (0.70 sec/step)
[113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128]
INFO:tensorflow:after global step 7 (epoch 0): validation loss = 3.7812, validation accuracy = 0.1875
INFO:tensorflow:global step 8: loss = 3.2698 (0.85 sec/step)
[129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144]
INFO:tensorflow:after global step 8 (epoch 0): validation loss = 3.3004, validation accuracy = 0.1875
INFO:tensorflow:global step 9: loss = 3.4842 (0.94 sec/step)
INFO:tensorflow:global_step/sec: 0.915008
[145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160]
INFO:tensorflow:after global step 9 (epoch 0): validation loss = 4.0377, validation accuracy = 0.1875
INFO:tensorflow:global step 10: loss = 3.5635 (1.48 sec/step)
[178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193]
INFO:tensorflow:after global step 10 (epoch 0): validation loss = 3.7854, validation accuracy = 0.1875
INFO:tensorflow:global step 11: loss = 3.1773 (0.65 sec/step)
[194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209]
</code></pre></div>
<p dir="auto">I'm assuming the first mini-batch returned should be <code class="notranslate">[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]</code> instead of <code class="notranslate">[17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32]</code>. Plus the fact that we are starting from 17 instead of 16 also bothers me a bit. It seems for some unknown reason TF is dropping a batch.</p>
<p dir="auto">I understand this probably won't affect the model training / validation process at all but I'm still pointing this out in case this is hiding a more serious root cause.</p> | 0 |
<p dir="auto"><strong>Migrated issue, originally created by jek (<a href="https://github.com/jek">@jek</a>)</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[08:31](08:31) <Crys_> SA emits "like 'str%'" for startswith. However FB doesn't use an index for LIKE 'str%'
[08:32](08:32) <Crys_> I'd like to replace the op with Firebird's "STARTING WITH" statement."><pre class="notranslate"><code class="notranslate">[08:31](08:31) <Crys_> SA emits "like 'str%'" for startswith. However FB doesn't use an index for LIKE 'str%'
[08:32](08:32) <Crys_> I'd like to replace the op with Firebird's "STARTING WITH" statement.
</code></pre></div> | <p dir="auto"><strong>Migrated issue, originally created by Michael Bayer (<a href="https://github.com/zzzeek">@zzzeek</a>)</strong></p> | 1 |
<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">(original reporter: ged) As you know, I've been playing with a C extension lately. I am at the point where I have translated all the RowProxy methods which benefit from more speed, and all common result processors (the result is quite encouraging btw). I have also reviewed the result processors for "common" types in all dialects and noticed there is quite a bit of duplication.</p>
<p dir="auto">The code seem to be either copy-pasted from other dialects or worse: recoded slightly differently to do (apparently) the same work. The most glaring example is the Boolean type: AFAICT, every dialect except PostgreSQL redefine it, but they have all the same intent: convert a boolean to an int and back. For this particular case, I think it would make sense to move that code to types.py.</p>
<p dir="auto">Even in more "complex" types, such as Numeric, the processors seem to return one of a few predefined conversion functions: decimal_to_float or float_to_decimal. I think it would be a good idea to make an explicit module with a collection of those "most often used conversion functions". This would have several advantages:</p>
<ul dir="auto">
<li>less code duplication</li>
<li>avoiding subtle implementation differences when the requirements of the DBAPI are the same. This is especially True for bind_processors, which sometimes accept different types on different dialects, usually without a good reason to do so (AFAICT).</li>
<li>less code to write for dialect implementors</li>
<li>I would only have to try ... except for the C processor in one place, and not in all dialects.</li>
<li>it would make it more obvious when one dialect doesn't use one of those common functions that it does something special.</li>
</ul>
<p dir="auto">For example, the _PGNumeric result_processor would look like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" def result_processor(self, dialect, coltype):
if self.asdecimal:
if coltype in (700, 701):
return processors.float_to_decimal
elif coltype == 1700:
# pg8000 returns Decimal natively for 1700
return None
else:
raise exc.InvalidRequestError("Unknown PG numeric type: %d" % coltype)
else:
if coltype in (700, 701):
# pg8000 returns float natively for 701
return None
elif coltype == 1700:
return processors.decimal_to_float
else:
raise exc.InvalidRequestError("Unknown PG numeric type: %d" % coltype)"><pre class="notranslate"><code class="notranslate"> def result_processor(self, dialect, coltype):
if self.asdecimal:
if coltype in (700, 701):
return processors.float_to_decimal
elif coltype == 1700:
# pg8000 returns Decimal natively for 1700
return None
else:
raise exc.InvalidRequestError("Unknown PG numeric type: %d" % coltype)
else:
if coltype in (700, 701):
# pg8000 returns float natively for 701
return None
elif coltype == 1700:
return processors.decimal_to_float
else:
raise exc.InvalidRequestError("Unknown PG numeric type: %d" % coltype)
</code></pre></div>
<p dir="auto">I should also note that some processors (such as String and Decimal -- for the Decimal lookup) require local storage. Those usually correspond to Python closures in the current code. That does not translate well into C. Defining factories for those would be the solution:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def string_to_unicode_result_processor_factory(encoding):
decoder = codecs.getdecoder(encoding)
def process(value):
if value is not None:
# decoder returns a tuple: (value, len)
return decoder(value)[0](0)
else:
return value"><pre class="notranslate"><code class="notranslate">def string_to_unicode_result_processor_factory(encoding):
decoder = codecs.getdecoder(encoding)
def process(value):
if value is not None:
# decoder returns a tuple: (value, len)
return decoder(value)[0](0)
else:
return value
</code></pre></div>
<p dir="auto">which can then use the C processor (or in fact, the C class in this case):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="try:
from demo import UnicodeResultProcessor
def string_to_unicode_result_processor_factory(encoding):
result_processor = UnicodeResultProcessor(encoding)
return result_processor.process
except ImportError:
... (same as above)"><pre class="notranslate"><code class="notranslate">try:
from demo import UnicodeResultProcessor
def string_to_unicode_result_processor_factory(encoding):
result_processor = UnicodeResultProcessor(encoding)
return result_processor.process
except ImportError:
... (same as above)
</code></pre></div>
<p dir="auto">What do you think? I'm willing to do all the changes myself, I just need an official blessing from you. If you agree with the general idea, does "processors" as the module name also suit you?</p> | <p dir="auto"><strong>Migrated issue, originally created by Michael Bayer (<a href="https://github.com/zzzeek">@zzzeek</a>)</strong></p>
<p dir="auto">to make it easier to support joined-table inheritance with no explcit discriminator, as well as any functional situation:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sqlalchemy.orm import joined_discriminator
mapper(Cls, table,
select_table=table.outerjoin(subtable1).outerjoin(subtable2), polymorphic_on=joined_discriminator, ...)"><pre class="notranslate"><code class="notranslate">from sqlalchemy.orm import joined_discriminator
mapper(Cls, table,
select_table=table.outerjoin(subtable1).outerjoin(subtable2), polymorphic_on=joined_discriminator, ...)
</code></pre></div>
<p dir="auto">polymorphic_on accepts a callable. at result time, it gets called:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if callable(self.polymorphic_on):
discriminator = self.polymorphic_on(self, row)
...etc ..."><pre class="notranslate"><code class="notranslate">if callable(self.polymorphic_on):
discriminator = self.polymorphic_on(self, row)
...etc ...
</code></pre></div>
<p dir="auto">we can skip the "callable" check by just making a string-based polymorphic_on into a callable of its own.</p>
<p dir="auto">joined_discriminator then works like this (will have to optimize this):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def joined_discrminator(mapper, row):
for key, submapper in mapper.polymorphic_map.iteritems():
if row[submapper.local_table.primary_keys[0](submapper.local_table.primary_keys[0)]:
return key
return mapper.polymorphic_identity"><pre class="notranslate"><code class="notranslate">def joined_discrminator(mapper, row):
for key, submapper in mapper.polymorphic_map.iteritems():
if row[submapper.local_table.primary_keys[0](submapper.local_table.primary_keys[0)]:
return key
return mapper.polymorphic_identity
</code></pre></div>
<p dir="auto">i.e. it looks at all the joined tables and returns the discriminator for the one thats present in the row. primary_keys<a href="0">0</a> might not be possible depending on how the outerjoin is set up (also the base table pk wont get confused for the sub-table pk ?)</p> | 0 |
<p dir="auto">Hello everybody.<br>
I must be crazy to keep on trying to run cutting-edge open-source software on my old (but quite stable...) XP laptop !</p>
<p dir="auto">Version : julia-0.3.0-prerelease-8f1fbec-win32<br>
"C:\Julia 0.3.0-prerelease\bin>julia" just crashes without a sigh ...</p>
<p dir="auto">Here is the console outputs in test mode :<br>
C:\Julia 0.3.0-prerelease\bin>test-julia.bat<br>
fatal error during bootstrap:<br>
(arg-error "table: arguments must come in pairs")<br>
fatal error loading system image</p>
<p dir="auto">You are doing a really great work !<br>
Best regards, Stan.</p> | <p dir="auto"><code class="notranslate">@Distributed.everywhere</code> fails if you <code class="notranslate">import Distributed</code></p>
<p dir="auto">it works only if <code class="notranslate">using Distributed</code></p> | 0 |
<p dir="auto">Similar to react-router's <code class="notranslate">Link</code>, it would be nice to be able to customize CSS when a link is active, e.g with an <code class="notranslate">activeClassName</code> property.</p> | <p dir="auto">Im trying to integrate elastic APM (<a href="https://www.elastic.co/solutions/apm" rel="nofollow">https://www.elastic.co/solutions/apm</a>).<br>
When I import elastic-apm-node (<a href="https://github.com/elastic/apm-agent-nodejs">https://github.com/elastic/apm-agent-nodejs</a>) package inside my pages/index.js it throws following error.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="These dependencies were not found:
* async_hooks in ./node_modules/elastic-apm-node/lib/instrumentation/async-hooks.js
* child_process in ./node_modules/elastic-apm-node/lib/instrumentation/patch-async.js
* dns in ./node_modules/elastic-apm-node/lib/instrumentation/patch-async.js
* module in ./node_modules/require-in-the-middle/index.js
* net in ./node_modules/elastic-apm-node/lib/instrumentation/patch-async.js"><pre class="notranslate"><code class="notranslate">These dependencies were not found:
* async_hooks in ./node_modules/elastic-apm-node/lib/instrumentation/async-hooks.js
* child_process in ./node_modules/elastic-apm-node/lib/instrumentation/patch-async.js
* dns in ./node_modules/elastic-apm-node/lib/instrumentation/patch-async.js
* module in ./node_modules/require-in-the-middle/index.js
* net in ./node_modules/elastic-apm-node/lib/instrumentation/patch-async.js
</code></pre></div>
<p dir="auto">When I import elastic-apm-js-base (<a href="https://github.com/elastic/apm-agent-js-base">https://github.com/elastic/apm-agent-js-base</a>) It works but it tracks only on the browser and doesn't track anything running on serverside.</p>
<p dir="auto">Example Code : <a href="https://github.com/sagartalla/elastic-apm-nextjs">https://github.com/sagartalla/elastic-apm-nextjs</a></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?q=is%3Aissue">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<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>6.0.1</td>
</tr>
<tr>
<td>node</td>
<td>10.1.0</td>
</tr>
</tbody>
</table> | 0 |
<p dir="auto">I am using <a href="http://bepo.fr/wiki/Accueil" rel="nofollow">BÉPO keyboard layout</a> and I am not able to produce a <em>""</em> in the <em>atom-text-editor</em>. However it works fine in <em>setting menu</em> and in the <em>command prompt</em> (ctrl+shift+p menu), and everything word fine if I switch to a QWERTY or AZERTY layout.</p>
<p dir="auto"><em>Repro case:</em> With standard windows BÉPO driver, inside a text editor tab, press AltGr+à (which is AtlGr+w in QWERTY, or to be precise 0xE011+0x1A from a scan code point of view) and observe it does not produce a backslash.</p>
<p dir="auto">It may be similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28529842" data-permission-text="Title is private" data-url="https://github.com/atom/atom/issues/1625" data-hovercard-type="issue" data-hovercard-url="/atom/atom/issues/1625/hovercard" href="https://github.com/atom/atom/issues/1625">#1625</a></p> | <p dir="auto">Original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28529842" data-permission-text="Title is private" data-url="https://github.com/atom/atom/issues/1625" data-hovercard-type="issue" data-hovercard-url="/atom/atom/issues/1625/hovercard" href="https://github.com/atom/atom/issues/1625">atom/atom#1625</a></p>
<hr>
<p dir="auto">Use <a href="https://atom.io/packages/keyboard-localization" rel="nofollow">https://atom.io/packages/keyboard-localization</a> until this issue gets fixed (should be in the Blink upstream).</p> | 1 |
<p dir="auto">When trying to use evaluateAll or dispatchEvent in a specific web page, an TypeError: extraEngines is not iterable error is throw</p>
<p dir="auto">Seems to be the same bug as <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1440014352" data-permission-text="Title is private" data-url="https://github.com/microsoft/playwright/issues/18641" data-hovercard-type="issue" data-hovercard-url="/microsoft/playwright/issues/18641/hovercard" href="https://github.com/microsoft/playwright/issues/18641">#18641</a> that was closed due to lack of public reproduction. This can be reproduced in public (see below)</p>
<p dir="auto">Its similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1718486575" data-permission-text="Title is private" data-url="https://github.com/microsoft/playwright/issues/23192" data-hovercard-type="issue" data-hovercard-url="/microsoft/playwright/issues/23192/hovercard" href="https://github.com/microsoft/playwright/issues/23192">#23192</a> in the same web page / app but unlike the other bug this occurs using the library also, not only the codegen</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.33]</li>
<li>Operating System: [Windows 10]</li>
<li>Browser: [Chromium]</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<p dir="auto">-[x] I provided exact source code that allows reproducing the issue locally.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { chromium, Page } from 'playwright'
async function testSAWTypeError() {
const browser = await chromium.launch({ headless: false })
const context = await browser.newContext()
const result = await context.newPage()
await result.goto('https://saw.trixti.com.br/saw')
const s = await result.locator('a').evaluateAll((els) => {
return els.map((el) => el.textContent)
})
console.log(s)
await result.locator('input#submitForm').dispatchEvent('click')
}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">chromium</span><span class="pl-kos">,</span> <span class="pl-v">Page</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'playwright'</span>
<span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">testSAWTypeError</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">browser</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">chromium</span><span class="pl-kos">.</span><span class="pl-en">launch</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">headless</span>: <span class="pl-c1">false</span> <span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-k">const</span> <span class="pl-s1">context</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">newContext</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-k">const</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">context</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-k">await</span> <span class="pl-s1">result</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">'https://saw.trixti.com.br/saw'</span><span class="pl-kos">)</span>
<span class="pl-k">const</span> <span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">result</span><span class="pl-kos">.</span><span class="pl-en">locator</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-en">evaluateAll</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">els</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s1">els</span><span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">el</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-s1">el</span><span class="pl-kos">.</span><span class="pl-c1">textContent</span><span class="pl-kos">)</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">s</span><span class="pl-kos">)</span>
<span class="pl-k">await</span> <span class="pl-s1">result</span><span class="pl-kos">.</span><span class="pl-en">locator</span><span class="pl-kos">(</span><span class="pl-s">'input#submitForm'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">dispatchEvent</span><span class="pl-kos">(</span><span class="pl-s">'click'</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>Enter <a href="https://saw.trixti.com.br/saw" rel="nofollow">https://saw.trixti.com.br/saw</a></li>
<li>Try to call <code class="notranslate">locator.dispatchEvent</code> or <code class="notranslate">locator.evaluateAll</code></li>
</ul>
<p dir="auto"><strong>Expected</strong><br>
Should not crash</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">It crashes</p> | <h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: v1.32</li>
<li>Operating System: Windows 10, Ubuntu 20</li>
<li>Browser: Chromium</li>
<li>Other info:</li>
</ul>
<p dir="auto">When using a "setup" in project dependencies and you run a test with <code class="notranslate">--repeat-each</code> the setup step is repeated as well.<br>
I don't know if this is bug or "works as design" but it would be nice if the setup code only ran once. We can work around this my just running the setup one and then run the test with a project that do not have the setup as dependency, like this (see the playwright.config.ts below):</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="npx playwright test ./tests/setup.ts && npx playwright test ./tests/myTest.spec.ts --project local-chromium --repeat-each 25 --workers 1"><pre class="notranslate"><span class="pl-s1">npx</span> <span class="pl-s1">playwright</span> <span class="pl-s1">test</span> <span class="pl-kos">.</span><span class="pl-c1">/</span><span class="pl-s1">tests</span><span class="pl-c1">/</span><span class="pl-s1">setup</span><span class="pl-kos">.</span><span class="pl-c1">ts</span> <span class="pl-c1">&&</span> <span class="pl-s1">npx</span> <span class="pl-s1">playwright</span> <span class="pl-s1">test</span> <span class="pl-kos">.</span><span class="pl-c1">/</span><span class="pl-s1">tests</span><span class="pl-c1">/</span><span class="pl-s1">myTest</span><span class="pl-kos">.</span><span class="pl-c1">spec</span><span class="pl-kos">.</span><span class="pl-c1">ts</span> <span class="pl-c1">--</span><span class="pl-s1">project</span> <span class="pl-s1">local</span><span class="pl-c1">-</span><span class="pl-s1">chromium</span> <span class="pl-c1">--</span><span class="pl-s1">repeat</span><span class="pl-c1">-</span><span class="pl-s1">each</span> <span class="pl-c1">25</span> <span class="pl-c1">--</span><span class="pl-s1">workers</span> <span class="pl-c1">1</span></pre></div>
<p dir="auto">But this is not optimal since the second playwright run will overwrite the report from the setup.</p>
<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>Config file</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
projects: [
{
name: 'setup',
testMatch: /setup\.ts/,
},
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
dependencies: ['setup'],
},
{
name: 'local-chromium',
use: {
...devices['Desktop Chrome'],
},
},
});"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">defineConfig</span><span class="pl-kos">,</span> <span class="pl-s1">devices</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">projects</span>: <span class="pl-kos">[</span>
<span class="pl-kos">{</span>
<span class="pl-c1">name</span>: <span class="pl-s">'setup'</span><span class="pl-kos">,</span>
<span class="pl-c1">testMatch</span>: <span class="pl-pds"><span class="pl-c1">/</span>setup<span class="pl-cce">\.</span>ts<span class="pl-c1">/</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-c1">name</span>: <span class="pl-s">'chromium'</span><span class="pl-kos">,</span>
<span class="pl-c1">use</span>: <span class="pl-kos">{</span>
...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Chrome'</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">dependencies</span>: <span class="pl-kos">[</span><span class="pl-s">'setup'</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">name</span>: <span class="pl-s">'local-chromium'</span><span class="pl-kos">,</span>
<span class="pl-c1">use</span>: <span class="pl-kos">{</span>
...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Chrome'</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></pre></div>
<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="// setup.ts
import { test as setup } from '@playwright/test';
setup('setup', async ({}) => {
// setup code that takes long time
});"><pre class="notranslate"><span class="pl-c">// setup.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span> <span class="pl-k">as</span> <span class="pl-s1">setup</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>
<span class="pl-en">setup</span><span class="pl-kos">(</span><span class="pl-s">'setup'</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-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-c">// setup code that takes long time</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// myTest.spec.ts
test('some fine test', async ({ page }) => {
// some excellent test code
});"><pre class="notranslate"><span class="pl-c">// myTest.spec.ts</span>
<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'some fine test'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-c">// some excellent test code</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: npx playwright test ./tests/myTest.spec.ts --repeat-each 3 --workers 1</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" ✓ 1 [setup] › setup.ts:11:6 › setup (11.0s)
✓ 2 [chromium] › myTest.spec.ts › some fine test (740ms)
✓ 3 [chromium] › myTest.spec.ts › some fine test (647ms)
✓ 4 [chromium] › myTest.spec.ts› some fine test (656ms)"><pre class="notranslate"><code class="notranslate"> ✓ 1 [setup] › setup.ts:11:6 › setup (11.0s)
✓ 2 [chromium] › myTest.spec.ts › some fine test (740ms)
✓ 3 [chromium] › myTest.spec.ts › some fine test (647ms)
✓ 4 [chromium] › myTest.spec.ts› some fine test (656ms)
</code></pre></div>
<p dir="auto">the setup code should only run once</p>
<p dir="auto"><strong>Actual</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" ✓ 1 [setup] › setup.ts:11:6 › setup (12.7s)
✓ 2 [setup] › setup.ts:11:6 › setup (10.1s)
✓ 3 [setup] › setup.ts:11:6 › setup (11.0s)
✓ 4 [chromium] › myTest.spec.ts › some fine test (740ms)
✓ 5 [chromium] › myTest.spec.ts › some fine test (647ms)
✓ 6 [chromium] › myTest.spec.ts› some fine test (656ms)"><pre class="notranslate"><code class="notranslate"> ✓ 1 [setup] › setup.ts:11:6 › setup (12.7s)
✓ 2 [setup] › setup.ts:11:6 › setup (10.1s)
✓ 3 [setup] › setup.ts:11:6 › setup (11.0s)
✓ 4 [chromium] › myTest.spec.ts › some fine test (740ms)
✓ 5 [chromium] › myTest.spec.ts › some fine test (647ms)
✓ 6 [chromium] › myTest.spec.ts› some fine test (656ms)
</code></pre></div>
<p dir="auto">The set up is ran the "repeat-each" number of times</p> | 0 |
<p dir="auto">It was accident i encounter this issue.<br>
if i have a typescript file as follows<br>
module myMoudle {<br>
interface iTest {</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="t2:iTest;
x3:number;"><pre class="notranslate"><code class="notranslate">t2:iTest;
x3:number;
</code></pre></div>
<p dir="auto">}</p>
<p dir="auto">class test implements iTest {<br>
t2: iTest;<br>
x3: number;<br>
constructor(){<br>
this.t2 = new test();<br>
this.x3 = 1;<br>
}<br>
}</p>
<p dir="auto">}<br>
/*</p>
<p dir="auto">*/</p>
<p dir="auto">Correpsonding Javascript file contains JS + TS code and it is not commenting the typescript code properly. comment like /* /* instead of /* */. It does not matter if the comment has any thing inside or not. Test it from this link</p>
<p dir="auto"><a href="http://www.typescriptlang.org/Playground#src=module%20myMoudle%20%7B%0D%0Ainterface%20iTest%20%7B%0D%0A%09%0D%0A%09t2%3AiTest%3B%0D%0A%09x3%3Anumber%3B%0D%0A%7D%0D%0A%0D%0Aclass%20test%20implements%20iTest%20%7B%0D%0A%09t2%3A%20iTest%3B%0D%0A%09x3%3A%20number%3B%0D%0A%09constructor()%7B%0D%0A%09%09this.t2%20%3D%20new%20test()%3B%0D%0A%09%09this.x3%20%3D%201%3B%0D%0A%09%7D%0D%0A%7D%0D%0A%0D%0A%7D%0D%0A%2F*%20%20%20%0D%0A%0D%0A*%2F" rel="nofollow">http://www.typescriptlang.org/Playground#src=module%20myMoudle%20%7B%0D%0Ainterface%20iTest%20%7B%0D%0A%09%0D%0A%09t2%3AiTest%3B%0D%0A%09x3%3Anumber%3B%0D%0A%7D%0D%0A%0D%0Aclass%20test%20implements%20iTest%20%7B%0D%0A%09t2%3A%20iTest%3B%0D%0A%09x3%3A%20number%3B%0D%0A%09constructor()%7B%0D%0A%09%09this.t2%20%3D%20new%20test()%3B%0D%0A%09%09this.x3%20%3D%201%3B%0D%0A%09%7D%0D%0A%7D%0D%0A%0D%0A%7D%0D%0A%2F*%20%20%20%0D%0A%0D%0A*%2F</a></p>
<p dir="auto">var myMoudle;<br>
(function (myMoudle) {<br>
var test = (function () {<br>
function test() {<br>
this.t2 = new test();<br>
this.x3 = 1;<br>
}<br>
return test;<br>
})();<br>
})(myMoudle || (myMoudle = {}));<br>
/*</p>
<p dir="auto">module myMoudle {<br>
interface iTest {</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="t2:iTest;
x3:number;"><pre class="notranslate"><code class="notranslate">t2:iTest;
x3:number;
</code></pre></div>
<p dir="auto">}</p>
<p dir="auto">class test implements iTest {<br>
t2: iTest;<br>
x3: number;<br>
constructor(){<br>
this.t2 = new test();<br>
this.x3 = 1;<br>
}<br>
}</p>
<p dir="auto">}<br>
/*</p> | <p dir="auto">Hi,</p>
<p dir="auto"><strong>TS Version</strong>: 1.4</p>
<p dir="auto">The following code:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var x: any;
/*
var bar;
*/"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">x</span>: <span class="pl-smi">any</span><span class="pl-kos">;</span>
<span class="pl-c">/*</span>
<span class="pl-c">var bar;</span>
<span class="pl-c">*/</span></pre></div>
<p dir="auto">Emits the following JavaScript</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var x;
/*
var bar;
var x: any;
/*
var bar;"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">x</span><span class="pl-kos">;</span>
<span class="pl-c1">/</span><span class="pl-c1">*</span>
<span class="pl-k">var</span> <span class="pl-s1">bar</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">x</span>: <span class="pl-s1">any</span><span class="pl-kos">;</span>
<span class="pl-c1">/</span><span class="pl-c1">*</span>
<span class="pl-k">var</span> <span class="pl-s1">bar</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Expected</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var x;
/*
var bar;
*/"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">x</span><span class="pl-kos">;</span>
<span class="pl-c">/*</span>
<span class="pl-c">var bar;</span>
<span class="pl-c">*/</span></pre></div> | 1 |
<p dir="auto">Flaky occurrence:</p>
<p dir="auto"><a href="https://circle.pytorch.org/build-details.html?build_id=2161720" rel="nofollow">https://circle.pytorch.org/build-details.html?build_id=2161720</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Jul 09 19:35:19 test_DistributedDataParallel_SyncBatchNorm_Diff_Input_Sizes_Running_Value (__main__.TestDistBackend) ... Process process 0:
Jul 09 19:35:19 Traceback (most recent call last):
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
Jul 09 19:35:19 self.run()
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/multiprocessing/process.py", line 93, in run
Jul 09 19:35:19 self._target(*self._args, **self._kwargs)
Jul 09 19:35:19 File "test_distributed.py", line 1661, in _run
Jul 09 19:35:19 getattr(self, self.id().split(".")[2])()
Jul 09 19:35:19 File "test_distributed.py", line 1597, in wrapper
Jul 09 19:35:19 fn(self)
Jul 09 19:35:19 File "test_distributed.py", line 120, in wrapper
Jul 09 19:35:19 return func(*args, **kwargs)
Jul 09 19:35:19 File "test_distributed.py", line 136, in wrapper
Jul 09 19:35:19 return func(*args, **kwargs)
Jul 09 19:35:19 File "test_distributed.py", line 1548, in test_DistributedDataParallel_SyncBatchNorm_Diff_Input_Sizes_Running_Value
Jul 09 19:35:19 model = nn.parallel.DistributedDataParallel(ONLY_SBN_NET.cuda(rank), device_ids=[rank])
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/site-packages/torch/nn/parallel/distributed.py", line 298, in __init__
Jul 09 19:35:19 self.broadcast_bucket_size)
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/site-packages/torch/nn/parallel/distributed.py", line 480, in _distributed_broadcast_coalesced
Jul 09 19:35:19 dist._broadcast_coalesced(self.process_group, tensors, buffer_size)
Jul 09 19:35:19 RuntimeError: NCCL error in: /var/lib/jenkins/workspace/torch/lib/c10d/ProcessGroupNCCL.cpp:272, unhandled system error
Jul 09 19:35:19 Process process 1:
Jul 09 19:35:19 Traceback (most recent call last):
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
Jul 09 19:35:19 self.run()
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/multiprocessing/process.py", line 93, in run
Jul 09 19:35:19 self._target(*self._args, **self._kwargs)
Jul 09 19:35:19 File "test_distributed.py", line 1661, in _run
Jul 09 19:35:19 getattr(self, self.id().split(".")[2])()
Jul 09 19:35:19 File "test_distributed.py", line 1597, in wrapper
Jul 09 19:35:19 fn(self)
Jul 09 19:35:19 File "test_distributed.py", line 120, in wrapper
Jul 09 19:35:19 return func(*args, **kwargs)
Jul 09 19:35:19 File "test_distributed.py", line 136, in wrapper
Jul 09 19:35:19 return func(*args, **kwargs)
Jul 09 19:35:19 File "test_distributed.py", line 1548, in test_DistributedDataParallel_SyncBatchNorm_Diff_Input_Sizes_Running_Value
Jul 09 19:35:19 model = nn.parallel.DistributedDataParallel(ONLY_SBN_NET.cuda(rank), device_ids=[rank])
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/site-packages/torch/nn/parallel/distributed.py", line 298, in __init__
Jul 09 19:35:19 self.broadcast_bucket_size)
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/site-packages/torch/nn/parallel/distributed.py", line 480, in _distributed_broadcast_coalesced
Jul 09 19:35:19 dist._broadcast_coalesced(self.process_group, tensors, buffer_size)
Jul 09 19:35:19 RuntimeError: Connection reset by peer
Jul 09 19:40:19 FAIL
Jul 09 19:40:48 ======================================================================
Jul 09 19:40:48 FAIL: test_DistributedDataParallel_SyncBatchNorm_Diff_Input_Sizes_Running_Value (__main__.TestDistBackend)
Jul 09 19:40:48 ----------------------------------------------------------------------
Jul 09 19:40:48 Traceback (most recent call last):
Jul 09 19:40:48 File "test_distributed.py", line 1595, in wrapper
Jul 09 19:40:48 self._join_and_reduce(fn)
Jul 09 19:40:48 File "test_distributed.py", line 1677, in _join_and_reduce
Jul 09 19:40:48 "Timeout waiting for rank %d to terminate" % rank)
Jul 09 19:40:48 AssertionError: True is not false : Timeout waiting for rank 2 to terminate
Jul 09 19:40:48
Jul 09 19:40:48 ----------------------------------------------------------------------"><pre class="notranslate"><code class="notranslate">Jul 09 19:35:19 test_DistributedDataParallel_SyncBatchNorm_Diff_Input_Sizes_Running_Value (__main__.TestDistBackend) ... Process process 0:
Jul 09 19:35:19 Traceback (most recent call last):
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
Jul 09 19:35:19 self.run()
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/multiprocessing/process.py", line 93, in run
Jul 09 19:35:19 self._target(*self._args, **self._kwargs)
Jul 09 19:35:19 File "test_distributed.py", line 1661, in _run
Jul 09 19:35:19 getattr(self, self.id().split(".")[2])()
Jul 09 19:35:19 File "test_distributed.py", line 1597, in wrapper
Jul 09 19:35:19 fn(self)
Jul 09 19:35:19 File "test_distributed.py", line 120, in wrapper
Jul 09 19:35:19 return func(*args, **kwargs)
Jul 09 19:35:19 File "test_distributed.py", line 136, in wrapper
Jul 09 19:35:19 return func(*args, **kwargs)
Jul 09 19:35:19 File "test_distributed.py", line 1548, in test_DistributedDataParallel_SyncBatchNorm_Diff_Input_Sizes_Running_Value
Jul 09 19:35:19 model = nn.parallel.DistributedDataParallel(ONLY_SBN_NET.cuda(rank), device_ids=[rank])
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/site-packages/torch/nn/parallel/distributed.py", line 298, in __init__
Jul 09 19:35:19 self.broadcast_bucket_size)
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/site-packages/torch/nn/parallel/distributed.py", line 480, in _distributed_broadcast_coalesced
Jul 09 19:35:19 dist._broadcast_coalesced(self.process_group, tensors, buffer_size)
Jul 09 19:35:19 RuntimeError: NCCL error in: /var/lib/jenkins/workspace/torch/lib/c10d/ProcessGroupNCCL.cpp:272, unhandled system error
Jul 09 19:35:19 Process process 1:
Jul 09 19:35:19 Traceback (most recent call last):
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
Jul 09 19:35:19 self.run()
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/multiprocessing/process.py", line 93, in run
Jul 09 19:35:19 self._target(*self._args, **self._kwargs)
Jul 09 19:35:19 File "test_distributed.py", line 1661, in _run
Jul 09 19:35:19 getattr(self, self.id().split(".")[2])()
Jul 09 19:35:19 File "test_distributed.py", line 1597, in wrapper
Jul 09 19:35:19 fn(self)
Jul 09 19:35:19 File "test_distributed.py", line 120, in wrapper
Jul 09 19:35:19 return func(*args, **kwargs)
Jul 09 19:35:19 File "test_distributed.py", line 136, in wrapper
Jul 09 19:35:19 return func(*args, **kwargs)
Jul 09 19:35:19 File "test_distributed.py", line 1548, in test_DistributedDataParallel_SyncBatchNorm_Diff_Input_Sizes_Running_Value
Jul 09 19:35:19 model = nn.parallel.DistributedDataParallel(ONLY_SBN_NET.cuda(rank), device_ids=[rank])
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/site-packages/torch/nn/parallel/distributed.py", line 298, in __init__
Jul 09 19:35:19 self.broadcast_bucket_size)
Jul 09 19:35:19 File "/opt/conda/lib/python3.6/site-packages/torch/nn/parallel/distributed.py", line 480, in _distributed_broadcast_coalesced
Jul 09 19:35:19 dist._broadcast_coalesced(self.process_group, tensors, buffer_size)
Jul 09 19:35:19 RuntimeError: Connection reset by peer
Jul 09 19:40:19 FAIL
Jul 09 19:40:48 ======================================================================
Jul 09 19:40:48 FAIL: test_DistributedDataParallel_SyncBatchNorm_Diff_Input_Sizes_Running_Value (__main__.TestDistBackend)
Jul 09 19:40:48 ----------------------------------------------------------------------
Jul 09 19:40:48 Traceback (most recent call last):
Jul 09 19:40:48 File "test_distributed.py", line 1595, in wrapper
Jul 09 19:40:48 self._join_and_reduce(fn)
Jul 09 19:40:48 File "test_distributed.py", line 1677, in _join_and_reduce
Jul 09 19:40:48 "Timeout waiting for rank %d to terminate" % rank)
Jul 09 19:40:48 AssertionError: True is not false : Timeout waiting for rank 2 to terminate
Jul 09 19:40:48
Jul 09 19:40:48 ----------------------------------------------------------------------
</code></pre></div>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mrshenli/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mrshenli">@mrshenli</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/unlimblue/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/unlimblue">@unlimblue</a></p> | <h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto"><code class="notranslate">TestDistBackend.test_DistributedDataParallel_SyncBatchNorm_Diff_Input_Sizes_Running_Value</code> seems to be flaky</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="23:43:08 ======================================================================
23:43:08 FAIL: test_DistributedDataParallel_SyncBatchNorm_Diff_Input_Sizes_Running_Value (__main__.TestDistBackend)
23:43:08 ----------------------------------------------------------------------
23:43:08 Traceback (most recent call last):
23:43:08 File "test_distributed.py", line 1986, in wrapper
23:43:08 self._join_and_reduce(fn)
23:43:08 File "test_distributed.py", line 2079, in _join_and_reduce
23:43:08 "Timeout waiting for rank %d to terminate" % rank)
23:43:08 AssertionError: True is not false : Timeout waiting for rank 1 to terminate"><pre class="notranslate"><code class="notranslate">23:43:08 ======================================================================
23:43:08 FAIL: test_DistributedDataParallel_SyncBatchNorm_Diff_Input_Sizes_Running_Value (__main__.TestDistBackend)
23:43:08 ----------------------------------------------------------------------
23:43:08 Traceback (most recent call last):
23:43:08 File "test_distributed.py", line 1986, in wrapper
23:43:08 self._join_and_reduce(fn)
23:43:08 File "test_distributed.py", line 2079, in _join_and_reduce
23:43:08 "Timeout waiting for rank %d to terminate" % rank)
23:43:08 AssertionError: True is not false : Timeout waiting for rank 1 to terminate
</code></pre></div>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ezyang/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ezyang">@ezyang</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gchanan/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gchanan">@gchanan</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zou3519/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zou3519">@zou3519</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jerryzh168/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jerryzh168">@jerryzh168</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pietern/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pietern">@pietern</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mrshenli/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mrshenli">@mrshenli</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pritamdamania87/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pritamdamania87">@pritamdamania87</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zhaojuanmao/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zhaojuanmao">@zhaojuanmao</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/satgera/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/satgera">@satgera</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rohan-varma/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rohan-varma">@rohan-varma</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gqchen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gqchen">@gqchen</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/aazzolini/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/aazzolini">@aazzolini</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/xush6528/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/xush6528">@xush6528</a></p> | 1 |
<h3 dir="auto">What problem does this feature solve?</h3>
<p dir="auto">This feature will allow to do validation based on the value of other properties.</p>
<h3 dir="auto">What does the proposed API look like?</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Vue.component('my-component', {
props: {
propA: 'String',
propB: {
validator(value, props) {
switch(props.propA) {
case 'email':
return validEmail(value)
case 'tel':
return validTel(value)
default:
return true
}
}
}
}
})"><pre class="notranslate"><span class="pl-v">Vue</span><span class="pl-kos">.</span><span class="pl-en">component</span><span class="pl-kos">(</span><span class="pl-s">'my-component'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
<span class="pl-c1">props</span>: <span class="pl-kos">{</span>
<span class="pl-c1">propA</span>: <span class="pl-s">'String'</span><span class="pl-kos">,</span>
<span class="pl-c1">propB</span>: <span class="pl-kos">{</span>
<span class="pl-en">validator</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">,</span> <span class="pl-s1">props</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">switch</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">.</span><span class="pl-c1">propA</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">case</span> <span class="pl-s">'email'</span>:
<span class="pl-k">return</span> <span class="pl-en">validEmail</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span>
<span class="pl-k">case</span> <span class="pl-s">'tel'</span>:
<span class="pl-k">return</span> <span class="pl-en">validTel</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span>
<span class="pl-k">default</span>:
<span class="pl-k">return</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-kos">}</span><span class="pl-kos">)</span></pre></div> | <h3 dir="auto">Version</h3>
<p dir="auto">2.6.10</p>
<h3 dir="auto">Reproduction link</h3>
<p dir="auto"><a href="https://codepen.io/leevscript/pen/gOawPgP" rel="nofollow">https://codepen.io/leevscript/pen/gOawPgP</a></p>
<h3 dir="auto">Steps to reproduce</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<template>
<ul>
<li v-for="num in nums" :key="num">{{num}}</li>
</ul>
</template>
<script>
export default {
data () {
return {
nums: [1, 2, 3]
}
},
mounted () {
this.nums = [2, 2]
}
}
</script>"><pre class="notranslate"><code class="notranslate"><template>
<ul>
<li v-for="num in nums" :key="num">{{num}}</li>
</ul>
</template>
<script>
export default {
data () {
return {
nums: [1, 2, 3]
}
},
mounted () {
this.nums = [2, 2]
}
}
</script>
</code></pre></div>
<h3 dir="auto">What is expected?</h3>
<p dir="auto">normal</p>
<h3 dir="auto">What is actually happening?</h3>
<p dir="auto">error</p>
<hr>
<p dir="auto">英文不太好,问题又比较复杂,所以就用中文了,抱歉。<br>
当 oldCh 里的元素跟 newCh 里的元素匹配到且该元素不在 oldCh 的首尾且 newCh 里该元素有多个时,diff 算法会报错。<br>
我知道 key 应该是唯一标识,但我理解这种情况不应该报错,因为很多数据由服务端返回,我们不能保证不会有重复元素。</p> | 0 |
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I tried using the <code class="notranslate">@types/lodash</code> package and had problems.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> 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>
</ul>
<p dir="auto">The following are the errors I get when doing a rebuild</p>
<p dir="auto">/Users/amalla/workspace/sparqapp/node_modules/@types/lodash/index.d.ts(244,13): error TS2300: Duplicate identifier '<em>'.<br>
/Users/amalla/workspace/sparqapp/node_modules/@types/lodash/index.d.ts(248,19): error TS2300: Duplicate identifier '</em>'.<br>
/Users/amalla/workspace/sparqapp/node_modules/@types/lodash/index.d.ts(11451,21): error TS1005: ']' expected.<br>
/Users/amalla/workspace/sparqapp/node_modules/@types/lodash/index.d.ts(11451,22): error TS1005: ';' expected.<br>
/Users/amalla/workspace/sparqapp/node_modules/@types/lodash/index.d.ts(11451,23): error TS1128: Declaration or statement expected.<br>
/Users/amalla/workspace/sparqapp/node_modules/@types/lodash/index.d.ts(11451,33): error TS1005: ']' expected.<br>
/Users/amalla/workspace/sparqapp/node_modules/@types/lodash/index.d.ts(11451,34): error TS1005: ')' expected.<br>
/Users/amalla/workspace/sparqapp/node_modules/@types/lodash/index.d.ts(11451,35): error TS1128: Declaration or statement expected.<br>
/Users/amalla/workspace/sparqapp/node_modules/@types/lodash/index.d.ts(11451,37): error TS1128: Declaration or statement expected.<br>
/Users/amalla/workspace/sparqapp/node_modules/@types/lodash/index.d.ts(19448,1): error TS1128: Declaration or statement expected.</p> | <p dir="auto"><code class="notranslate">lowdb-tests</code> are failing on master, probably due to a typescript change. It looks like the <code class="notranslate">If<...></code> types no longer work properly.</p>
<p dir="auto">The good news is, in TS2.8 we can use conditional types, which do the same thing in a much more reliable way. I can make a PR for this, but I want to make sure we're OK with dropping support for TS 2.6-2.7.</p>
<p dir="auto">I think it's worth dropping support because the types are very broken in TS2.8 right now. Anyone using TS 2.6 can still install <code class="notranslate">@types/[email protected]</code> to pin to the older version.</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/xxxx</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.
<ul dir="auto">
<li>Authors: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/typicode/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/typicode">@typicode</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/niieani/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/niieani">@niieani</a></li>
</ul>
</li>
</ul> | 0 |
<h2 dir="auto"><g-emoji class="g-emoji" alias="question" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2753.png">❓</g-emoji> Questions & Help</h2>
<p dir="auto">When using En-Fr XLMModel in transformers library,<br>
I found that result from tokenizing a whole sentence is different from tokenizing words in the sentence and then concatenate.</p>
<p dir="auto">My configuration is as below<br>
<strong>(XLMModel, XLMTokenizer, XLMConfig, 'xlm-mlm-enfr-1024')</strong></p>
<p dir="auto">The result is as below<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/12389429/71879066-84a93000-3170-11ea-91fe-25227ebe478e.png"><img src="https://user-images.githubusercontent.com/12389429/71879066-84a93000-3170-11ea-91fe-25227ebe478e.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">The ultimate goal is to 'detokenize' tokenized sentence which is<br>
['I', 'love', 'swim', '##ing'] -> ['I', 'love', 'swimming']<br>
In order to do this, I have to know the raw token's index for each tokenized tokens.</p>
<p dir="auto">It would be great if anyone can help with this problem.</p> | <h2 dir="auto">🐛 Bug</h2>
<p dir="auto">Model I am using: <strong>Bert</strong><br>
Language I am using the model on: <strong>English</strong></p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Call <code class="notranslate">bertTokenizer.tokenize("text", return_tokens_mapped_to_origin=True)</code><br>
Result:</p>
<blockquote>
<p dir="auto">TypeError: _tokenize() got an unexpected keyword argument 'return_tokens_mapped_to_origin'</p>
</blockquote>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">The official documentation mentions a "return_tokens_mapped_to_origin" optional parameter that when set to True should return the index of each token in the initial given text.<br>
<a href="https://huggingface.co/transformers/main_classes/tokenizer.html?highlight=return_tokens_mapped_to_origin#transformers.PreTrainedTokenizer.tokenize" rel="nofollow">https://huggingface.co/transformers/main_classes/tokenizer.html?highlight=return_tokens_mapped_to_origin#transformers.PreTrainedTokenizer.tokenize</a></p>
<h2 dir="auto">Environment</h2>
<ul dir="auto">
<li>OS: macOS Mojave</li>
<li>Python version: 3.7</li>
<li>PyTorch version: 1.3.0</li>
<li>PyTorch Transformers version (or branch): 2.2.1</li>
<li>Using GPU ? No</li>
</ul>
<h2 dir="auto">Additional context</h2>
<p dir="auto">In the source code this parameter is never used outside of the doc comment, neither in the base class nor in its implementations.</p> | 1 |
<p dir="auto">Now the automated interface is not displayed with mouse like icons. It is difficult to understand what you are doing if you have not seen it yourself</p> | <p dir="auto">It would be nice to natively have support for a mouse helper. So if running in headful mode, or taking a screenshot, or video recording, one would see where the mouse is, text selections, drag & drops, and where it clicks during a failure.</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/aslushnikov/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/aslushnikov">@aslushnikov</a> already had one in Puppeteer but it required installing it, but maybe it could be default-installed on the browserContext or page instead if wanted, or even for the browser. Having it out of the box would improve usability for all users. Especially during debugging.</p>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="439099680" data-permission-text="Title is private" data-url="https://github.com/puppeteer/puppeteer/issues/4378" data-hovercard-type="issue" data-hovercard-url="/puppeteer/puppeteer/issues/4378/hovercard?comment_id=499726973&comment_type=issue_comment" href="https://github.com/puppeteer/puppeteer/issues/4378#issuecomment-499726973">puppeteer/puppeteer#4378 (comment)</a></p> | 1 |
<p dir="auto">I am using SciPy (version 1.2.0) for some reasons with a simulation software.<br>
In my case, I need to model the structure in the simulation software based on the results of calculation on variables. The results from the simulation software is the objective function.<br>
However, mostly the design variables can not form the structure. If these infeasible variables pass into simulation software, it will generate a mistake which causes the optimization stop. How can I ask SLSQP to reject infeasible varibales strictly untill the feasible one generate and then pass the feasible one into simulation software to provide the objective value for optimization?</p> | <p dir="auto">Given a constrained optimisation problem, the <code class="notranslate">L-BFGS-B</code> routine (and perhaps others) step outside the prescribed bounds to estimate the gradient despite <code class="notranslate">keep_feasible = True</code>. Is this the correct usage of this parameter in <code class="notranslate">Bounds</code>?</p>
<p dir="auto">Reprex below of a function where <code class="notranslate">ub + eps</code> results in an exception. I would have thought that when estimating the gradient at the upper bound, this should be done <em>below</em> the bound rather than always <em>adding</em> <code class="notranslate">eps</code>?</p>
<p dir="auto">The workaround would be to manually specify <code class="notranslate">eps</code> as per this example and then redefine the bounds as <code class="notranslate">Bounds(lb, ub - eps)</code> however I wouldn't have thought this is ideal?</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="import numpy as np
from math import log
from scipy.optimize import minimize, Bounds
eps = 1e-8
def f(x):
print(x)
return log(1 + eps - x)
f(0)
f(1)
x0 = np.array([0])
x_bounds = Bounds(np.array([0.]), np.array([1.]), keep_feasible = True)
res = minimize(fun = f, x0 = x0, method = 'L-BFGS-B', bounds = x_bounds, options = {'eps': eps})"><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">from</span> <span class="pl-s1">math</span> <span class="pl-k">import</span> <span class="pl-s1">log</span>
<span class="pl-k">from</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">optimize</span> <span class="pl-k">import</span> <span class="pl-s1">minimize</span>, <span class="pl-v">Bounds</span>
<span class="pl-s1">eps</span> <span class="pl-c1">=</span> <span class="pl-c1">1e-8</span>
<span class="pl-k">def</span> <span class="pl-en">f</span>(<span class="pl-s1">x</span>):
<span class="pl-en">print</span>(<span class="pl-s1">x</span>)
<span class="pl-k">return</span> <span class="pl-en">log</span>(<span class="pl-c1">1</span> <span class="pl-c1">+</span> <span class="pl-s1">eps</span> <span class="pl-c1">-</span> <span class="pl-s1">x</span>)
<span class="pl-en">f</span>(<span class="pl-c1">0</span>)
<span class="pl-en">f</span>(<span class="pl-c1">1</span>)
<span class="pl-s1">x0</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-c1">0</span>])
<span class="pl-s1">x_bounds</span> <span class="pl-c1">=</span> <span class="pl-v">Bounds</span>(<span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-c1">0.</span>]), <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-c1">1.</span>]), <span class="pl-s1">keep_feasible</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span>)
<span class="pl-s1">res</span> <span class="pl-c1">=</span> <span class="pl-en">minimize</span>(<span class="pl-s1">fun</span> <span class="pl-c1">=</span> <span class="pl-s1">f</span>, <span class="pl-s1">x0</span> <span class="pl-c1">=</span> <span class="pl-s1">x0</span>, <span class="pl-s1">method</span> <span class="pl-c1">=</span> <span class="pl-s">'L-BFGS-B'</span>, <span class="pl-s1">bounds</span> <span class="pl-c1">=</span> <span class="pl-s1">x_bounds</span>, <span class="pl-s1">options</span> <span class="pl-c1">=</span> {<span class="pl-s">'eps'</span>: <span class="pl-s1">eps</span>})</pre></div>
<h3 dir="auto">Error message:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="0
1
[0.]
[1.e-08] # lb + eps
[1.]
[1.00000001] # ub + eps is infeasible
Traceback ... in f
return log(1 + eps - x)
ValueError: math domain error"><pre class="notranslate"><code class="notranslate">0
1
[0.]
[1.e-08] # lb + eps
[1.]
[1.00000001] # ub + eps is infeasible
Traceback ... in f
return log(1 + eps - x)
ValueError: math domain error
</code></pre></div>
<h3 dir="auto">Scipy/Numpy/Python version information:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="1.1.0 1.14.5 sys.version_info(major=3, minor=6, micro=6, releaselevel='final', serial=0)"><pre class="notranslate"><code class="notranslate">1.1.0 1.14.5 sys.version_info(major=3, minor=6, micro=6, releaselevel='final', serial=0)
</code></pre></div> | 1 |
<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.18362.0
Windows Terminal version: 0.5.2681.0
Powershell Core: 6.2.1
Powershell Modules:
posh-git: 1.0.0
PSReadLine: 2.0.0"><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: 10.0.18362.0
Windows Terminal version: 0.5.2681.0
Powershell Core: 6.2.1
Powershell Modules:
posh-git: 1.0.0
PSReadLine: 2.0.0
</code></pre></div>
<p dir="auto">I'm not able to reproduce this bug outside git repos, so I think this is somehow related to posh-git (or maybe the PS1 variable).</p>
<blockquote>
<p dir="auto">I'm not sure if this is a problem with posh-git or the terminal itself, so I'm posting here looking for some guidance.</p>
</blockquote>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">If you're using posh-git, open the terminal on a GIT repository and type something with 3 or more characters.</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">The line moves one column left.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8502026/65963688-af793f00-e431-11e9-8a6c-3aef520bd13d.gif"><img src="https://user-images.githubusercontent.com/8502026/65963688-af793f00-e431-11e9-8a6c-3aef520bd13d.gif" alt="terminal2" data-animated-image="" style="max-width: 100%;"></a></p>
<hr>
<h2 dir="auto">Update</h2>
<p dir="auto">Digging a little bit more into this I've found that this doesn't happen on a branch with no upstream tracking — which is represented by that 3 vertical lines character on posh-git.</p>
<p dir="auto">So maybe it's related with the <code class="notranslate">≡</code> character?</p> | <h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Microsoft Windows [Version 10.0.18995.1]
Windows Terminal version (if applicable): 0.5.2681.0
"><pre class="notranslate"><code class="notranslate">Microsoft Windows [Version 10.0.18995.1]
Windows Terminal version (if applicable): 0.5.2681.0
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">set copyOnSelect to false</p>
<h1 dir="auto">Expected behavior</h1>
<ol dir="auto">
<li>select text</li>
<li>remove selection</li>
<li>clipboard remains unchanged</li>
</ol>
<h1 dir="auto">Actual behavior</h1>
<ol dir="auto">
<li>select text</li>
<li>remove selection</li>
<li>clipboard is overwritten with previously selected text</li>
</ol> | 0 |
<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/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" checked=""> 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: 2.6.4</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>GenericService泛化调用</li>
<li>使用oninvoke、onreturn、onthrow</li>
<li>FutureFilter无法正常回调</li>
</ol>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">StaticContext.getKey(invoker.getUrl(), invocation.getMethodName(), Constants.ON_INVOKE_METHOD_KEY)<br>
返回<br>
com.alibaba.boot.dubbo.demo.consumer.DemoService:1.0.0.sayHello.oninvoke.method</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">StaticContext.getKey(invoker.getUrl(), invocation.getMethodName(), Constants.ON_INVOKE_METHOD_KEY)<br>
返回<br>
com.alibaba.boot.dubbo.demo.consumer.DemoService:1.0.0.$invoke.oninvoke.method</p>
<p dir="auto">预期是:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" String methodName = invocation.getMethodName();
if("$invoke".equals(methodName)) {
Object[] arguments = invocation.getArguments();
methodName = (String) arguments[0];
}"><pre class="notranslate"><code class="notranslate"> String methodName = invocation.getMethodName();
if("$invoke".equals(methodName)) {
Object[] arguments = invocation.getArguments();
methodName = (String) arguments[0];
}
</code></pre></div> | <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: 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> | 0 |
<p dir="auto">The bench release step in CI is sometimes failing in the past ~2 days, looking through the full logs shows a panic. I noticed it is happening for a few people:</p>
<p dir="auto"><a href="https://github.com/denoland/deno/runs/8141440030?check_suite_focus=true">https://github.com/denoland/deno/runs/8141440030?check_suite_focus=true</a><br>
<a href="https://github.com/denoland/deno/runs/8132978773?check_suite_focus=true">https://github.com/denoland/deno/runs/8132978773?check_suite_focus=true</a><br>
<a href="https://github.com/denoland/deno/runs/8155825401?check_suite_focus=true">https://github.com/denoland/deno/runs/8155825401?check_suite_focus=true</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2022-09-02T12:36:18.3505406Z http_benchmark testing RUST hyper
2022-09-02T12:36:23.3500404Z /home/runner/work/deno/deno/target/release/test_server 4563
2022-09-02T12:36:23.3528614Z hyper hello
2022-09-02T12:36:28.3508025Z /home/runner/work/deno/deno/third_party/prebuilt/linux64/wrk -d 20s --latency http://127.0.0.1:4563/
2022-09-02T12:36:49.4547335Z Running 20s test @ http://127.0.0.1:4563/
2022-09-02T12:36:49.4547829Z 2 threads and 10 connections
2022-09-02T12:36:49.4548514Z Thread Stats Avg Stdev Max +/- Stdev
2022-09-02T12:36:49.4550281Z Latency 121.75us 86.47us 5.10ms 99.49%
2022-09-02T12:36:49.4551042Z Req/Sec 41.93k 3.49k 96.15k 92.52%
2022-09-02T12:36:49.4551335Z Latency Distribution
2022-09-02T12:36:49.4551600Z 50% 119.00us
2022-09-02T12:36:49.4551834Z 75% 122.00us
2022-09-02T12:36:49.4552079Z 90% 128.00us
2022-09-02T12:36:49.4552309Z 99% 143.00us
2022-09-02T12:36:49.4559063Z 1672233 requests in 20.10s, 140.34MB read
2022-09-02T12:36:49.4559465Z Requests/sec: 83196.83
2022-09-02T12:36:49.4559779Z Transfer/sec: 6.98MB
2022-09-02T12:36:49.4560290Z
2022-09-02T12:36:50.0658792Z �[0m�[1m�[31merror�[0m: Uncaught Error: bad
2022-09-02T12:36:50.0659136Z throw Error("bad");
2022-09-02T12:36:50.0659423Z �[0m�[31m ^�[0m
2022-09-02T12:36:50.0659950Z at �[0m�[1m�[3mfoo�[0m (�[0m�[36mfile:///home/runner/work/deno/deno/cli/tests/testdata/error_001.ts�[0m:�[0m�[33m2�[0m:�[0m�[33m9�[0m)
2022-09-02T12:36:50.0660550Z at �[0m�[1m�[3mbar�[0m (�[0m�[36mfile:///home/runner/work/deno/deno/cli/tests/testdata/error_001.ts�[0m:�[0m�[33m6�[0m:�[0m�[33m3�[0m)
2022-09-02T12:36:50.0661297Z at �[0m�[36mfile:///home/runner/work/deno/deno/cli/tests/testdata/error_001.ts�[0m:�[0m�[33m9�[0m:�[0m�[33m1�[0m
2022-09-02T12:36:53.8917223Z thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseFloatError { kind: Invalid }', test_util/src/lib.rs:2209:62
2022-09-02T12:36:53.8918163Z stack backtrace:
2022-09-02T12:36:53.9023567Z 0: 0x55987e602aad - std::backtrace_rs::backtrace::libunwind::trace::h8217d0a8f3fd2f41
2022-09-02T12:36:53.9024317Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
2022-09-02T12:36:53.9025095Z 1: 0x55987e602aad - std::backtrace_rs::backtrace::trace_unsynchronized::h308103876b3af410
2022-09-02T12:36:53.9025705Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2022-09-02T12:36:53.9026431Z 2: 0x55987e602aad - std::sys_common::backtrace::_print_fmt::hc208018c6153605e
2022-09-02T12:36:53.9027016Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:66:5
2022-09-02T12:36:53.9027855Z 3: 0x55987e602aad - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf89a7ed694dfb585
2022-09-02T12:36:53.9028487Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:45:22
2022-09-02T12:36:53.9040223Z 4: 0x55987e62a37c - core::fmt::write::h21038c1382fe4264
2022-09-02T12:36:53.9040737Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/fmt/mod.rs:1197:17
2022-09-02T12:36:53.9041406Z 5: 0x55987e5fc501 - std::io::Write::write_fmt::h7dbb1c9a3c254aef
2022-09-02T12:36:53.9041930Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/io/mod.rs:1672:15
2022-09-02T12:36:53.9042588Z 6: 0x55987e604385 - std::sys_common::backtrace::_print::h4e8889719c9ddeb8
2022-09-02T12:36:53.9043132Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:48:5
2022-09-02T12:36:53.9043807Z 7: 0x55987e604385 - std::sys_common::backtrace::print::h1506fe2cb3022667
2022-09-02T12:36:53.9044350Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:35:9
2022-09-02T12:36:53.9045036Z 8: 0x55987e604385 - std::panicking::default_hook::{{closure}}::hd9d7ce2a8a782440
2022-09-02T12:36:53.9045581Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:295:22
2022-09-02T12:36:53.9046239Z 9: 0x55987e6040a6 - std::panicking::default_hook::h5b16ec25444b1b5d
2022-09-02T12:36:53.9046765Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:314:9
2022-09-02T12:36:53.9047773Z 10: 0x55987e604976 - std::panicking::rust_panic_with_hook::hb0138cb6e6fea3e4
2022-09-02T12:36:53.9048318Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:698:17
2022-09-02T12:36:53.9049018Z 11: 0x55987e604867 - std::panicking::begin_panic_handler::{{closure}}::h4cb67095557cd1aa
2022-09-02T12:36:53.9049566Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:588:13
2022-09-02T12:36:53.9050291Z 12: 0x55987e602f64 - std::sys_common::backtrace::__rust_end_short_backtrace::h2bfcac279dcdc911
2022-09-02T12:36:53.9050873Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:138:18
2022-09-02T12:36:53.9051395Z 13: 0x55987e604599 - rust_begin_unwind
2022-09-02T12:36:53.9051880Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:584:5
2022-09-02T12:36:53.9052558Z 14: 0x55987e628123 - core::panicking::panic_fmt::h1de71520faaa17d3
2022-09-02T12:36:53.9053090Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:142:14
2022-09-02T12:36:53.9053843Z 15: 0x55987e6283d3 - core::result::unwrap_failed::hc0baa33ef8bc7db8
2022-09-02T12:36:53.9054367Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/result.rs:1805:5
2022-09-02T12:36:53.9055019Z 16: 0x55987e6eb61a - core::result::Result<T,E>::unwrap::h7e1240d879443ff1
2022-09-02T12:36:53.9055636Z 17: 0x55987e6f2426 - test_util::parse_strace_output::hebb5546f94939b80
2022-09-02T12:36:53.9056247Z 18: 0x55987e693da9 - deno_bench::main::{{closure}}::hef9d8fe059ae0e73
2022-09-02T12:36:53.9057019Z 19: 0x55987e67ab74 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hbfe5c1a5749c31c1
2022-09-02T12:36:53.9057664Z 20: 0x55987e68cab7 - deno_bench::main::h2a6251fe232b87ef
2022-09-02T12:36:53.9058352Z 21: 0x55987e64c76f - std::sys_common::backtrace::__rust_begin_short_backtrace::h8922240d9524a44b
2022-09-02T12:36:53.9058997Z 22: 0x55987e64d395 - std::rt::lang_start::{{closure}}::h5f5c6fddb32353b1
2022-09-02T12:36:53.9059768Z 23: 0x55987e5f6d6e - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h4937aaa125c8d4b2
2022-09-02T12:36:53.9060369Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/ops/function.rs:280:13
2022-09-02T12:36:53.9061015Z 24: 0x55987e5f6d6e - std::panicking::try::do_call::h6f5c70e8b0a34f92
2022-09-02T12:36:53.9061543Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:492:40
2022-09-02T12:36:53.9062149Z 25: 0x55987e5f6d6e - std::panicking::try::h68766ba264ecf2e2
2022-09-02T12:36:53.9062659Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:456:19
2022-09-02T12:36:53.9063285Z 26: 0x55987e5f6d6e - std::panic::catch_unwind::hc36033d2f9cc04af
2022-09-02T12:36:53.9063798Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panic.rs:137:14
2022-09-02T12:36:53.9064465Z 27: 0x55987e5f6d6e - std::rt::lang_start_internal::{{closure}}::h78c037f4a1a28ded
2022-09-02T12:36:53.9064983Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/rt.rs:128:48
2022-09-02T12:36:53.9065609Z 28: 0x55987e5f6d6e - std::panicking::try::do_call::he6e1fffda4c750ee
2022-09-02T12:36:53.9066137Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:492:40
2022-09-02T12:36:53.9066750Z 29: 0x55987e5f6d6e - std::panicking::try::h48a77ddbb2f4c87a
2022-09-02T12:36:53.9067263Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:456:19
2022-09-02T12:36:53.9067971Z 30: 0x55987e5f6d6e - std::panic::catch_unwind::hfa809b06a550a9e7
2022-09-02T12:36:53.9068481Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panic.rs:137:14
2022-09-02T12:36:53.9069116Z 31: 0x55987e5f6d6e - std::rt::lang_start_internal::h4db69ed48eaca005
2022-09-02T12:36:53.9069626Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/rt.rs:128:20
2022-09-02T12:36:53.9070070Z 32: 0x55987e697432 - main
2022-09-02T12:36:53.9070471Z 33: 0x7f2a7b911083 - __libc_start_main
2022-09-02T12:36:53.9070859Z 34: 0x55987e59c5e9 - _start
2022-09-02T12:36:53.9071230Z 35: 0x0 - <unknown>
2022-09-02T12:36:53.9084227Z �[0m�[0m�[1m�[31merror�[0m�[1m:�[0m bench failed
2022-09-02T12:36:53.9118903Z ##[error]Process completed with exit code 101."><pre class="notranslate"><code class="notranslate">2022-09-02T12:36:18.3505406Z http_benchmark testing RUST hyper
2022-09-02T12:36:23.3500404Z /home/runner/work/deno/deno/target/release/test_server 4563
2022-09-02T12:36:23.3528614Z hyper hello
2022-09-02T12:36:28.3508025Z /home/runner/work/deno/deno/third_party/prebuilt/linux64/wrk -d 20s --latency http://127.0.0.1:4563/
2022-09-02T12:36:49.4547335Z Running 20s test @ http://127.0.0.1:4563/
2022-09-02T12:36:49.4547829Z 2 threads and 10 connections
2022-09-02T12:36:49.4548514Z Thread Stats Avg Stdev Max +/- Stdev
2022-09-02T12:36:49.4550281Z Latency 121.75us 86.47us 5.10ms 99.49%
2022-09-02T12:36:49.4551042Z Req/Sec 41.93k 3.49k 96.15k 92.52%
2022-09-02T12:36:49.4551335Z Latency Distribution
2022-09-02T12:36:49.4551600Z 50% 119.00us
2022-09-02T12:36:49.4551834Z 75% 122.00us
2022-09-02T12:36:49.4552079Z 90% 128.00us
2022-09-02T12:36:49.4552309Z 99% 143.00us
2022-09-02T12:36:49.4559063Z 1672233 requests in 20.10s, 140.34MB read
2022-09-02T12:36:49.4559465Z Requests/sec: 83196.83
2022-09-02T12:36:49.4559779Z Transfer/sec: 6.98MB
2022-09-02T12:36:49.4560290Z
2022-09-02T12:36:50.0658792Z �[0m�[1m�[31merror�[0m: Uncaught Error: bad
2022-09-02T12:36:50.0659136Z throw Error("bad");
2022-09-02T12:36:50.0659423Z �[0m�[31m ^�[0m
2022-09-02T12:36:50.0659950Z at �[0m�[1m�[3mfoo�[0m (�[0m�[36mfile:///home/runner/work/deno/deno/cli/tests/testdata/error_001.ts�[0m:�[0m�[33m2�[0m:�[0m�[33m9�[0m)
2022-09-02T12:36:50.0660550Z at �[0m�[1m�[3mbar�[0m (�[0m�[36mfile:///home/runner/work/deno/deno/cli/tests/testdata/error_001.ts�[0m:�[0m�[33m6�[0m:�[0m�[33m3�[0m)
2022-09-02T12:36:50.0661297Z at �[0m�[36mfile:///home/runner/work/deno/deno/cli/tests/testdata/error_001.ts�[0m:�[0m�[33m9�[0m:�[0m�[33m1�[0m
2022-09-02T12:36:53.8917223Z thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseFloatError { kind: Invalid }', test_util/src/lib.rs:2209:62
2022-09-02T12:36:53.8918163Z stack backtrace:
2022-09-02T12:36:53.9023567Z 0: 0x55987e602aad - std::backtrace_rs::backtrace::libunwind::trace::h8217d0a8f3fd2f41
2022-09-02T12:36:53.9024317Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
2022-09-02T12:36:53.9025095Z 1: 0x55987e602aad - std::backtrace_rs::backtrace::trace_unsynchronized::h308103876b3af410
2022-09-02T12:36:53.9025705Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2022-09-02T12:36:53.9026431Z 2: 0x55987e602aad - std::sys_common::backtrace::_print_fmt::hc208018c6153605e
2022-09-02T12:36:53.9027016Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:66:5
2022-09-02T12:36:53.9027855Z 3: 0x55987e602aad - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf89a7ed694dfb585
2022-09-02T12:36:53.9028487Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:45:22
2022-09-02T12:36:53.9040223Z 4: 0x55987e62a37c - core::fmt::write::h21038c1382fe4264
2022-09-02T12:36:53.9040737Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/fmt/mod.rs:1197:17
2022-09-02T12:36:53.9041406Z 5: 0x55987e5fc501 - std::io::Write::write_fmt::h7dbb1c9a3c254aef
2022-09-02T12:36:53.9041930Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/io/mod.rs:1672:15
2022-09-02T12:36:53.9042588Z 6: 0x55987e604385 - std::sys_common::backtrace::_print::h4e8889719c9ddeb8
2022-09-02T12:36:53.9043132Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:48:5
2022-09-02T12:36:53.9043807Z 7: 0x55987e604385 - std::sys_common::backtrace::print::h1506fe2cb3022667
2022-09-02T12:36:53.9044350Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:35:9
2022-09-02T12:36:53.9045036Z 8: 0x55987e604385 - std::panicking::default_hook::{{closure}}::hd9d7ce2a8a782440
2022-09-02T12:36:53.9045581Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:295:22
2022-09-02T12:36:53.9046239Z 9: 0x55987e6040a6 - std::panicking::default_hook::h5b16ec25444b1b5d
2022-09-02T12:36:53.9046765Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:314:9
2022-09-02T12:36:53.9047773Z 10: 0x55987e604976 - std::panicking::rust_panic_with_hook::hb0138cb6e6fea3e4
2022-09-02T12:36:53.9048318Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:698:17
2022-09-02T12:36:53.9049018Z 11: 0x55987e604867 - std::panicking::begin_panic_handler::{{closure}}::h4cb67095557cd1aa
2022-09-02T12:36:53.9049566Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:588:13
2022-09-02T12:36:53.9050291Z 12: 0x55987e602f64 - std::sys_common::backtrace::__rust_end_short_backtrace::h2bfcac279dcdc911
2022-09-02T12:36:53.9050873Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:138:18
2022-09-02T12:36:53.9051395Z 13: 0x55987e604599 - rust_begin_unwind
2022-09-02T12:36:53.9051880Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:584:5
2022-09-02T12:36:53.9052558Z 14: 0x55987e628123 - core::panicking::panic_fmt::h1de71520faaa17d3
2022-09-02T12:36:53.9053090Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:142:14
2022-09-02T12:36:53.9053843Z 15: 0x55987e6283d3 - core::result::unwrap_failed::hc0baa33ef8bc7db8
2022-09-02T12:36:53.9054367Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/result.rs:1805:5
2022-09-02T12:36:53.9055019Z 16: 0x55987e6eb61a - core::result::Result<T,E>::unwrap::h7e1240d879443ff1
2022-09-02T12:36:53.9055636Z 17: 0x55987e6f2426 - test_util::parse_strace_output::hebb5546f94939b80
2022-09-02T12:36:53.9056247Z 18: 0x55987e693da9 - deno_bench::main::{{closure}}::hef9d8fe059ae0e73
2022-09-02T12:36:53.9057019Z 19: 0x55987e67ab74 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hbfe5c1a5749c31c1
2022-09-02T12:36:53.9057664Z 20: 0x55987e68cab7 - deno_bench::main::h2a6251fe232b87ef
2022-09-02T12:36:53.9058352Z 21: 0x55987e64c76f - std::sys_common::backtrace::__rust_begin_short_backtrace::h8922240d9524a44b
2022-09-02T12:36:53.9058997Z 22: 0x55987e64d395 - std::rt::lang_start::{{closure}}::h5f5c6fddb32353b1
2022-09-02T12:36:53.9059768Z 23: 0x55987e5f6d6e - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h4937aaa125c8d4b2
2022-09-02T12:36:53.9060369Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/ops/function.rs:280:13
2022-09-02T12:36:53.9061015Z 24: 0x55987e5f6d6e - std::panicking::try::do_call::h6f5c70e8b0a34f92
2022-09-02T12:36:53.9061543Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:492:40
2022-09-02T12:36:53.9062149Z 25: 0x55987e5f6d6e - std::panicking::try::h68766ba264ecf2e2
2022-09-02T12:36:53.9062659Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:456:19
2022-09-02T12:36:53.9063285Z 26: 0x55987e5f6d6e - std::panic::catch_unwind::hc36033d2f9cc04af
2022-09-02T12:36:53.9063798Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panic.rs:137:14
2022-09-02T12:36:53.9064465Z 27: 0x55987e5f6d6e - std::rt::lang_start_internal::{{closure}}::h78c037f4a1a28ded
2022-09-02T12:36:53.9064983Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/rt.rs:128:48
2022-09-02T12:36:53.9065609Z 28: 0x55987e5f6d6e - std::panicking::try::do_call::he6e1fffda4c750ee
2022-09-02T12:36:53.9066137Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:492:40
2022-09-02T12:36:53.9066750Z 29: 0x55987e5f6d6e - std::panicking::try::h48a77ddbb2f4c87a
2022-09-02T12:36:53.9067263Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:456:19
2022-09-02T12:36:53.9067971Z 30: 0x55987e5f6d6e - std::panic::catch_unwind::hfa809b06a550a9e7
2022-09-02T12:36:53.9068481Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panic.rs:137:14
2022-09-02T12:36:53.9069116Z 31: 0x55987e5f6d6e - std::rt::lang_start_internal::h4db69ed48eaca005
2022-09-02T12:36:53.9069626Z at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/rt.rs:128:20
2022-09-02T12:36:53.9070070Z 32: 0x55987e697432 - main
2022-09-02T12:36:53.9070471Z 33: 0x7f2a7b911083 - __libc_start_main
2022-09-02T12:36:53.9070859Z 34: 0x55987e59c5e9 - _start
2022-09-02T12:36:53.9071230Z 35: 0x0 - <unknown>
2022-09-02T12:36:53.9084227Z �[0m�[0m�[1m�[31merror�[0m�[1m:�[0m bench failed
2022-09-02T12:36:53.9118903Z ##[error]Process completed with exit code 101.
</code></pre></div> | <p dir="auto">The benchmarks page shows ~50k ms for the sendfile benchmark but the actual max latency was around 240ms in the CI.</p>
<p dir="auto">It might be related to this float parsing error: <a href="https://github.com/denoland/deno/runs/7954136163?check_suite_focus=true#step:41:159217">https://github.com/denoland/deno/runs/7954136163?check_suite_focus=true#step:41:159217</a></p> | 1 |
<p dir="auto">test case, from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="384635415" data-permission-text="Title is private" data-url="https://github.com/sqlalchemy/sqlalchemy/issues/3583" data-hovercard-type="issue" data-hovercard-url="/sqlalchemy/sqlalchemy/issues/3583/hovercard" href="https://github.com/sqlalchemy/sqlalchemy/issues/3583">#3583</a>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sqlalchemy import *
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import *
Base = declarative_base()
class A(Base):
__tablename__ = "test_a"
id = Column(Integer, primary_key=True)
b_rel = relationship(
"B", collection_class=set, cascade="all, delete-orphan"
)
b = association_proxy("b_rel", "value", creator=lambda x: B(value=x))
class B(Base):
__tablename__ = "test_b"
__table_args__ = (UniqueConstraint("a_id", "value"),)
id = Column(Integer, primary_key=True)
a_id = Column(Integer, ForeignKey("test_a.id"), nullable=False)
value = Column(String)
e = create_engine("sqlite:///:memory:", echo=True)
# e = create_engine('postgresql:///test', echo=True)
Base.metadata.create_all(e)
# e.execute('TRUNCATE test_a, test_b;')
s = Session(e)
a = A()
a.b = {"x", "y", "z"}
s.add(a)
s.commit()
print("\nadding existing element to set")
a.b.add("x")
s.flush()
print("\nassigning same items to set")
a.b = set(a.b)
s.flush()
"><pre class="notranslate"><code class="notranslate">from sqlalchemy import *
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import *
Base = declarative_base()
class A(Base):
__tablename__ = "test_a"
id = Column(Integer, primary_key=True)
b_rel = relationship(
"B", collection_class=set, cascade="all, delete-orphan"
)
b = association_proxy("b_rel", "value", creator=lambda x: B(value=x))
class B(Base):
__tablename__ = "test_b"
__table_args__ = (UniqueConstraint("a_id", "value"),)
id = Column(Integer, primary_key=True)
a_id = Column(Integer, ForeignKey("test_a.id"), nullable=False)
value = Column(String)
e = create_engine("sqlite:///:memory:", echo=True)
# e = create_engine('postgresql:///test', echo=True)
Base.metadata.create_all(e)
# e.execute('TRUNCATE test_a, test_b;')
s = Session(e)
a = A()
a.b = {"x", "y", "z"}
s.add(a)
s.commit()
print("\nadding existing element to set")
a.b.add("x")
s.flush()
print("\nassigning same items to set")
a.b = set(a.b)
s.flush()
</code></pre></div>
<p dir="auto">since this issue was added the association proxy has been highly modified</p>
<p dir="auto"><strong>Migrated issue, originally created by Michael Bayer (<a href="https://github.com/zzzeek">@zzzeek</a>)</strong></p>
<p dir="auto">the "clear" here is clumsy and <a href="we">originally thought was</a> the ultimate cause of the original issue in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="384626979" data-permission-text="Title is private" data-url="https://github.com/sqlalchemy/sqlalchemy/issues/2637" data-hovercard-type="issue" data-hovercard-url="/sqlalchemy/sqlalchemy/issues/2637/hovercard" href="https://github.com/sqlalchemy/sqlalchemy/issues/2637">#2637</a> <a href="but">it's not</a>. Might be nicer if we had a bulk replace built in for those collections, would emit fewer events.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" def __set__(self, obj, values):
if self.owning_class is None:
self.owning_class = type(obj)
if self.scalar:
creator = self.creator and self.creator or self.target_class
target = getattr(obj, self.target_collection)
if target is None:
setattr(obj, self.target_collection, creator(values))
else:
self._scalar_set(target, values)
else:
proxy = self.__get__(obj, None)
if proxy is not values:
proxy.clear()
self._set(proxy, values)"><pre class="notranslate"><code class="notranslate"> def __set__(self, obj, values):
if self.owning_class is None:
self.owning_class = type(obj)
if self.scalar:
creator = self.creator and self.creator or self.target_class
target = getattr(obj, self.target_collection)
if target is None:
setattr(obj, self.target_collection, creator(values))
else:
self._scalar_set(target, values)
else:
proxy = self.__get__(obj, None)
if proxy is not values:
proxy.clear()
self._set(proxy, values)
</code></pre></div> | <p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">After executing <code class="notranslate">table.tometadata(metadata)</code>, the new table's new column's <code class="notranslate">info</code> dictionaries are references to the original columns' dictionaries instead of a copy of the dictionary.</p>
<p dir="auto">If this is by design for some reason, no hard feelings, close ticket, but seems bad design to me to have the new instances of the columns referencing the original columns' <code class="notranslate">info</code> dictionaries.</p> | 0 |
<p dir="auto">Make sure these boxes are checked 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" checked=""> I have checked the superset logs for python stacktraces and included it here as text if any</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> 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" checked=""> I have checked the issue tracker for the same issue and I haven't found one similar</li>
</ul>
<h3 dir="auto">Superset version</h3>
<p dir="auto">Superset 0.19.1</p>
<h3 dir="auto">Expected results</h3>
<p dir="auto">A normal Time Series - Line Chart.<br>
Like this<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/35057951b148fe15434330b09f7ffea7f3468de21e1c199022acc758fa75a929/68747470733a2f2f7773342e73696e61696d672e636e2f6c617267652f303036744e633739677931666a6335316c6a7977616a33316b77306f353764612e6a7067"><img src="https://camo.githubusercontent.com/35057951b148fe15434330b09f7ffea7f3468de21e1c199022acc758fa75a929/68747470733a2f2f7773342e73696e61696d672e636e2f6c617267652f303036744e633739677931666a6335316c6a7977616a33316b77306f353764612e6a7067" alt="" data-canonical-src="https://ws4.sinaimg.cn/large/006tNc79gy1fjc51ljywaj31kw0o57da.jpg" style="max-width: 100%;"></a></p>
<h3 dir="auto">Actual results</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/dc97b01b3b5d8bc4d0638877127646179cfec8b2a815d60a50d732cacacefb81/68747470733a2f2f7773322e73696e61696d672e636e2f6c617267652f303036744e633739677931666a6335326c39326b656a33316b77306d6e3432322e6a7067"><img src="https://camo.githubusercontent.com/dc97b01b3b5d8bc4d0638877127646179cfec8b2a815d60a50d732cacacefb81/68747470733a2f2f7773322e73696e61696d672e636e2f6c617267652f303036744e633739677931666a6335326c39326b656a33316b77306d6e3432322e6a7067" alt="" data-canonical-src="https://ws2.sinaimg.cn/large/006tNc79gy1fjc52l92kej31kw0mn422.jpg" style="max-width: 100%;"></a></p>
<h3 dir="auto">Steps to reproduce</h3>
<ol dir="auto">
<li>I have a dimension have 'NULL'. What I mean is not all row have value.</li>
<li>Use this dimension as Group By.</li>
<li>Query.</li>
</ol>
<h3 dir="auto">More</h3>
<p dir="auto">I add a Filters into this form. The Filters is same dimension is 'event_name', relation is '!=', <strong>but the value I did not input anything.</strong></p>
<p dir="auto">Then, I can see the expected results.</p>
<p dir="auto">I guess the reason is that default fill 0 into NULL, but my dimension is TEXT. Then occur <code class="notranslate">unorderable types: str() > int()</code>.</p>
<p dir="auto">And this is similar issue.<br>
<a href="https://github.com/apache/incubator-superset/issues/3029" data-hovercard-type="issue" data-hovercard-url="/apache/superset/issues/3029/hovercard">#3029</a></p> | <p dir="auto">Make sure these boxes are checked 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 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">Superset version</h3>
<h3 dir="auto"></h3>
<p dir="auto">I installed the superset on one server(redhat os ) and connecting to redshift to perform a query.<br>
I superseded that superset server might be slow when several users connect and use ...<br>
Is there a way to install superset on multiple servers and load balancing when users connect?</p> | 0 |
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/peterneubauer/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/peterneubauer">@peterneubauer</a>: 'Probably that is not right, especially if we are expecting nodes coming back in the batch API, see <a href="https://groups.google.com/forum/?fromgroups=#!topic/neo4j/KYQo5LIVoQg" rel="nofollow">https://groups.google.com/forum/?fromgroups=#!topic/neo4j/KYQo5LIVoQg</a> fro details'</p> | <p dir="auto">Sorry for the long title, feel free to rename :)</p>
<p dir="auto">The <a href="https://neo4j.com/guides/upgrade/" rel="nofollow">upgrade docs for 3.3</a> state that <code class="notranslate">3.0.any</code> -> <code class="notranslate">3.3.1</code> is a supported path, but mentions no caveats. Additionally, the <a href="https://neo4j.com/guides/upgrade/" rel="nofollow">3.3 Upgrade FAQ</a> says upgrading any <code class="notranslate">3.x version will be very straightforward</code>, with no mention of caveats.</p>
<p dir="auto">However, I was unable to upgrade from 3.0.4 to 3.3.1 using the following steps and received several error messages, none of which were indicative of the underlying problem.</p>
<p dir="auto">These steps were executed within a docker environment, using the <code class="notranslate">3.0.4-enterprise</code> tag and the <code class="notranslate">3.3.1-enterprise</code> tag.</p>
<p dir="auto"><strong>Steps to reproduce</strong></p>
<ol dir="auto">
<li>In a fresh 3.0.4 enterprise container, insert some data and take a supported, online backup using <a href="https://neo4j.com/docs/operations-manual/3.0/backup/perform-backup/" rel="nofollow">these instructions</a>.</li>
<li>Duplicate that backup into 3 directories.</li>
<li>Start a causal cluster of 3 nodes, mounting the directories in step 2 into <code class="notranslate">/data</code> of each container</li>
<li>Wait for cluster members to acknowledge eachother.</li>
</ol>
<p dir="auto"><strong>Expected behavior</strong><br>
Neo4j upgrades database and runs as a causal cluster</p>
<p dir="auto"><strong>Actual behavior</strong><br>
The database fails startup with the following error message:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="...
Caused by: org.neo4j.kernel.impl.storemigration.StoreUpgrader$DatabaseNotCleanlyShutDownException: The database is not cleanly shutdown. The database needs recovery, in order to recover the database, please run the old version of the database on this store.
at org.neo4j.kernel.impl.storemigration.UpgradableDatabase.checkUpgradeable(UpgradableDatabase.java:124)
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.migrateIfNeeded(StoreUpgrader.java:132)
at org.neo4j.kernel.impl.storemigration.DatabaseMigrator.migrate(DatabaseMigrator.java:101)
at org.neo4j.kernel.NeoStoreDataSource.upgradeStore(NeoStoreDataSource.java:573)
at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:435)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)"><pre class="notranslate"><code class="notranslate">...
Caused by: org.neo4j.kernel.impl.storemigration.StoreUpgrader$DatabaseNotCleanlyShutDownException: The database is not cleanly shutdown. The database needs recovery, in order to recover the database, please run the old version of the database on this store.
at org.neo4j.kernel.impl.storemigration.UpgradableDatabase.checkUpgradeable(UpgradableDatabase.java:124)
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.migrateIfNeeded(StoreUpgrader.java:132)
at org.neo4j.kernel.impl.storemigration.DatabaseMigrator.migrate(DatabaseMigrator.java:101)
at org.neo4j.kernel.NeoStoreDataSource.upgradeStore(NeoStoreDataSource.java:573)
at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:435)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:445)
</code></pre></div>
<p dir="auto">Sometimes, and I wasn't able to isolate the conditions, the error message would instead be something like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@f88bfbe' was successfully initialized, but failed to start. Please see the attached cause exception "Unable to find transaction 23289 in any of my logical logs: Couldn't find any log containing 23289". Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@f88bfbe' was successfully initialized, but failed to start. Please see the attached cause exception "Unable to find transaction 23289 in any of my logical logs: Couldn't find any log containing 23289".
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@f88bfbe' was successfully initialized, but failed to start. Please see the attached cause exception "Unable to find transaction 23289 in any of my logical logs: Couldn't find any log containing 23289"."><pre class="notranslate"><code class="notranslate">ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@f88bfbe' was successfully initialized, but failed to start. Please see the attached cause exception "Unable to find transaction 23289 in any of my logical logs: Couldn't find any log containing 23289". Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@f88bfbe' was successfully initialized, but failed to start. Please see the attached cause exception "Unable to find transaction 23289 in any of my logical logs: Couldn't find any log containing 23289".
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@f88bfbe' was successfully initialized, but failed to start. Please see the attached cause exception "Unable to find transaction 23289 in any of my logical logs: Couldn't find any log containing 23289".
</code></pre></div>
<p dir="auto">I was able to start up the causal cluster as expected without the volume mount.</p>
<p dir="auto"><strong>Fix/Workaround</strong><br>
I was able to successfully start the causal cluster if I first upgraded the 3.0.4 backup by starting a 3.3.1 node in single instance mode and letting it perform the upgrade, then using that upgraded DB as the seed for the causal cluster.</p>
<p dir="auto">It seem like that step could be an acceptable upgrade path, but it should be well documented, and perhaps a descriptive error message should be added in the next patch release.</p> | 0 |
<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 a description of the new feature</h2>
<p dir="auto">I would love to have <em>Keyboard Manager</em> to feature keyboard macros.</p> | <h2 dir="auto">Keyboard Manager should allow mapping complex keyboard events in <code class="notranslate">Key</code> and <code class="notranslate">Mapped To</code> parameters</h2>
<p dir="auto">Currently, the keyboard manager allows for remapping of simple keyboard events, such as single key-down, to a different keyboard event, which may include multiple modifiers (<code class="notranslate">Ctrl</code>, <code class="notranslate">Shift</code>, <code class="notranslate">Alt</code>). It would be a benefit to allow input parameters to be complex keyboard events including modifiers (<code class="notranslate">Ctrl</code>), multiple key events (holding down <code class="notranslate">Shift (Left)</code> and <code class="notranslate">Shift (Right)</code>), and key-up events (mapping <code class="notranslate">Ctrl (Left)</code> to be <code class="notranslate">Ctrl</code> on key-down and <code class="notranslate">Esc</code> on key-up).</p>
<p dir="auto">The specific use-case I want to see is to replicate an AutoHotKey script that modifies the <code class="notranslate">Caps Lock</code> to <code class="notranslate">Ctrl</code> when pressed with another key, so <code class="notranslate">Caps Lock - V</code> would send<code class="notranslate">Ctrl - V</code>, but to send <code class="notranslate">Esc</code> on key-up if no other key is pressed. Additionally, the script also maps <code class="notranslate">Shift (Left)</code> and <code class="notranslate">Shift (Right)</code> combo to send <code class="notranslate">Caps Lock</code>.</p>
<hr>
<p dir="auto">If you'd like to see this feature implemented, add a <g-emoji class="g-emoji" alias="+1" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png">👍</g-emoji> reaction to this post.</p> | 1 |
<p dir="auto">What is the way to translate document title in angular 2.<br>
I can change document title with <code class="notranslate">Title</code> service but how can I translate it?<br>
Angular 2 supports translations only in component templates with <code class="notranslate">i18n</code> directive. I cannot use it in <code class="notranslate">head</code> of html document because it is outside of angular compiler scope.</p> | <blockquote>
<p dir="auto">[email protected] start E:\portal\ng2-webpack-aot<br>
webpack-dev-server --progress --inline --hot</p>
</blockquote>
<p dir="auto">keywords if/then/else require v5 option<br>
10% building modules 3/3 modules 0 active <a href="http://127.0.0.1:8010/" rel="nofollow">http://127.0.0.1:8010/</a><br>
webpack result is served from <a href="http://127.0.0.1:8010/" rel="nofollow">http://127.0.0.1:8010/</a><br>
404s will fallback to /index.html<br>
chunk {0} 0.chunk.js 4.55 kB {2} [rendered]<br>
chunk {1} 1.chunk.js 4.55 kB {2} [rendered]<br>
chunk {2} app.js, app.css (app) 2.7 MB {3} [initial] [rendered]<br>
chunk {3} vendor.js (vendor) 67 bytes {4} [initial] [rendered]<br>
chunk {4} polyfills.js (polyfills) 496 kB [entry] [rendered]</p>
<p dir="auto">WARNING in ./~/.2.4.1@@angular/core/src/linker/system_js_ng_module_factory_loader.js<br>
69:15 Critical dependency: the request of a dependency is an expression</p>
<p dir="auto">WARNING in ./~/.2.4.1@@angular/core/src/linker/system_js_ng_module_factory_loader.js<br>
85:15 Critical dependency: the request of a dependency is an expression</p>
<p dir="auto">ERROR in [default] E:\portal\ng2-webpack-aot\node_modules.0.5.0@<a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/types/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/types">@types</a>\source-map\index.d.ts:7:20<br>
Duplicate identifier 'sourceMap'.</p>
<p dir="auto">ERROR in [default] E:\portal\ng2-webpack-aot\node_modules@types\source-map\index.d.ts:7:20<br>
Duplicate identifier 'sourceMap'.<br>
Child html-webpack-plugin for "index.html":<br>
chunk {0} index.html 304 bytes [entry] [rendered]<br>
Child extract-text-webpack-plugin:<br>
chunk {0} extract-text-webpack-plugin-output-filename 1.73 kB [entry] [rendered]<br>
webpack: bundle is now VALID.</p>
<p dir="auto">package.json</p>
<p dir="auto">{<br>
"name": "ng2-quickstart",<br>
"description": "angular2 quickstart project",<br>
"version": "1.0.1",<br>
"scripts": {<br>
"serverstart":"npm run build && npm run serve",<br>
"serve": "http-server ./dist -a 0.0.0.0 -p 9000",<br>
"prestart": "cross-env NODE_ENV=dev",<br>
"start": "webpack-dev-server --progress --inline --hot",<br>
"prebuild": "rimraf dist",<br>
"build": "cross-env NODE_ENV=prod webpack --progress"<br>
},<br>
"dependencies": {<br>
"@angular/common": "2.4.1",<br>
"@angular/compiler": "2.4.1",<br>
"@angular/core": "2.4.1",<br>
"@angular/forms": "2.4.1",<br>
"@angular/http": "2.4.1",<br>
"@angular/platform-browser": "2.4.1",<br>
"@angular/platform-browser-dynamic": "2.4.1",<br>
"@angular/router": "3.4.1",<br>
"angular2-cookie": "1.2.6",<br>
"core-js": "2.4.1",<br>
"rxjs": "5.0.1",<br>
"zone.js": "0.7.4"<br>
},<br>
"devDependencies": {<br>
"@angularclass/hmr": "1.2.2",<br>
"@angularclass/hmr-loader": "3.0.2",<br>
"angular2-router-loader": "0.3.4",<br>
"@angular/compiler-cli": "2.4.1",<br>
"@angular/platform-server": "2.4.1",<br>
"@ngtools/webpack": "1.2.1",<br>
"@types/core-js": "0.9.35",<br>
"@types/jasmine": "2.5.40",<br>
"@types/node": "6.0.40",<br>
"@types/webpack": "1.12.35",<br>
"reflect-metadata": "0.1.9",<br>
"angular2-template-loader": "0.4.0",<br>
"awesome-typescript-loader": "2.2.4",<br>
"cross-env": "3.1.3",<br>
"css-loader": "0.25.0",<br>
"extract-text-webpack-plugin": "2.0.0-beta.3",<br>
"file-loader": "0.8.5",<br>
"html-loader": "0.4.4",<br>
"html-webpack-plugin": "2.15.0",<br>
"node-sass": "3.13.1",<br>
"raw-loader": "0.5.1",<br>
"postcss-loader": "0.11.1",<br>
"resolve-url-loader": "1.6.0",<br>
"rimraf": "2.5.2",<br>
"style-loader": "0.13.1",<br>
"ts-loader": "0.8.1",<br>
"typescript": "2.0.3",<br>
"webpack": "2.1.0-beta.26",<br>
"webpack-dev-server": "2.1.0-beta.10",<br>
"webpack-merge": "0.14.0"<br>
}<br>
}</p>
<p dir="auto">tsconfig.json</p>
<p dir="auto">{<br>
"compilerOptions": {<br>
"target": "es5",<br>
"module": "commonjs",<br>
"moduleResolution": "node",<br>
"sourceMap": false,<br>
"emitDecoratorMetadata": true,<br>
"experimentalDecorators": true,<br>
"removeComments": true,<br>
"noImplicitAny": true,<br>
"suppressImplicitAnyIndexErrors": true,<br>
"typeRoots": [<br>
"node_modules/<a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/types/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/types">@types</a>"<br>
]<br>
},<br>
"exclude": [<br>
"node_modules",<br>
"dist"<br>
],<br>
"angularCompilerOptions": {<br>
"skipMetadataEmit": true,<br>
"genDir": "./ngFactory"<br>
}<br>
}</p> | 0 |
<p dir="auto"><code class="notranslate">issubset(x, y)</code> is incredibly slow with vectors of strings compared with the equivalent <code class="notranslate">isempty(setdiff(x, y))</code>. This is because it uses <code class="notranslate">elt in y</code> rather than building a dictionary/set. Of course, <code class="notranslate">issubset</code> can be made even faster than <code class="notranslate">setdiff</code> when the result is <code class="notranslate">false</code> due to the possibility to short-circuit when encountering an element which does not appear in <code class="notranslate">y</code>.</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia> x = [@sprintf("id%010d", k) for k in 1:9999];
julia> y = [@sprintf("id%010d", k) for k in 1:10000];
julia> @time issubset(x, y)
0.388715 seconds (10.00 k allocations: 156.391 KiB)
true
julia> @time isempty(setdiff(x, y))
0.004538 seconds (17 allocations: 145.383 KiB)
true"><pre class="notranslate">julia<span class="pl-k">></span> x <span class="pl-k">=</span> [<span class="pl-c1">@sprintf</span>(<span class="pl-s"><span class="pl-pds">"</span>id%010d<span class="pl-pds">"</span></span>, k) <span class="pl-k">for</span> k <span class="pl-k">in</span> <span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">9999</span>];
julia<span class="pl-k">></span> y <span class="pl-k">=</span> [<span class="pl-c1">@sprintf</span>(<span class="pl-s"><span class="pl-pds">"</span>id%010d<span class="pl-pds">"</span></span>, k) <span class="pl-k">for</span> k <span class="pl-k">in</span> <span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">10000</span>];
julia<span class="pl-k">></span> <span class="pl-c1">@time</span> <span class="pl-c1">issubset</span>(x, y)
<span class="pl-c1">0.388715</span> seconds (<span class="pl-c1">10.00</span> k allocations<span class="pl-k">:</span> <span class="pl-c1">156.391</span> KiB)
<span class="pl-c1">true</span>
julia<span class="pl-k">></span> <span class="pl-c1">@time</span> <span class="pl-c1">isempty</span>(<span class="pl-c1">setdiff</span>(x, y))
<span class="pl-c1">0.004538</span> seconds (<span class="pl-c1">17</span> allocations<span class="pl-k">:</span> <span class="pl-c1">145.383</span> KiB)
<span class="pl-c1">true</span></pre></div> | <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="g = [1:10_000_000;]
m = sample(1:1_000_000, 40_000, replace=false)
@time z = intersect(g,m);
196.291597 seconds (20 allocations: 1.001 MB)"><pre class="notranslate"><code class="notranslate">g = [1:10_000_000;]
m = sample(1:1_000_000, 40_000, replace=false)
@time z = intersect(g,m);
196.291597 seconds (20 allocations: 1.001 MB)
</code></pre></div>
<p dir="auto">Here are two alternate intersections. <del>The latter (isect2) does not preserve</del> neither preserves order.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function isect(g,m)
is = []
for i in m
if i in g
push!(is,i)
end
end
return is
end
@time y = isect(g,m);
12.880327 seconds (40.00 k allocations: 1.611 MB)
function isect2(g,m)
is = []
gset = Set(g)
for i in m
if i in gset
push!(is,i)
end
end
return is
end
@time x = isect2(g,m);
1.430506 seconds (42.75 k allocations: 145.737 MB)
Set(z) == Set(y) == Set(x)
true"><pre class="notranslate"><code class="notranslate">function isect(g,m)
is = []
for i in m
if i in g
push!(is,i)
end
end
return is
end
@time y = isect(g,m);
12.880327 seconds (40.00 k allocations: 1.611 MB)
function isect2(g,m)
is = []
gset = Set(g)
for i in m
if i in gset
push!(is,i)
end
end
return is
end
@time x = isect2(g,m);
1.430506 seconds (42.75 k allocations: 145.737 MB)
Set(z) == Set(y) == Set(x)
true
</code></pre></div> | 1 |
<p dir="auto">Choose one: is this a bug report or feature request? Bug report.</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="callee(castee: CastTo)"><pre class="notranslate"><span class="pl-en">callee</span><span class="pl-kos">(</span><span class="pl-s1">castee</span>: <span class="pl-v">CastTo</span><span class="pl-kos">)</span></pre></div>
<h3 dir="auto">Babel Configuration (.babelrc, package.json, cli command)</h3>
<p dir="auto">Babylon with <code class="notranslate">flow</code> plugin enabled. Appears to affect both Babylon 6 and 7.</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Both the Flow docs (<a href="https://flow.org/en/docs/types/casting/" rel="nofollow">https://flow.org/en/docs/types/casting/</a>) and the Flow parser flag this as a parse error.<br>
The Flow parser says <code class="notranslate">Unexpected token :</code> at line 1, column 13</p>
<p dir="auto">It should be necessary to wrap type casts in explicit <code class="notranslate">( )</code>, so e.g. <code class="notranslate">callee((castee: CastTo))</code>.</p>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">Parses successfully leaving an AST like</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ExprStmt( CallExpression( callee, TypeCastExpression( castee, CastTo ) ) )"><pre class="notranslate"><code class="notranslate">ExprStmt( CallExpression( callee, TypeCastExpression( castee, CastTo ) ) )
</code></pre></div>
<h3 dir="auto">Possible Solution</h3>
<p dir="auto">I am working on a patch here: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/wcjohnson/babylon-lightscript/commit/322842abe7b9fd0ece731eaa2238edeaaa315876/hovercard" href="https://github.com/wcjohnson/babylon-lightscript/commit/322842abe7b9fd0ece731eaa2238edeaaa315876">wcjohnson/babylon-lightscript@<tt>322842a</tt></a></p>
<p dir="auto">The patch is against a heavily modified Babylon but may be useful nonetheless.</p>
<p dir="auto">The basic idea is to parse as <code class="notranslate">TypeCastish</code> and then convert back to <code class="notranslate">TypeCastExpression</code> only during <code class="notranslate">parseParenAndDistinguishExpression</code>. Any time a <code class="notranslate">TypeCastish</code> is seen outside of there, throw an unexpected type cast error.</p>
<h3 dir="auto">Context</h3>
<p dir="auto">I work on the LightScript language, which uses a fork of Babylon as its parser. The LightScript issue that led to this issue is here: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="254408615" data-permission-text="Title is private" data-url="https://github.com/wcjohnson/lightscript/issues/22" data-hovercard-type="issue" data-hovercard-url="/wcjohnson/lightscript/issues/22/hovercard" href="https://github.com/wcjohnson/lightscript/issues/22">wcjohnson/lightscript#22</a></p>
<h3 dir="auto">Your Environment</h3>
<table role="table">
<thead>
<tr>
<th>software</th>
<th>version(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Babylon</td>
<td>approximately 6.16.0</td>
</tr>
<tr>
<td>node</td>
<td>6</td>
</tr>
<tr>
<td>npm</td>
<td>5</td>
</tr>
<tr>
<td>Operating System</td>
<td>OS X</td>
</tr>
</tbody>
</table> | <h3 dir="auto">Input Code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="state.set('foo': bar)"><pre class="notranslate"><span class="pl-s1">state</span><span class="pl-kos">.</span><span class="pl-en">set</span><span class="pl-kos">(</span><span class="pl-s">'foo'</span>: <span class="pl-s1">bar</span><span class="pl-kos">)</span></pre></div>
<h3 dir="auto">Babylon/Babel Configuration</h3>
<p dir="auto">Flow syntax plugin enabled</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Should be a syntax error</p>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">We're currently parsing <code class="notranslate">bar</code> as a TypeCastExpression w/ a value of <code class="notranslate">foo</code>. Flow requires that you wrap a TypeCastExpression in parens, and we're allowing the parens for the CallExpression to be used right now, which the Flow parser does <em>not</em> allow.</p>
<p dir="auto">Context: <a href="https://twitter.com/schep_/status/841741581589860355" rel="nofollow">https://twitter.com/schep_/status/841741581589860355</a></p> | 1 |
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=gackir" rel="nofollow">Robert Gacki</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9635?redirect=false" rel="nofollow">SPR-9635</a></strong> and commented</p>
<p dir="auto">Lets say I have an annotated handler method:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@RequestMapping
public @ResponseBody FooResponse doFoo(@RequestBody FooRequest) {
}"><pre class="notranslate"><code class="notranslate">@RequestMapping
public @ResponseBody FooResponse doFoo(@RequestBody FooRequest) {
}
</code></pre></div>
<p dir="auto">And I have HttpMessageConverters that can convert various formats like XML and JSON by looking at the format extension of the MediaType's subtype. In the example, this would be:</p>
<ul dir="auto">
<li><code class="notranslate">application/vnd.foo-request+xml</code> and <code class="notranslate">application/vnd.foo-response+xml</code> for converting from and to XML</li>
<li><code class="notranslate">application/vnd.foo-request+json</code> and <code class="notranslate">application/vnd.foo-response+json</code> for converting from and to XML</li>
</ul>
<p dir="auto">I do not want to pollute my handler methods with the format because the format handling is delegated to the HttpMessageConverters:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@RequestMapping(consumes = "application/vnd.foo-request", produces = "application/vnd.foo-response")
public @ResponseBody FooResponse doFoo(@RequestBody FooRequest) {
}"><pre class="notranslate"><code class="notranslate">@RequestMapping(consumes = "application/vnd.foo-request", produces = "application/vnd.foo-response")
public @ResponseBody FooResponse doFoo(@RequestBody FooRequest) {
}
</code></pre></div>
<p dir="auto">The MediaType classes' include method does not allow this scenario. It checks whether the subtype without the suffix is a wildcard and therefore matching: <code class="notranslate">application/*+xml includes application/vnd.foo-response+xml</code>.</p>
<p dir="auto">But it does not check the generalization: <code class="notranslate">application/vnd.foo-response includes application/vnd.foo-response+xml</code> or <code class="notranslate">application/soap includes application/vnd.foo-response+json</code>.</p>
<p dir="auto">So my method, that does not want to know how about the RequestBody's / ResponseBody's serialized format, can not be found by the HandlerMapping (RequestMappingHandlerMapping).</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1.1</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="398109795" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12560" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12560/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12560">#12560</a> MappingJacksonHttpMessageConverter default media type should include *+json (<em><strong>"duplicates"</strong></em>)</li>
</ul> | <p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=victorwon" rel="nofollow">Victor</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-843?redirect=false" rel="nofollow">SPR-843</a></strong> and commented</p>
<p dir="auto">In SchedulerFactoryBean class, the following method is intended to create a scheduler using the schedulerName param:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="protected Scheduler createScheduler(SchedulerFactory schedulerFactory, String schedulerName)
throws SchedulerException {
if (schedulerName != null) {
return schedulerFactory.getScheduler(schedulerName);
}
else {
return schedulerFactory.getScheduler();
}
}"><pre class="notranslate"><code class="notranslate">protected Scheduler createScheduler(SchedulerFactory schedulerFactory, String schedulerName)
throws SchedulerException {
if (schedulerName != null) {
return schedulerFactory.getScheduler(schedulerName);
}
else {
return schedulerFactory.getScheduler();
}
}
</code></pre></div>
<p dir="auto">This, however, doesn't work because the "schedulerFactory.getScheduler(schedulerName)" in quartz is used to retrieve an exisiting instance instead of creating anything new. The result is you always got a NullPointerException if you set the schedulerName in bean config xml.</p>
<p dir="auto">The quick fix is to change it to be as following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="protected Scheduler createScheduler(SchedulerFactory schedulerFactory, String schedulerName)
throws SchedulerException {
return schedulerFactory.getScheduler();
}"><pre class="notranslate"><code class="notranslate">protected Scheduler createScheduler(SchedulerFactory schedulerFactory, String schedulerName)
throws SchedulerException {
return schedulerFactory.getScheduler();
}
</code></pre></div>
<p dir="auto">And specify the schedulerName and quartz instance name in the quartz properties, e.g.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<property name="schedulerName">
<value>cronSched</value>
</property>
<property name="quartzProperties">
<props>
<prop key="org.quartz.scheduler.instanceName">cronSched</prop>
</props>
</property>"><pre class="notranslate"><code class="notranslate"><property name="schedulerName">
<value>cronSched</value>
</property>
<property name="quartzProperties">
<props>
<prop key="org.quartz.scheduler.instanceName">cronSched</prop>
</props>
</property>
</code></pre></div>
<p dir="auto">There must be more elegant solution for this ;)</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 1.1.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="398055493" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/5499" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/5499/hovercard" href="https://github.com/spring-projects/spring-framework/issues/5499">#5499</a> Multiple schedulers (<em><strong>"duplicates"</strong></em>)</li>
</ul> | 0 |
<p dir="auto">Consider the following example:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const PairUnion = Union{Pair{Int,Int8},Pair{Int,UInt8}}
array = PairUnion[1=>0x2]
function pair1(a)
x, y = a[1]
x => y
end
function pair2(a)
xy = a[1]
x = xy.first
y = xy.second
x => y
end
function pair3(a)
xy = a[1]
x = first(xy)
y = last(xy)
x => y
end"><pre class="notranslate"><span class="pl-k">const</span> PairUnion <span class="pl-k">=</span> Union{Pair{Int,Int8},Pair{Int,UInt8}}
array <span class="pl-k">=</span> PairUnion[<span class="pl-c1">1</span><span class="pl-k">=></span><span class="pl-c1">0x2</span>]
<span class="pl-k">function</span> <span class="pl-en">pair1</span>(a)
x, y <span class="pl-k">=</span> a[<span class="pl-c1">1</span>]
x <span class="pl-k">=></span> y
<span class="pl-k">end</span>
<span class="pl-k">function</span> <span class="pl-en">pair2</span>(a)
xy <span class="pl-k">=</span> a[<span class="pl-c1">1</span>]
x <span class="pl-k">=</span> xy<span class="pl-k">.</span>first
y <span class="pl-k">=</span> xy<span class="pl-k">.</span>second
x <span class="pl-k">=></span> y
<span class="pl-k">end</span>
<span class="pl-k">function</span> <span class="pl-en">pair3</span>(a)
xy <span class="pl-k">=</span> a[<span class="pl-c1">1</span>]
x <span class="pl-k">=</span> <span class="pl-c1">first</span>(xy)
y <span class="pl-k">=</span> <span class="pl-c1">last</span>(xy)
x <span class="pl-k">=></span> y
<span class="pl-k">end</span></pre></div>
<p dir="auto">Then:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia> @btime pair1($array)
73.935 ns (1 allocation: 32 bytes)
1 => 0x02
julia> @btime pair2($array)
76.299 ns (1 allocation: 32 bytes)
1 => 0x02
julia> @btime pair3($array)
5.051 ns (0 allocations: 0 bytes)
1 => 0x02"><pre class="notranslate">julia<span class="pl-k">></span> <span class="pl-c1">@btime</span> <span class="pl-c1">pair1</span>(<span class="pl-k">$</span>array)
<span class="pl-c1">73.935</span> ns (<span class="pl-c1">1</span> allocation<span class="pl-k">:</span> <span class="pl-c1">32</span> bytes)
<span class="pl-c1">1</span> <span class="pl-k">=></span> <span class="pl-c1">0x02</span>
julia<span class="pl-k">></span> <span class="pl-c1">@btime</span> <span class="pl-c1">pair2</span>(<span class="pl-k">$</span>array)
<span class="pl-c1">76.299</span> ns (<span class="pl-c1">1</span> allocation<span class="pl-k">:</span> <span class="pl-c1">32</span> bytes)
<span class="pl-c1">1</span> <span class="pl-k">=></span> <span class="pl-c1">0x02</span>
julia<span class="pl-k">></span> <span class="pl-c1">@btime</span> <span class="pl-c1">pair3</span>(<span class="pl-k">$</span>array)
<span class="pl-c1">5.051</span> ns (<span class="pl-c1">0</span> allocations<span class="pl-k">:</span> <span class="pl-c1">0</span> bytes)
<span class="pl-c1">1</span> <span class="pl-k">=></span> <span class="pl-c1">0x02</span></pre></div>
<p dir="auto">When looking at <code class="notranslate">@code_warntype</code>, it looks like <code class="notranslate">x</code> and <code class="notranslate">y</code> are inferred to be <code class="notranslate">Union{Int,Int8,UInt8}</code> for <code class="notranslate">pair1</code> and <code class="notranslate">pair2</code>, while in <code class="notranslate">pair3</code> they are inferred as <code class="notranslate">Int</code> and <code class="notranslate">Union{Int8,UInt8}</code> as expected.</p> | <div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia> a = ("foo" => "bar", "baz" => nothing);
julia> function f(a, i)
y = iterate(a, i)
if y !== nothing
(k, v), st = y
return k, v
end
return y
end
julia> @code_warntype f(a, 1)"><pre class="notranslate">julia<span class="pl-k">></span> a <span class="pl-k">=</span> (<span class="pl-s"><span class="pl-pds">"</span>foo<span class="pl-pds">"</span></span> <span class="pl-k">=></span> <span class="pl-s"><span class="pl-pds">"</span>bar<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>baz<span class="pl-pds">"</span></span> <span class="pl-k">=></span> <span class="pl-c1">nothing</span>);
julia<span class="pl-k">></span> <span class="pl-k">function</span> <span class="pl-en">f</span>(a, i)
y <span class="pl-k">=</span> <span class="pl-c1">iterate</span>(a, i)
<span class="pl-k">if</span> y <span class="pl-k">!==</span> <span class="pl-c1">nothing</span>
(k, v), st <span class="pl-k">=</span> y
<span class="pl-k">return</span> k, v
<span class="pl-k">end</span>
<span class="pl-k">return</span> y
<span class="pl-k">end</span>
julia<span class="pl-k">></span> <span class="pl-c1">@code_warntype</span> <span class="pl-c1">f</span>(a, <span class="pl-c1">1</span>)</pre></div>
<p dir="auto">infers to <code class="notranslate">Union{Nothing, Tuple{Union{Nothing, String},Union{Nothing, String}}}</code> In particular, <code class="notranslate">k</code> is inferred as <code class="notranslate"> k::Union{Nothing, String}</code> but it could maybe be inferrable as a <code class="notranslate">String</code>.</p> | 1 |
<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>
<tr>
<td>Symfony version</td>
<td>any</td>
</tr>
</tbody>
</table>
<p dir="auto">Real case scenario: I want to pass an extra parameter to a route (see <a href="http://symfony.com/doc/current/routing.html#generating-urls-with-query-strings" rel="nofollow">docs</a>), and the value of such parameter is an object. The typical example is a <code class="notranslate">Uuid</code> object (e.g. Ramsey\Uuid).<br>
Problem is that PHP is not smart enough and it does not cast objects to string. See <a href="https://bugs.php.net/bug.php?id=66966" rel="nofollow">related bug on php.net</a>.<br>
Of couse, such feature could be easily obtained in a typical plain PHP context, since it's very easy to cast your object to a string.<br>
In a typical Symfony context, instead, you can't easily cast strings, unless doing ugly things.</p>
<p dir="auto">Example of not working code:</p>
<div class="highlight highlight-text-html-twig notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{# generated URL has no query string #}
<a href="{{ path('my_route', {foo: object.uuid}) }}">my link</a>"><pre class="notranslate"><span class="pl-c"><span class="pl-c">{#</span> generated URL has no query string <span class="pl-c">#}</span></span>
<<span class="pl-ent">a</span> <span class="pl-e">href</span>=<span class="pl-s"><span class="pl-pds">"</span>{{ path(<span class="pl-s"><span class="pl-pds">'</span>my_route<span class="pl-pds">'</span></span>, {<span class="pl-smi">foo</span>: <span class="pl-smi">object</span>.<span class="pl-smi">uuid</span>}) }}<span class="pl-pds">"</span></span>>my link</<span class="pl-ent">a</span>></pre></div>
<p dir="auto">Example of working code, with ugly workaround:</p>
<div class="highlight highlight-text-html-twig notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{# generated URL has expected query string, e.g. ?foo=7ecff38e-4145-11e8-80b9-0242ac140004 #}
<a href="{{ path('my_route', {foo: object.uuid.__toString}) }}">my link</a>"><pre class="notranslate"><span class="pl-c"><span class="pl-c">{#</span> generated URL has expected query string, e.g. ?foo=7ecff38e-4145-11e8-80b9-0242ac140004 <span class="pl-c">#}</span></span>
<<span class="pl-ent">a</span> <span class="pl-e">href</span>=<span class="pl-s"><span class="pl-pds">"</span>{{ path(<span class="pl-s"><span class="pl-pds">'</span>my_route<span class="pl-pds">'</span></span>, {<span class="pl-smi">foo</span>: <span class="pl-smi">object</span>.<span class="pl-smi">uuid</span>.<span class="pl-smi">__toString</span>}) }}<span class="pl-pds">"</span></span>>my link</<span class="pl-ent">a</span>></pre></div>
<p dir="auto">My proposal is: inside <code class="notranslate">doGenerate</code> method of <code class="notranslate">UrlGenerator</code> class, Symfony should cast parameters to string before passing them to <code class="notranslate">http_build_query</code></p> | <p dir="auto">For Symfony2 Router with the help of standart bundle (sensio extra) we can write ParamConverters to convert request param=>object. Is there any standart way to use reversed convertion?</p>
<p dir="auto">Now we must do something like this:<br>
path('DevBlogBundle_post_show',{'post':post.id})<br>
While a better way would be:<br>
path('DevBlogBundle_post_show',{'post':post})</p>
<p dir="auto">I've found even example jist:<br>
<a href="https://gist.github.com/stevelacey/3226510">https://gist.github.com/stevelacey/3226510</a></p>
<ol dir="auto">
<li>Maybe, we should think about adding such functionality to future releases of, for example, sensioFrameworkExtra bundle?</li>
<li>If there is no such functionality, is bundle providing such extension would be needed?</li>
</ol>
<p dir="auto">Thanks.</p> | 1 |
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=kdonald" rel="nofollow">Keith Donald</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5406?redirect=false" rel="nofollow">SPR-5406</a></strong> and commented</p>
<p dir="auto">Simple thing we can do:</p>
<ul dir="auto">
<li>Provide a TilesViewResolver subclass of UrlBasedViewResolver that configures the viewClass to be TilesView as a convenience</li>
</ul>
<p dir="auto">First noticed this when explaining configuring you need to configure a URL resolver for Tiles view proved quite complex. It's simpler to just say configure a Tiles view resolver.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 M1</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="398093345" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10176" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10176/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10176">#10176</a> Provide first-class Tiles ViewResolver implementation (<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="398094569" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10359" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10359/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10359">#10359</a> Add TilesViewResolver to enable fallback if tiles definition does not exist</li>
</ul>
<p dir="auto">2 votes, 2 watchers</p> | <p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=hannes.schmidt" rel="nofollow">Hannes Schmidt</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7867?redirect=false" rel="nofollow">SPR-7867</a></strong> and commented</p>
<p dir="auto">Spring's annotation-based REST controllers support almost any combination of HTTP method and request/respond payload. For example, it is possible to write a controller method that accepts a DELETE with a request body object.</p>
<p dir="auto">RestTemplate should IMHO mirror these capabilities and support request/response bodies for all methods regardless of whether a combination is allowed by the REST RFCs.</p>
<p dir="auto">Alternatively, RestTemplate could make it easier to add support for these combinations in custom subclasses by making its various inner-classes protected.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.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="398191019" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/18637" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/18637/hovercard" href="https://github.com/spring-projects/spring-framework/issues/18637">#18637</a> RestTemplate doesnt support DELETE with RequestBody (<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="398173258" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/16966" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/16966/hovercard" href="https://github.com/spring-projects/spring-framework/issues/16966">#16966</a> Add support for DELETE with body to RestTemplate through exchange method</li>
</ul>
<p dir="auto">5 votes, 7 watchers</p> | 0 |
<p dir="auto">The following consistently causes a segfault in 0.4 final release (as well as 0.4-rc1), and the same line of gf.c. I created a branch of ApproxFun that shows the bug. Note that the <code class="notranslate">--check-bounds=yes</code> appears necessary to reproduce.</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Pkg.add("ApproxFun")
Pkg.checkout("ApproxFun","bug-segfaultjl")"><pre class="notranslate">Pkg<span class="pl-k">.</span><span class="pl-c1">add</span>(<span class="pl-s"><span class="pl-pds">"</span>ApproxFun<span class="pl-pds">"</span></span>)
Pkg<span class="pl-k">.</span><span class="pl-c1">checkout</span>(<span class="pl-s"><span class="pl-pds">"</span>ApproxFun<span class="pl-pds">"</span></span>,<span class="pl-s"><span class="pl-pds">"</span>bug-segfaultjl<span class="pl-pds">"</span></span>)</pre></div>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[Macintosh:~/.julia/v0.4/ApproxFun/test] solver% julia --check-bounds=yes
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.4.0 (2015-10-08 06:20 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-apple-darwin13.4.0
julia> versioninfo()
Julia Version 0.4.0
Commit 0ff703b* (2015-10-08 06:20 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin13.4.0)
CPU: Intel(R) Core(TM) i7-3820QM CPU @ 2.70GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.3
julia> using ApproxFun
julia> x=Fun(identity,[-1.,1.])
Fun([0.0,1.0],Chebyshev(【-1.0,1.0】))
julia> f=x+sin(2x)*sqrt(1-x^2)
signal (11): Segmentation fault: 11
jl_method_table_assoc_exact at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:251
jl_apply_generic at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1663
maxspace at /Users/solver/.julia/v0.4/ApproxFun/src/Fun/Space.jl:230
union at /Users/solver/.julia/v0.4/ApproxFun/src/Fun/Space.jl:297
isconvertible at /Users/solver/.julia/v0.4/ApproxFun/src/Fun/Space.jl:311
jlcall_isconvertible_22217 at (unknown line)
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1691
sumspacecoefficients at /Users/solver/.julia/v0.4/ApproxFun/src/Spaces/Modifier/Modifier.jl:102
coefficients at /Users/solver/.julia/v0.4/ApproxFun/src/Fun/Fun.jl:45
call at /Users/solver/.julia/v0.4/ApproxFun/src/Fun/constructors.jl:54
jlcall_call_22211 at (unknown line)
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1691
+ at /Users/solver/.julia/v0.4/ApproxFun/src/Fun/Fun.jl:181
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1691
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:55
eval at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:213
eval at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:219
eval_body at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:592
jl_toplevel_eval_body at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:527
jl_toplevel_eval_flex at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:521
jl_toplevel_eval_in at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/builtins.c:579
eval_user_input at REPL.jl:62
jlcall_eval_user_input_21258 at (unknown line)
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia.h:1325
anonymous at REPL.jl:92
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/task.c:241
Segmentation fault: 11```
"><pre class="notranslate">[Macintosh<span class="pl-k">:</span><span class="pl-k">~</span><span class="pl-k">/</span><span class="pl-k">.</span>julia<span class="pl-k">/</span>v0.<span class="pl-c1">4</span><span class="pl-k">/</span>ApproxFun<span class="pl-k">/</span>test] solver<span class="pl-k">%</span> julia <span class="pl-k">--</span>check<span class="pl-k">-</span>bounds<span class="pl-k">=</span>yes
_
_ _ <span class="pl-c1">_</span>(_)_ <span class="pl-k">|</span> A fresh approach to technical computing
(_) <span class="pl-k">|</span> (_) (_) <span class="pl-k">|</span> Documentation<span class="pl-k">:</span> http<span class="pl-k">:</span><span class="pl-k">//</span>docs<span class="pl-k">.</span>julialang<span class="pl-k">.</span>org
_ _ _<span class="pl-k">|</span> <span class="pl-k">|</span>_ __ _ <span class="pl-k">|</span> Type <span class="pl-s"><span class="pl-pds">"</span>?help<span class="pl-pds">"</span></span> <span class="pl-k">for</span> help.
<span class="pl-k">|</span> <span class="pl-k">|</span> <span class="pl-k">|</span> <span class="pl-k">|</span> <span class="pl-k">|</span> <span class="pl-k">|</span> <span class="pl-k">|</span><span class="pl-k">/</span> <span class="pl-s"><span class="pl-pds"><span class="pl-c1">_</span>`</span> | |</span>
<span class="pl-s"> | | |_| | | | (_| | | Version 0.4.0 (2015-10-08 06:20 UTC)</span>
<span class="pl-s"> _/ |<span class="pl-cce">\_</span>_'_|_|_|<span class="pl-cce">\_</span>_'_| | Official http://julialang.org/ release</span>
<span class="pl-s">|__/ | x86_64-apple-darwin13.4.0</span>
<span class="pl-s"></span>
<span class="pl-s">julia> versioninfo()</span>
<span class="pl-s">Julia Version 0.4.0</span>
<span class="pl-s">Commit 0ff703b* (2015-10-08 06:20 UTC)</span>
<span class="pl-s">Platform Info:</span>
<span class="pl-s"> System: Darwin (x86_64-apple-darwin13.4.0)</span>
<span class="pl-s"> CPU: Intel(R) Core(TM) i7-3820QM CPU @ 2.70GHz</span>
<span class="pl-s"> WORD_SIZE: 64</span>
<span class="pl-s"> BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)</span>
<span class="pl-s"> LAPACK: libopenblas64_</span>
<span class="pl-s"> LIBM: libopenlibm</span>
<span class="pl-s"> LLVM: libLLVM-3.3</span>
<span class="pl-s"></span>
<span class="pl-s">julia> using ApproxFun</span>
<span class="pl-s"></span>
<span class="pl-s">julia> x=Fun(identity,[-1.,1.])</span>
<span class="pl-s">Fun([0.0,1.0],Chebyshev(【-1.0,1.0】))</span>
<span class="pl-s"></span>
<span class="pl-s">julia> f=x+sin(2x)*sqrt(1-x^2)</span>
<span class="pl-s"></span>
<span class="pl-s">signal (11): Segmentation fault: 11</span>
<span class="pl-s">jl_method_table_assoc_exact at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:251</span>
<span class="pl-s">jl_apply_generic at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1663</span>
<span class="pl-s">maxspace at /Users/solver/.julia/v0.4/ApproxFun/src/Fun/Space.jl:230</span>
<span class="pl-s">union at /Users/solver/.julia/v0.4/ApproxFun/src/Fun/Space.jl:297</span>
<span class="pl-s">isconvertible at /Users/solver/.julia/v0.4/ApproxFun/src/Fun/Space.jl:311</span>
<span class="pl-s">jlcall_isconvertible_22217 at (unknown line)</span>
<span class="pl-s">jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1691</span>
<span class="pl-s">sumspacecoefficients at /Users/solver/.julia/v0.4/ApproxFun/src/Spaces/Modifier/Modifier.jl:102</span>
<span class="pl-s">coefficients at /Users/solver/.julia/v0.4/ApproxFun/src/Fun/Fun.jl:45</span>
<span class="pl-s">call at /Users/solver/.julia/v0.4/ApproxFun/src/Fun/constructors.jl:54</span>
<span class="pl-s">jlcall_call_22211 at (unknown line)</span>
<span class="pl-s">jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1691</span>
<span class="pl-s">+ at /Users/solver/.julia/v0.4/ApproxFun/src/Fun/Fun.jl:181</span>
<span class="pl-s">jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1691</span>
<span class="pl-s">jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:55</span>
<span class="pl-s">eval at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:213</span>
<span class="pl-s">eval at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:219</span>
<span class="pl-s">eval_body at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:592</span>
<span class="pl-s">jl_toplevel_eval_body at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:527</span>
<span class="pl-s">jl_toplevel_eval_flex at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:521</span>
<span class="pl-s">jl_toplevel_eval_in at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/builtins.c:579</span>
<span class="pl-s">eval_user_input at REPL.jl:62</span>
<span class="pl-s">jlcall_eval_user_input_21258 at (unknown line)</span>
<span class="pl-s">jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia.h:1325</span>
<span class="pl-s">anonymous at REPL.jl:92</span>
<span class="pl-s">jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/task.c:241</span>
<span class="pl-s">Segmentation fault: 11<span class="pl-pds">`</span></span>``
</pre></div> | <p dir="auto">I think I might have stumbled across a bug, possibly in type inference though I'm not sure.</p>
<p dir="auto">I'd expect that running the following would print "ok" 3 times, instead it prints "ok" once then two blank lines.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function printit(x, _)
if _true()
z = id(x)
print("")
println(z)
:sym
elseif _false()
printit("ok", :foo)
end
end
function id(x)
if _false()
printit(unknowntype, :foo)
else
x
end
end
_false() = false
_true() = true
printit("ok", "foo")
printit("ok", :foo)
printit("ok", :foo)"><pre class="notranslate"><code class="notranslate">function printit(x, _)
if _true()
z = id(x)
print("")
println(z)
:sym
elseif _false()
printit("ok", :foo)
end
end
function id(x)
if _false()
printit(unknowntype, :foo)
else
x
end
end
_false() = false
_true() = true
printit("ok", "foo")
printit("ok", :foo)
printit("ok", :foo)
</code></pre></div>
<p dir="auto">Making any one of the following changes results in the expected output. Perhaps this will help point someone who understands Julia's internals at the cause of the unexpected behavior.</p>
<ol dir="auto">
<li>Remove the <code class="notranslate">printit("ok", "foo")</code> line. (Results in "ok" been printed twice as expected.)</li>
<li>Remove the <code class="notranslate">:sym</code> line.</li>
<li>Remove the <code class="notranslate">print("")</code> line.</li>
<li>Remove either of the <code class="notranslate">if</code> expressions leaving only the non-redundant branch.</li>
<li>Replace <code class="notranslate">unknowntype</code> with <code class="notranslate">unknowntype::ASCIIString</code>.</li>
<li>Remove either of the calls to <code class="notranslate">printit</code> within <code class="notranslate">printit</code> or <code class="notranslate">id</code>.</li>
</ol>
<p dir="auto">I've also just noticed that replacing <code class="notranslate">println(z)</code> with <code class="notranslate">println(z==nothing ? "nothing" : z)</code> causes a seg fault.</p>
<p dir="auto">All of this is happening with the latest nightly build, details below. I get very similar results using v0.3.4, but not the seg fault.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Julia Version 0.4.0-dev+2689
Commit a418672 (2015-01-14 10:05 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin13.4.0)
CPU: Intel(R) Core(TM)2 Duo CPU T7700 @ 2.40GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Core2)
LAPACK: libopenblas
LIBM: libopenlibm
LLVM: libLLVM-3.3"><pre class="notranslate"><code class="notranslate">Julia Version 0.4.0-dev+2689
Commit a418672 (2015-01-14 10:05 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin13.4.0)
CPU: Intel(R) Core(TM)2 Duo CPU T7700 @ 2.40GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Core2)
LAPACK: libopenblas
LIBM: libopenlibm
LLVM: libLLVM-3.3
</code></pre></div> | 1 |
<p dir="auto">LayerError Traceback (most recent call last)<br>
in <br>
1 # this takes around 1 minute<br>
2 # print(next(data_generator(Q1_test,Q2_test,512,pad=vocab[''],shuffle=False)))<br>
----> 3 accuracy = classify(Q1_test,Q2_test, y_test, 0.7, model, vocab, batch_size = 512)<br>
4 print("Accuracy", accuracy)</p>
<p dir="auto"> in classify(test_Q1, test_Q2, y, threshold, model, vocab, data_generator, batch_size)<br>
27 # print(f'shape of y_test = {y_test.shape}\n')<br>
28 # Call the model<br>
---> 29 v1, v2 = model((q1,q2))<br>
30<br>
31 for j in range(batch_size):</p>
<p dir="auto">~/anaconda3/lib/python3.8/site-packages/trax/layers/base.py in <strong>call</strong>(self, x, weights, state, rng)<br>
171 self.state = state # Needed if the model wasn't fully initialized.<br>
172 state = self.state<br>
--> 173 outputs, new_state = self.pure_fn(x, weights, state, rng)<br>
174 self.state = new_state<br>
175 self.weights = weights</p>
<p dir="auto">~/anaconda3/lib/python3.8/site-packages/trax/layers/base.py in pure_fn(self, x, weights, state, rng, use_cache)<br>
520 # Skipping 3 lines as it's always the uninteresting internal call.<br>
521 name, trace = self._name, _short_traceback(skip=3)<br>
--> 522 raise LayerError(name, 'pure_fn',<br>
523 self._caller, signature(x), trace) from None<br>
524</p>
<p dir="auto">LayerError: Exception passing through layer Parallel (in pure_fn):<br>
layer created in file [...]/, line 27<br>
layer input shapes: (ShapeDtype{shape:(512, 64), dtype:int64}, ShapeDtype{shape:(512, 64), dtype:int64})</p>
<p dir="auto">File [...]/trax/layers/combinators.py, line 209, in forward<br>
sub_outputs, sub_state = layer.pure_fn(x, w, s, r, use_cache=True)</p>
<p dir="auto">LayerError: Exception passing through layer Serial (in pure_fn):<br>
layer created in file [...]/, line 17<br>
layer input shapes: ShapeDtype{shape:(512, 64), dtype:int64}</p>
<p dir="auto">File [...]/trax/layers/combinators.py, line 88, in forward<br>
outputs, s = layer.pure_fn(inputs, w, s, rng, use_cache=True)</p>
<p dir="auto">LayerError: Exception passing through layer Embedding_41699_128 (in pure_fn):<br>
layer created in file [...]/, line 18<br>
layer input shapes: ShapeDtype{shape:(512, 64), dtype:int64}</p>
<p dir="auto">File [...]/trax/layers/core.py, line 150, in forward<br>
return jnp.take(self.weights, x, axis=0)</p>
<p dir="auto">File [...]/jax/numpy/lax_numpy.py, line 3422, in take<br>
return lax.gather(a, indices[..., None], dimension_numbers=dnums,</p>
<p dir="auto">File [...]/jax/lax/lax.py, line 807, in gather<br>
return gather_p.bind(</p>
<p dir="auto">File [...]/site-packages/jax/core.py, line 276, in bind<br>
return self.impl(*args, **kwargs)</p>
<p dir="auto">File [...]/jax/interpreters/xla.py, line 224, in apply_primitive<br>
compiled_fun = xla_primitive_callable(prim, *unsafe_map(arg_spec, args), **params)</p>
<p dir="auto">File [...]/jax/interpreters/xla.py, line 257, in xla_primitive_callable<br>
built_c = primitive_computation(prim, AxisEnv(nreps, (), (), None), backend,</p>
<p dir="auto">File [...]/jax/interpreters/xla.py, line 316, in primitive_computation<br>
raise RuntimeError(msg) from e</p>
<p dir="auto">RuntimeError: Invalid argument: Slice size at index 0 in gather op is out of range, must be within [0, 1), got 1.:<br>
This is a bug in JAX's shape-checking rules; please report it!</p> | <p dir="auto">code:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
def gumbel_sample(log_probs, temperature=1.0):
"""Gumbel sampling from a categorical distribution."""
u = numpy.random.uniform(low=1e-6, high=1.0 - 1e-6, size=log_probs.shape)
g = -np.log(-np.log(u))
return np.argmax(log_probs + g * temperature, axis=-1)
def predict(num_chars, prefix):
inp = [ord(c) for c in prefix]
result = [c for c in prefix]
max_len = len(prefix) + num_chars
for _ in range(num_chars):
cur_inp = np.array(inp + [0] * (max_len - len(inp)))
outp = model(cur_inp[None, :]) # Add batch dim.
next_char = gumbel_sample(outp[0, len(inp)])
inp += [int(next_char)]
if inp[-1] == 1:
break # EOS
result.append(chr(int(next_char)))
return "".join(result)
print(predict(32, ""))"><pre class="notranslate"><span class="pl-k">def</span> <span class="pl-en">gumbel_sample</span>(<span class="pl-s1">log_probs</span>, <span class="pl-s1">temperature</span><span class="pl-c1">=</span><span class="pl-c1">1.0</span>):
<span class="pl-s">"""Gumbel sampling from a categorical distribution."""</span>
<span class="pl-s1">u</span> <span class="pl-c1">=</span> <span class="pl-s1">numpy</span>.<span class="pl-s1">random</span>.<span class="pl-en">uniform</span>(<span class="pl-s1">low</span><span class="pl-c1">=</span><span class="pl-c1">1e-6</span>, <span class="pl-s1">high</span><span class="pl-c1">=</span><span class="pl-c1">1.0</span> <span class="pl-c1">-</span> <span class="pl-c1">1e-6</span>, <span class="pl-s1">size</span><span class="pl-c1">=</span><span class="pl-s1">log_probs</span>.<span class="pl-s1">shape</span>)
<span class="pl-s1">g</span> <span class="pl-c1">=</span> <span class="pl-c1">-</span><span class="pl-s1">np</span>.<span class="pl-en">log</span>(<span class="pl-c1">-</span><span class="pl-s1">np</span>.<span class="pl-en">log</span>(<span class="pl-s1">u</span>))
<span class="pl-k">return</span> <span class="pl-s1">np</span>.<span class="pl-en">argmax</span>(<span class="pl-s1">log_probs</span> <span class="pl-c1">+</span> <span class="pl-s1">g</span> <span class="pl-c1">*</span> <span class="pl-s1">temperature</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">def</span> <span class="pl-en">predict</span>(<span class="pl-s1">num_chars</span>, <span class="pl-s1">prefix</span>):
<span class="pl-s1">inp</span> <span class="pl-c1">=</span> [<span class="pl-en">ord</span>(<span class="pl-s1">c</span>) <span class="pl-k">for</span> <span class="pl-s1">c</span> <span class="pl-c1">in</span> <span class="pl-s1">prefix</span>]
<span class="pl-s1">result</span> <span class="pl-c1">=</span> [<span class="pl-s1">c</span> <span class="pl-k">for</span> <span class="pl-s1">c</span> <span class="pl-c1">in</span> <span class="pl-s1">prefix</span>]
<span class="pl-s1">max_len</span> <span class="pl-c1">=</span> <span class="pl-en">len</span>(<span class="pl-s1">prefix</span>) <span class="pl-c1">+</span> <span class="pl-s1">num_chars</span>
<span class="pl-k">for</span> <span class="pl-s1">_</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-s1">num_chars</span>):
<span class="pl-s1">cur_inp</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>(<span class="pl-s1">inp</span> <span class="pl-c1">+</span> [<span class="pl-c1">0</span>] <span class="pl-c1">*</span> (<span class="pl-s1">max_len</span> <span class="pl-c1">-</span> <span class="pl-en">len</span>(<span class="pl-s1">inp</span>)))
<span class="pl-s1">outp</span> <span class="pl-c1">=</span> <span class="pl-en">model</span>(<span class="pl-s1">cur_inp</span>[<span class="pl-c1">None</span>, :]) <span class="pl-c"># Add batch dim.</span>
<span class="pl-s1">next_char</span> <span class="pl-c1">=</span> <span class="pl-en">gumbel_sample</span>(<span class="pl-s1">outp</span>[<span class="pl-c1">0</span>, <span class="pl-en">len</span>(<span class="pl-s1">inp</span>)])
<span class="pl-s1">inp</span> <span class="pl-c1">+=</span> [<span class="pl-en">int</span>(<span class="pl-s1">next_char</span>)]
<span class="pl-k">if</span> <span class="pl-s1">inp</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>] <span class="pl-c1">==</span> <span class="pl-c1">1</span>:
<span class="pl-k">break</span> <span class="pl-c"># EOS</span>
<span class="pl-s1">result</span>.<span class="pl-en">append</span>(<span class="pl-en">chr</span>(<span class="pl-en">int</span>(<span class="pl-s1">next_char</span>)))
<span class="pl-k">return</span> <span class="pl-s">""</span>.<span class="pl-en">join</span>(<span class="pl-s1">result</span>)
<span class="pl-en">print</span>(<span class="pl-en">predict</span>(<span class="pl-c1">32</span>, <span class="pl-s">""</span>))</pre></div>
<p dir="auto">Error:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="LayerError Traceback (most recent call last)
<ipython-input-27-6f9f9afc30e6> in <module>
22 return "".join(result)
23
---> 24 print(predict(32, ""))
<ipython-input-27-6f9f9afc30e6> in predict(num_chars, prefix)
12 for _ in range(num_chars):
13 cur_inp = np.array(inp + [0] * (max_len - len(inp)))
---> 14 outp = model(cur_inp[None, :]) # Add batch dim.
15 next_char = gumbel_sample(outp[0, len(inp)])
16 inp += [int(next_char)]
/opt/conda/lib/python3.7/site-packages/trax/layers/base.py in __call__(self, x, weights, state, rng)
165 self.state = state # Needed if the model wasn't fully initialized.
166 state = self.state
--> 167 outputs, new_state = self.pure_fn(x, weights, state, rng)
168 self.state = new_state
169 self.weights = weights
/opt/conda/lib/python3.7/site-packages/trax/layers/base.py in pure_fn(self, x, weights, state, rng, use_cache)
448 name, trace = self._name, _short_traceback(skip=3)
449 raise LayerError(name, 'pure_fn',
--> 450 self._caller, signature(x), trace) from None
451
452 def output_signature(self, input_signature):
LayerError: Exception passing through layer Serial (in pure_fn):
layer created in file [...]/<ipython-input-13-6f7ffe0c061e>, line 21
layer input shapes: ShapeDtype{shape:(1, 32), dtype:int32}
File [...]/trax/layers/combinators.py, line 88, in forward
outputs, s = layer.pure_fn(inputs, w, s, rng, use_cache=True)
LayerError: Exception passing through layer Embedding_256_512 (in pure_fn):
layer created in file [...]/<ipython-input-13-6f7ffe0c061e>, line 18
layer input shapes: ShapeDtype{shape:(1, 32), dtype:int32}
File [...]/trax/layers/core.py, line 150, in forward
return jnp.take(self.weights, x, axis=0)
File [...]/jax/numpy/lax_numpy.py, line 3298, in take
slice_sizes=tuple(slice_sizes))
File [...]/jax/lax/lax.py, line 835, in gather
slice_sizes=canonicalize_shape(slice_sizes))
File [...]/site-packages/jax/core.py, line 273, in bind
return self.impl(*args, **kwargs)
File [...]/jax/interpreters/xla.py, line 228, in apply_primitive
compiled_fun = xla_primitive_callable(prim, *unsafe_map(arg_spec, args), **params)
File [...]/jax/interpreters/xla.py, line 262, in xla_primitive_callable
*avals, **params)
File [...]/jax/interpreters/xla.py, line 320, in primitive_computation
raise RuntimeError(msg) from e
RuntimeError: Invalid argument: Slice size at index 0 in gather op is out of range, must be within [0, 1), got 1.:
This is a bug in JAX's shape-checking rules; please report it!"><pre class="notranslate"><span class="pl-v">LayerError</span> <span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>)
<span class="pl-c1"><</span><span class="pl-s1">ipython</span><span class="pl-c1">-</span><span class="pl-s1">input</span><span class="pl-c1">-</span><span class="pl-c1">27</span><span class="pl-c1">-</span><span class="pl-c1">6</span><span class="pl-s1">f9f9afc30e6</span><span class="pl-c1">></span> <span class="pl-s1">in</span> <span class="pl-c1"><</span><span class="pl-s1">module</span><span class="pl-c1">></span>
<span class="pl-c1">22</span> <span class="pl-k">return</span> <span class="pl-s">""</span>.<span class="pl-en">join</span>(<span class="pl-s1">result</span>)
<span class="pl-c1">23</span>
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">></span> <span class="pl-c1">24</span> <span class="pl-en">print</span>(<span class="pl-en">predict</span>(<span class="pl-c1">32</span>, <span class="pl-s">""</span>))
<span class="pl-c1"><</span><span class="pl-s1">ipython</span><span class="pl-c1">-</span><span class="pl-s1">input</span><span class="pl-c1">-</span><span class="pl-c1">27</span><span class="pl-c1">-</span><span class="pl-c1">6</span><span class="pl-s1">f9f9afc30e6</span><span class="pl-c1">></span> <span class="pl-s1">in</span> <span class="pl-en">predict</span>(<span class="pl-s1">num_chars</span>, <span class="pl-s1">prefix</span>)
<span class="pl-c1">12</span> <span class="pl-k">for</span> <span class="pl-s1">_</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-s1">num_chars</span>):
<span class="pl-c1">13</span> <span class="pl-s1">cur_inp</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>(<span class="pl-s1">inp</span> <span class="pl-c1">+</span> [<span class="pl-c1">0</span>] <span class="pl-c1">*</span> (<span class="pl-s1">max_len</span> <span class="pl-c1">-</span> <span class="pl-en">len</span>(<span class="pl-s1">inp</span>)))
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">></span> <span class="pl-c1">14</span> <span class="pl-s1">outp</span> <span class="pl-c1">=</span> <span class="pl-en">model</span>(<span class="pl-s1">cur_inp</span>[<span class="pl-c1">None</span>, :]) <span class="pl-c"># Add batch dim.</span>
<span class="pl-c1">15</span> <span class="pl-s1">next_char</span> <span class="pl-c1">=</span> <span class="pl-en">gumbel_sample</span>(<span class="pl-s1">outp</span>[<span class="pl-c1">0</span>, <span class="pl-en">len</span>(<span class="pl-s1">inp</span>)])
<span class="pl-c1">16</span> <span class="pl-s1">inp</span> <span class="pl-c1">+=</span> [<span class="pl-en">int</span>(<span class="pl-s1">next_char</span>)]
<span class="pl-c1">/</span><span class="pl-s1">opt</span><span class="pl-c1">/</span><span class="pl-s1">conda</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python3</span>.<span class="pl-c1">7</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">trax</span><span class="pl-c1">/</span><span class="pl-s1">layers</span><span class="pl-c1">/</span><span class="pl-s1">base</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">__call__</span>(<span class="pl-s1">self</span>, <span class="pl-s1">x</span>, <span class="pl-s1">weights</span>, <span class="pl-s1">state</span>, <span class="pl-s1">rng</span>)
<span class="pl-c1">165</span> <span class="pl-s1">self</span>.<span class="pl-s1">state</span> <span class="pl-c1">=</span> <span class="pl-s1">state</span> <span class="pl-c"># Needed if the model wasn't fully initialized.</span>
<span class="pl-c1">166</span> <span class="pl-s1">state</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-s1">state</span>
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">></span> <span class="pl-c1">167</span> <span class="pl-s1">outputs</span>, <span class="pl-s1">new_state</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">pure_fn</span>(<span class="pl-s1">x</span>, <span class="pl-s1">weights</span>, <span class="pl-s1">state</span>, <span class="pl-s1">rng</span>)
<span class="pl-c1">168</span> <span class="pl-s1">self</span>.<span class="pl-s1">state</span> <span class="pl-c1">=</span> <span class="pl-s1">new_state</span>
<span class="pl-c1">169</span> <span class="pl-s1">self</span>.<span class="pl-s1">weights</span> <span class="pl-c1">=</span> <span class="pl-s1">weights</span>
<span class="pl-c1">/</span><span class="pl-s1">opt</span><span class="pl-c1">/</span><span class="pl-s1">conda</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python3</span>.<span class="pl-c1">7</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">trax</span><span class="pl-c1">/</span><span class="pl-s1">layers</span><span class="pl-c1">/</span><span class="pl-s1">base</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">pure_fn</span>(<span class="pl-s1">self</span>, <span class="pl-s1">x</span>, <span class="pl-s1">weights</span>, <span class="pl-s1">state</span>, <span class="pl-s1">rng</span>, <span class="pl-s1">use_cache</span>)
<span class="pl-c1">448</span> <span class="pl-s1">name</span>, <span class="pl-s1">trace</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-s1">_name</span>, <span class="pl-en">_short_traceback</span>(<span class="pl-s1">skip</span><span class="pl-c1">=</span><span class="pl-c1">3</span>)
<span class="pl-c1">449</span> <span class="pl-k">raise</span> <span class="pl-v">LayerError</span>(<span class="pl-s1">name</span>, <span class="pl-s">'pure_fn'</span>,
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">></span> <span class="pl-c1">450</span> <span class="pl-s1">self</span>.<span class="pl-s1">_caller</span>, <span class="pl-en">signature</span>(<span class="pl-s1">x</span>), <span class="pl-s1">trace</span>) <span class="pl-k">from</span> <span class="pl-c1">None</span>
<span class="pl-c1">451</span>
<span class="pl-c1">452</span> <span class="pl-k">def</span> <span class="pl-en">output_signature</span>(<span class="pl-s1">self</span>, <span class="pl-s1">input_signature</span>):
<span class="pl-v">LayerError</span>: <span class="pl-v">Exception</span> <span class="pl-s1">passing</span> <span class="pl-s1">through</span> <span class="pl-s1">layer</span> <span class="pl-v">Serial</span> (<span class="pl-s1">in</span> <span class="pl-s1">pure_fn</span>):
<span class="pl-s1">layer</span> <span class="pl-s1">created</span> <span class="pl-c1">in</span> <span class="pl-s1">file</span> [...]<span class="pl-c1">/</span><span class="pl-c1"><</span><span class="pl-s1">ipython</span><span class="pl-c1">-</span><span class="pl-s1">input</span><span class="pl-c1">-</span><span class="pl-c1">13</span><span class="pl-c1">-</span><span class="pl-c1">6</span><span class="pl-s1">f7ffe0c061e</span><span class="pl-c1">></span>, <span class="pl-s1">line</span> <span class="pl-c1">21</span>
<span class="pl-s1">layer</span> <span class="pl-s1">input</span> <span class="pl-s1">shapes</span>: <span class="pl-v">ShapeDtype</span>{<span class="pl-s1">shape</span>:(<span class="pl-c1">1</span>, <span class="pl-c1">32</span>), <span class="pl-s1">dtype</span>:<span class="pl-s1">int32</span>}
<span class="pl-v">File</span> [...]<span class="pl-c1">/</span><span class="pl-s1">trax</span><span class="pl-c1">/</span><span class="pl-s1">layers</span><span class="pl-c1">/</span><span class="pl-s1">combinators</span>.<span class="pl-s1">py</span>, <span class="pl-s1">line</span> <span class="pl-c1">88</span>, <span class="pl-s1">in</span> <span class="pl-s1">forward</span>
<span class="pl-s1">outputs</span>, <span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-s1">layer</span>.<span class="pl-en">pure_fn</span>(<span class="pl-s1">inputs</span>, <span class="pl-s1">w</span>, <span class="pl-s1">s</span>, <span class="pl-s1">rng</span>, <span class="pl-s1">use_cache</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-v">LayerError</span>: <span class="pl-v">Exception</span> <span class="pl-s1">passing</span> <span class="pl-s1">through</span> <span class="pl-s1">layer</span> <span class="pl-v">Embedding_256_512</span> (<span class="pl-s1">in</span> <span class="pl-s1">pure_fn</span>):
<span class="pl-s1">layer</span> <span class="pl-s1">created</span> <span class="pl-c1">in</span> <span class="pl-s1">file</span> [...]<span class="pl-c1">/</span><span class="pl-c1"><</span><span class="pl-s1">ipython</span><span class="pl-c1">-</span><span class="pl-s1">input</span><span class="pl-c1">-</span><span class="pl-c1">13</span><span class="pl-c1">-</span><span class="pl-c1">6</span><span class="pl-s1">f7ffe0c061e</span><span class="pl-c1">></span>, <span class="pl-s1">line</span> <span class="pl-c1">18</span>
<span class="pl-s1">layer</span> <span class="pl-s1">input</span> <span class="pl-s1">shapes</span>: <span class="pl-v">ShapeDtype</span>{<span class="pl-s1">shape</span>:(<span class="pl-c1">1</span>, <span class="pl-c1">32</span>), <span class="pl-s1">dtype</span>:<span class="pl-s1">int32</span>}
<span class="pl-v">File</span> [...]<span class="pl-c1">/</span><span class="pl-s1">trax</span><span class="pl-c1">/</span><span class="pl-s1">layers</span><span class="pl-c1">/</span><span class="pl-s1">core</span>.<span class="pl-s1">py</span>, <span class="pl-s1">line</span> <span class="pl-c1">150</span>, <span class="pl-s1">in</span> <span class="pl-s1">forward</span>
<span class="pl-k">return</span> <span class="pl-s1">jnp</span>.<span class="pl-en">take</span>(<span class="pl-s1">self</span>.<span class="pl-s1">weights</span>, <span class="pl-s1">x</span>, <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">0</span>)
<span class="pl-v">File</span> [...]<span class="pl-c1">/</span><span class="pl-s1">jax</span><span class="pl-c1">/</span><span class="pl-s1">numpy</span><span class="pl-c1">/</span><span class="pl-s1">lax_numpy</span>.<span class="pl-s1">py</span>, <span class="pl-s1">line</span> <span class="pl-c1">3298</span>, <span class="pl-s1">in</span> <span class="pl-s1">take</span>
<span class="pl-s1">slice_sizes</span><span class="pl-c1">=</span><span class="pl-en">tuple</span>(<span class="pl-s1">slice_sizes</span>))
<span class="pl-v">File</span> [...]<span class="pl-c1">/</span><span class="pl-s1">jax</span><span class="pl-c1">/</span><span class="pl-s1">lax</span><span class="pl-c1">/</span><span class="pl-s1">lax</span>.<span class="pl-s1">py</span>, <span class="pl-s1">line</span> <span class="pl-c1">835</span>, <span class="pl-s1">in</span> <span class="pl-s1">gather</span>
<span class="pl-s1">slice_sizes</span><span class="pl-c1">=</span><span class="pl-en">canonicalize_shape</span>(<span class="pl-s1">slice_sizes</span>))
<span class="pl-v">File</span> [...]<span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">jax</span><span class="pl-c1">/</span><span class="pl-s1">core</span>.<span class="pl-s1">py</span>, <span class="pl-s1">line</span> <span class="pl-c1">273</span>, <span class="pl-s1">in</span> <span class="pl-s1">bind</span>
<span class="pl-k">return</span> <span class="pl-s1">self</span>.<span class="pl-en">impl</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-v">File</span> [...]<span class="pl-c1">/</span><span class="pl-s1">jax</span><span class="pl-c1">/</span><span class="pl-s1">interpreters</span><span class="pl-c1">/</span><span class="pl-s1">xla</span>.<span class="pl-s1">py</span>, <span class="pl-s1">line</span> <span class="pl-c1">228</span>, <span class="pl-s1">in</span> <span class="pl-s1">apply_primitive</span>
<span class="pl-s1">compiled_fun</span> <span class="pl-c1">=</span> <span class="pl-en">xla_primitive_callable</span>(<span class="pl-s1">prim</span>, <span class="pl-c1">*</span><span class="pl-en">unsafe_map</span>(<span class="pl-s1">arg_spec</span>, <span class="pl-s1">args</span>), <span class="pl-c1">**</span><span class="pl-s1">params</span>)
<span class="pl-v">File</span> [...]<span class="pl-c1">/</span><span class="pl-s1">jax</span><span class="pl-c1">/</span><span class="pl-s1">interpreters</span><span class="pl-c1">/</span><span class="pl-s1">xla</span>.<span class="pl-s1">py</span>, <span class="pl-s1">line</span> <span class="pl-c1">262</span>, <span class="pl-s1">in</span> <span class="pl-s1">xla_primitive_callable</span>
<span class="pl-c1">*</span><span class="pl-s1">avals</span>, <span class="pl-c1">**</span><span class="pl-s1">params</span>)
<span class="pl-v">File</span> [...]<span class="pl-c1">/</span><span class="pl-s1">jax</span><span class="pl-c1">/</span><span class="pl-s1">interpreters</span><span class="pl-c1">/</span><span class="pl-s1">xla</span>.<span class="pl-s1">py</span>, <span class="pl-s1">line</span> <span class="pl-c1">320</span>, <span class="pl-s1">in</span> <span class="pl-s1">primitive_computation</span>
<span class="pl-k">raise</span> <span class="pl-v">RuntimeError</span>(<span class="pl-s1">msg</span>) <span class="pl-k">from</span> <span class="pl-s1">e</span>
<span class="pl-v">RuntimeError</span>: <span class="pl-v">Invalid</span> <span class="pl-s1">argument</span>: <span class="pl-v">Slice</span> <span class="pl-s1">size</span> <span class="pl-s1">at</span> <span class="pl-s1">index</span> <span class="pl-c1">0</span> <span class="pl-c1">in</span> <span class="pl-s1">gather</span> <span class="pl-s1">op</span> <span class="pl-c1">is</span> <span class="pl-s1">out</span> <span class="pl-s1">of</span> <span class="pl-s1">range</span>, <span class="pl-s1">must</span> <span class="pl-s1">be</span> <span class="pl-s1">within</span> [<span class="pl-c1">0</span>, <span class="pl-c1">1</span>), <span class="pl-s1">got</span> <span class="pl-c1">1.</span>:
<span class="pl-v">This</span> <span class="pl-c1">is</span> <span class="pl-s1">a</span> <span class="pl-s1">bug</span> <span class="pl-c1">in</span> <span class="pl-v">JAX</span>'<span class="pl-s1">s</span> <span class="pl-s1">shape</span><span class="pl-c1">-</span><span class="pl-s1">checking</span> <span class="pl-s1">rules</span>; <span class="pl-s1">please</span> <span class="pl-s1">report</span> <span class="pl-s1">it</span>!</pre></div> | 1 |
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/2f0b01e13bc77afb13304ea490e1a1c635b6deb3038224bbe5d827b3b85b4a40/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f353132303931372f3930323130392f36376233653139652d666238652d313165322d393565332d6233323637666663666339642e706e67"><img src="https://camo.githubusercontent.com/2f0b01e13bc77afb13304ea490e1a1c635b6deb3038224bbe5d827b3b85b4a40/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f353132303931372f3930323130392f36376233653139652d666238652d313165322d393565332d6233323637666663666339642e706e67" alt="toggle button" data-canonical-src="https://f.cloud.github.com/assets/5120917/902109/67b3e19e-fb8e-11e2-95e3-b3267ffcfc9d.png" style="max-width: 100%;"></a></p>
<p dir="auto">in collapse view, the above seems to happen on normal and inverse navbar when the brand name is not included. you can just about make out its outline in the top right behind the home link.</p>
<p dir="auto">( apologies if this has already been spotted. )</p> | <p dir="auto">Hi,<br>
I test version 3.0 RC1. I have a problem when I hive my website with my mobile. In Fact when I am on my home page and show my menu I don't hidden this menu. Why ? Because de first item on the nav is "active" and the button (show/hid) is in background.</p>
<p dir="auto">I hope that I am clear.</p>
<p dir="auto">best regards,</p>
<p dir="auto">Lefandordinateur</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>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Base {
static get parameters() {
return [[Service]];
}
constructor(service) {
this.service = service
}
}
class Child extends Base {
load() {
return this.service.load()
}
}
@Component(...)
class App {
static get parameters() {
return [[Child]]
}
constructor(service) {
this.service = service
}
ngOnInit() {
this.service.load()
}
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">Base</span> <span class="pl-kos">{</span>
<span class="pl-k">static</span> <span class="pl-k">get</span> <span class="pl-en">parameters</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-kos">[</span><span class="pl-v">Service</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">constructor</span><span class="pl-kos">(</span><span class="pl-s1">service</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">service</span> <span class="pl-c1">=</span> <span class="pl-s1">service</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">class</span> <span class="pl-v">Child</span> <span class="pl-k">extends</span> <span class="pl-v">Base</span> <span class="pl-kos">{</span>
<span class="pl-en">load</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-c1">service</span><span class="pl-kos">.</span><span class="pl-en">load</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
@<span class="pl-v">Component</span><span class="pl-kos">(</span>...<span class="pl-kos">)</span>
<span class="pl-k">class</span> <span class="pl-v">App</span> <span class="pl-kos">{</span>
<span class="pl-k">static</span> <span class="pl-k">get</span> <span class="pl-en">parameters</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-kos">[</span><span class="pl-v">Child</span><span class="pl-kos">]</span><span class="pl-kos">]</span>
<span class="pl-kos">}</span>
<span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-s1">service</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">service</span> <span class="pl-c1">=</span> <span class="pl-s1">service</span>
<span class="pl-kos">}</span>
<span class="pl-en">ngOnInit</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">service</span><span class="pl-kos">.</span><span class="pl-en">load</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">Fails with <code class="notranslate">Cannot read property 'load' of undefined</code></p>
<p dir="auto"><strong>Expected behavior</strong><br>
<code class="notranslate">Service</code> is successfully injected into <code class="notranslate">Child</code> class and no error is thrown</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong><br>
Reproduction is in <code class="notranslate">Current behavior</code>. I did some investigation and found out that babel generate this for class without constructor:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function Child() {
babelHelpers.classCallCheck(this, Child);
return babelHelpers.possibleConstructorReturn(this, (Child.__proto__ || Object.getPrototypeOf(Child)).apply(this, arguments));
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-v">Child</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">babelHelpers</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">Child</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-s1">babelHelpers</span><span class="pl-kos">.</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">Child</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">Child</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-smi">arguments</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">And this is the regexp which checks whether class doesn't have own constructor:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var DELEGATE_CTOR = /^function\s+\S+\(\)\s*{\s*("use strict";)?\s*(return\s+)?\S+\.apply\(this,\s*arguments\)/;"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-c1">DELEGATE_CTOR</span> <span class="pl-c1">=</span> <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">^</span>function<span class="pl-cce">\s</span><span class="pl-c1">+</span><span class="pl-cce">\S</span><span class="pl-c1">+</span><span class="pl-cce">\(</span><span class="pl-cce">\)</span><span class="pl-cce">\s</span><span class="pl-c1">*</span><span class="pl-kos">{</span><span class="pl-cce">\s</span><span class="pl-c1">*</span><span class="pl-kos">(</span>"use strict";<span class="pl-kos">)</span>?<span class="pl-cce">\s</span><span class="pl-c1">*</span><span class="pl-kos">(</span>return<span class="pl-cce">\s</span><span class="pl-c1">+</span><span class="pl-kos">)</span>?<span class="pl-cce">\S</span><span class="pl-c1">+</span><span class="pl-cce">\.</span>apply<span class="pl-cce">\(</span>this,<span class="pl-cce">\s</span><span class="pl-c1">*</span>arguments<span class="pl-cce">\)</span><span class="pl-c1">/</span></span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
It's useful when injected services from parent class can be injected into <code class="notranslate">Child</code> by default without additional coding</p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>
<ul dir="auto">
<li>
<p dir="auto"><strong>Angular version:</strong> 2.0.X<br>
2.4.8</p>
</li>
<li>
<p dir="auto"><strong>Browser:</strong> all</p>
</li>
<li>
<p dir="auto"><strong>Language:</strong> ES6/7</p>
</li>
<li>
<p dir="auto"><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> =</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>
(note: this is the bug I wrongly reported in my first report <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="211959757" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/14934" data-hovercard-type="issue" data-hovercard-url="/angular/angular/issues/14934/hovercard" href="https://github.com/angular/angular/issues/14934">#14934</a> , but now I have successed in reproducing it properly)<br>
My main module (foo in the example) contains a feature module (bar in the example), this feature module contains a service (ConfigurationService in the example) and a component (DisplayComponent in the example) which uses ConfigurationService. The component is exported by the bar module.<br>
In the foo module, we inherit from this component to create the CustomDisplay component.<br>
The application works fine, but the tests fail with the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Cannot read property 'getStuff' of undefined"><pre class="notranslate"><code class="notranslate">Cannot read property 'getStuff' of undefined
</code></pre></div>
<p dir="auto">It happens because the ConfigurationService is not injected in the component.</p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">Tests should pass.</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong></p>
<p dir="auto">Here is an example generated with Angular CLI 1.0.0.rc1:<br>
<a href="https://github.com/ebrehault/ng-feature-module-example">https://github.com/ebrehault/ng-feature-module-example</a></p>
<p dir="auto">Just run:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ng test"><pre class="notranslate"><code class="notranslate">ng test
</code></pre></div>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong></p>
<p dir="auto">The motication is to be able to write tests :)</p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>
<p dir="auto">Ubuntu 16.10, npm 3.8.6</p>
<ul dir="auto">
<li><strong>Angular version:</strong> 2.4.9</li>
</ul>
<ul dir="auto">
<li><strong>Browser:</strong> Chrome (which is the browser used by karma)</li>
</ul>
<ul dir="auto">
<li>
<p dir="auto"><strong>Language:</strong> TypeScript 2.0.10</p>
</li>
<li>
<p dir="auto"><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> = 6.1.0</p>
</li>
</ul> | 1 |
<p dir="auto">I've written a repro test here:<br>
<a href="https://github.com/prashantv/listener-repro/blob/master/main.go">https://github.com/prashantv/listener-repro/blob/master/main.go</a></p>
<p dir="auto">It basically does the following:</p>
<ul dir="auto">
<li>Start a listener</li>
<li>Create <code class="notranslate">connectionsBeforeClose</code> connections to the listener (which should succeed)</li>
<li>Close the listener</li>
<li>Create another connection to the listener</li>
</ul>
<p dir="auto">On the listener side, I expect to receive at most <code class="notranslate">connectionsBeforeClose</code> successful connections. Any extra connections causes the <code class="notranslate">runTest</code> method to return an error.</p>
<p dir="auto">This works as expected on OSX, but on Linux, it seems to receive a successful connection after the listener has been closed.</p>
<p dir="auto">Some things I noticed:</p>
<ul dir="auto">
<li>If <code class="notranslate">connectionsBeforeClose</code> is set to 0, then no unexpected connections are made after the listener is closed</li>
<li>The issue also disappears if I <code class="notranslate">enableSleep</code></li>
</ul>
<p dir="auto">I would expect that a Listener will not accept any further socket attempts after <code class="notranslate">Close</code> has returned.</p> | <p dir="auto">Go version: go1.4.2<br>
OS: Linux 3.13 x86_64</p>
<p dir="auto">The following test demonstrates what I consider a bug:</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="package foo
import (
"log"
"net"
"testing"
)
const addr = "127.0.0.1:12345"
func TestXxx(t *testing.T) {
for i := 0; i < 100000; i++ {
log.Printf("Iteration %d", i+1)
l, err := net.Listen("tcp4", addr)
if err != nil {
t.Fatalf("Failed to listen on %s: %v", addr, err)
}
go func(l net.Listener) {
for {
_, err := l.Accept()
if err != nil {
return
}
}
}(l)
if err := l.Close(); err != nil {
t.Fatalf("Failed to close server: %v", err)
}
}
}"><pre class="notranslate"><span class="pl-k">package</span> foo
<span class="pl-k">import</span> (
<span class="pl-s">"log"</span>
<span class="pl-s">"net"</span>
<span class="pl-s">"testing"</span>
)
<span class="pl-k">const</span> <span class="pl-s1">addr</span> <span class="pl-c1">=</span> <span class="pl-s">"127.0.0.1:12345"</span>
<span class="pl-k">func</span> <span class="pl-en">TestXxx</span>(<span class="pl-s1">t</span> <span class="pl-c1">*</span>testing.<span class="pl-smi">T</span>) {
<span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">:=</span> <span class="pl-c1">0</span>; <span class="pl-s1">i</span> <span class="pl-c1"><</span> <span class="pl-c1">100000</span>; <span class="pl-s1">i</span><span class="pl-c1">++</span> {
<span class="pl-s1">log</span>.<span class="pl-en">Printf</span>(<span class="pl-s">"Iteration %d"</span>, <span class="pl-s1">i</span><span class="pl-c1">+</span><span class="pl-c1">1</span>)
<span class="pl-s1">l</span>, <span class="pl-s1">err</span> <span class="pl-c1">:=</span> <span class="pl-s1">net</span>.<span class="pl-en">Listen</span>(<span class="pl-s">"tcp4"</span>, <span class="pl-s1">addr</span>)
<span class="pl-k">if</span> <span class="pl-s1">err</span> <span class="pl-c1">!=</span> <span class="pl-c1">nil</span> {
<span class="pl-s1">t</span>.<span class="pl-en">Fatalf</span>(<span class="pl-s">"Failed to listen on %s: %v"</span>, <span class="pl-s1">addr</span>, <span class="pl-s1">err</span>)
}
<span class="pl-k">go</span> <span class="pl-k">func</span>(<span class="pl-s1">l</span> net.<span class="pl-smi">Listener</span>) {
<span class="pl-k">for</span> {
<span class="pl-s1">_</span>, <span class="pl-s1">err</span> <span class="pl-c1">:=</span> <span class="pl-s1">l</span>.<span class="pl-en">Accept</span>()
<span class="pl-k">if</span> <span class="pl-s1">err</span> <span class="pl-c1">!=</span> <span class="pl-c1">nil</span> {
<span class="pl-k">return</span>
}
}
}(<span class="pl-s1">l</span>)
<span class="pl-k">if</span> <span class="pl-s1">err</span> <span class="pl-c1">:=</span> <span class="pl-s1">l</span>.<span class="pl-en">Close</span>(); <span class="pl-s1">err</span> <span class="pl-c1">!=</span> <span class="pl-c1">nil</span> {
<span class="pl-s1">t</span>.<span class="pl-en">Fatalf</span>(<span class="pl-s">"Failed to close server: %v"</span>, <span class="pl-s1">err</span>)
}
}
}</pre></div>
<p dir="auto">Briefly, within a loop it Listens on tcp port 12345, invokes a goroutine that calls Accept on the listener, and then Closes the listener. My expectation was that this would always pass regardless of scheduler behavior or number of loop iterations as I expected Close() would only return once the underlying socket is no longer in use.</p>
<p dir="auto">Instead what I see is that it will sometimes pass, but often fails on the net.Listen call of subsequent loop iterations with an error that the address is already in use. I believe I understand the cause of the failure. netFD underlies the TCPListener and it's a reference counted object. A goroutine blocked on Accept will increment the reference count. Close() flips a flag on netFD to indicate the socket is considered closed which will make other netFD operations like Accept return errors indicating the socket is closed. The underlying OS socket is only closed once the reference count for the netFD has reached zero.</p>
<p dir="auto">The end result is that an OS socket is only closed after TCPListener.Close() is invoked AND all goroutines that are blocked in TCPListener.Accept() are scheduled and return the expected error condition. It seems like more intuitive behavior would be for TCPListener.Close() to immediately close the underlying OS socket, and goroutines blocked in TCPListener.Accept() to return errors whenever they were next scheduled/run.</p> | 1 |
<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.1</li>
<li>Operating System version: windows10</li>
<li>Java version: 1.8.0</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">I run the <a href="https://github.com/dubbo-x/example/tree/master/java-dubbo-consul">code</a>, which is copied from <a href="https://github.com/apache/dubbo-samples/tree/master/dubbo-samples-consul">dubbo-samples-consul</a>.</p>
<ol dir="auto">
<li>run the docker-compose.yml</li>
<li>run provider</li>
<li>run consumer</li>
</ol>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">Provider seems ok:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/16648345/59410921-a023a680-8dec-11e9-9e08-4e355e539e4f.png"><img src="https://user-images.githubusercontent.com/16648345/59410921-a023a680-8dec-11e9-9e08-4e355e539e4f.png" alt="provider" style="max-width: 100%;"></a></p>
<p dir="auto">Consumer fails with error:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/16648345/59410968-c0ebfc00-8dec-11e9-8a2e-3eeb25f1d78c.png"><img src="https://user-images.githubusercontent.com/16648345/59410968-c0ebfc00-8dec-11e9-8a2e-3eeb25f1d78c.png" alt="consumer" style="max-width: 100%;"></a></p>
<p dir="auto">So I check the status of service on consul:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/16648345/59410620-dc0a3c00-8deb-11e9-81a4-c5683655a610.png"><img src="https://user-images.githubusercontent.com/16648345/59410620-dc0a3c00-8deb-11e9-81a4-c5683655a610.png" alt="health_check1" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/16648345/59410629-e298b380-8deb-11e9-9223-1916262d1a54.png"><img src="https://user-images.githubusercontent.com/16648345/59410629-e298b380-8deb-11e9-9223-1916262d1a54.png" alt="health_check2" style="max-width: 100%;"></a></p>
<p dir="auto">It seems that health check fails, but direct connection to service without registry is ok.</p>
<p dir="auto">So is there anything that I do wrongly, or is there any difference on windows10?</p> | <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: latest</li>
</ul>
<h3 dir="auto">Step to reproduce this issue</h3>
<ol dir="auto">
<li>Config the protocol, but do not config the port parameter</li>
<li>Start the application integrating dubbo.</li>
</ol>
<p dir="auto">According the document, if user does not config the port of protocol, Dubbo will pick an available port that count from the default port dynamically.<br>
But the actual result is that Dubbo just pick the default port. It does not pick an available port dynamically.</p>
<p dir="auto">So should we modify the code or document ?</p> | 0 |
<p dir="auto">It's common case for continuous deployment to change elasticsearch's client and index independently. This leads to the case when <code class="notranslate">fieldValueFactorFunction</code> is added to the client but index is not rebuilt yet. I use <code class="notranslate">missing</code> property. Unfortunately <a href="https://github.com/elastic/elasticsearch/blob/528f6481eaadd2a0585dc6731a94d7a024b8ce29/src/main/java/org/elasticsearch/index/query/functionscore/fieldvaluefactor/FieldValueFactorFunctionParser.java#L89">FieldValueFactorFunctionParser</a> demands to have a field in a mapping, it throws exception otherwise. This means we can't deploy an client before index is updated despite having <code class="notranslate">missing</code> property set. The suggestion here is to look as <code class="notranslate">missing</code> in case of field in the document or mapping are missing.</p> | <p dir="auto">In the snippet below, index <code class="notranslate">analyzertest1</code> has an analyzer defined with <code class="notranslate">filters</code>, and <code class="notranslate">analyzertest2</code> - with <code class="notranslate">filter</code>. The latter works, the former doesn't (see also <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="131365326" data-permission-text="Title is private" data-url="https://github.com/elastic/elasticsearch/issues/16451" data-hovercard-type="issue" data-hovercard-url="/elastic/elasticsearch/issues/16451/hovercard" href="https://github.com/elastic/elasticsearch/issues/16451">#16451</a>).</p>
<p dir="auto">When I specify filters inline, the situation is reversed: <code class="notranslate">filters</code> works, <code class="notranslate">filter</code> doesn't.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="post analyzertest1
{
"settings": {
"analysis": {
"analyzer": {
"my_analyzer": {
"tokenizer": "standard",
"filters": ["lowercase"]
}
}
}
}
}
post analyzertest1/_analyze
{
"analyzer": "my_analyzer", "text": "ABCD"
}
// Result: "ABCD"
post analyzertest2
{
"settings": {
"analysis": {
"analyzer": {
"my_analyzer": {
"tokenizer": "standard",
"filter": ["lowercase", "stop"]
}
}
}
}
}
post analyzertest2/_analyze
{
"analyzer": "my_analyzer", "text": "ABCD"
}
// Result: "abcd"
post _analyze
{
"tokenizer": "standard",
"filter": ["lowercase"],
"text": "ABCD"
}
// Result: error "unknown parameter [filter]"
post _analyze
{
"tokenizer": "standard",
"filters": ["lowercase"],
"text": "ABCD"
}
// Result: "abcd""><pre class="notranslate"><code class="notranslate">post analyzertest1
{
"settings": {
"analysis": {
"analyzer": {
"my_analyzer": {
"tokenizer": "standard",
"filters": ["lowercase"]
}
}
}
}
}
post analyzertest1/_analyze
{
"analyzer": "my_analyzer", "text": "ABCD"
}
// Result: "ABCD"
post analyzertest2
{
"settings": {
"analysis": {
"analyzer": {
"my_analyzer": {
"tokenizer": "standard",
"filter": ["lowercase", "stop"]
}
}
}
}
}
post analyzertest2/_analyze
{
"analyzer": "my_analyzer", "text": "ABCD"
}
// Result: "abcd"
post _analyze
{
"tokenizer": "standard",
"filter": ["lowercase"],
"text": "ABCD"
}
// Result: error "unknown parameter [filter]"
post _analyze
{
"tokenizer": "standard",
"filters": ["lowercase"],
"text": "ABCD"
}
// Result: "abcd"
</code></pre></div> | 0 |
<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: YES</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: CentOS 7.2 (and also Windows 10)</li>
<li><strong>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device</strong>: N/A</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: binary (via <code class="notranslate">pip install tensorflow-gpu</code>)</li>
<li><strong>TensorFlow version (use command below)</strong>: v1.11.0-0-gc19e29306c 1.11.0</li>
<li><strong>Python version</strong>: 3.6.6</li>
<li><strong>Bazel version (if compiling from source)</strong>: N/A</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>: N/A</li>
<li><strong>CUDA/cuDNN version</strong>: 9.0/7.1.4</li>
<li><strong>GPU model and memory</strong>: NVIDIA GeForce GTX 1070 (8 GiB)</li>
<li><strong>Exact command to reproduce</strong>: <code class="notranslate">python nmsstest.py</code>; see below for the content of <code class="notranslate">nmstest.py</code></li>
</ul>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">The code in the following section, which calls <code class="notranslate">tf.image.non_max_suppression()</code> in <code class="notranslate">tf.while_loop()</code> many times, crashes abnormally.<br>
Crash reason (and loop count) varies from time to time, for example:</p>
<ul dir="auto">
<li><code class="notranslate">F tensorflow/core/common_runtime/bfc_allocator.cc:384] Check failed: h != kInvalidChunkHandle</code> at loop <code class="notranslate">i == 140</code></li>
<li><code class="notranslate">F tensorflow/core/common_runtime/bfc_allocator.cc:462] Check failed: c->in_use() && (c->bin_num == kInvalidBinNum)</code> at loop <code class="notranslate">i == 76</code></li>
<li><code class="notranslate">Bus error</code> at loop <code class="notranslate">i == 34</code></li>
<li>heap corruption reported by libc (see the following section) at loop <code class="notranslate">i == 35</code></li>
<li>sometimes it crashes sliently without any logs (on Windows)</li>
</ul>
<p dir="auto">I notice that:</p>
<ul dir="auto">
<li>it's since TensorFlow 1.11.0rc0; TF 1.10.1 was okay</li>
<li>it also reproduces on Windows</li>
<li>it also reproduces on CPU version (<code class="notranslate">pip install tensorflow</code>)</li>
<li>it does <strong>not</strong> reproduce if <code class="notranslate">num_threads=1</code>; calling <code class="notranslate">tf.image.non_max_suppression()</code> in parallel seems the trigger</li>
<li>even when I gave a fixed seed to <code class="notranslate">tf.random_uniform()</code>, crash cause varied</li>
</ul>
<h3 dir="auto">Source code / logs</h3>
<p dir="auto">The code to reproduce the problem is as follows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import tensorflow as tf
if __name__ == '__main__':
# crashes iff num_threads > 1 on TensorFlow >= 1.11.rc0
num_threads = 10
top_k = 1
batch_size = 32
num_boxes = 10000
boxes_op = tf.random_uniform((batch_size,num_boxes,4), 0, 1)
scores_op = tf.random_uniform((batch_size,num_boxes), 0, 1)
indices_op = tf.while_loop(
(lambda b, ta: True),
(lambda b, ta: (b+1, ta.write(b, tf.image.non_max_suppression(boxes_op[b], scores_op[b], top_k, iou_threshold=0.3)))),
(tf.constant(0),
tf.TensorArray(tf.int32, size=batch_size, infer_shape=False, element_shape=(top_k,))),
back_prop=False,
parallel_iterations=num_threads,
maximum_iterations=batch_size)[1].stack()
with tf.Session() as session:
for i in range(1000):
indices = session.run(indices_op)
print(f'#{i}: {indices.shape}')"><pre class="notranslate"><code class="notranslate">import tensorflow as tf
if __name__ == '__main__':
# crashes iff num_threads > 1 on TensorFlow >= 1.11.rc0
num_threads = 10
top_k = 1
batch_size = 32
num_boxes = 10000
boxes_op = tf.random_uniform((batch_size,num_boxes,4), 0, 1)
scores_op = tf.random_uniform((batch_size,num_boxes), 0, 1)
indices_op = tf.while_loop(
(lambda b, ta: True),
(lambda b, ta: (b+1, ta.write(b, tf.image.non_max_suppression(boxes_op[b], scores_op[b], top_k, iou_threshold=0.3)))),
(tf.constant(0),
tf.TensorArray(tf.int32, size=batch_size, infer_shape=False, element_shape=(top_k,))),
back_prop=False,
parallel_iterations=num_threads,
maximum_iterations=batch_size)[1].stack()
with tf.Session() as session:
for i in range(1000):
indices = session.run(indices_op)
print(f'#{i}: {indices.shape}')
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python nmstest.py
2018-09-28 13:18:42.760545: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-09-28 13:18:43.123328: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:964] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-09-28 13:18:43.124208: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1411] Found device 0 with properties:
name: GeForce GTX 1070 major: 6 minor: 1 memoryClockRate(GHz): 1.683
pciBusID: 0000:01:00.0
totalMemory: 7.93GiB freeMemory: 7.83GiB
2018-09-28 13:18:43.124232: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1490] Adding visible gpu devices: 0
2018-09-28 13:18:43.351813: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-09-28 13:18:43.351847: I tensorflow/core/common_runtime/gpu/gpu_device.cc:977] 0
2018-09-28 13:18:43.351859: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0: N
2018-09-28 13:18:43.352078: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1103] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7558 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1070, pci bus id: 0000:01:00.0, compute capability: 6.1)
#0: (32, 1)
#1: (32, 1)
#2: (32, 1)
#3: (32, 1)
#4: (32, 1)
#5: (32, 1)
#6: (32, 1)
#7: (32, 1)
#8: (32, 1)
#9: (32, 1)
#10: (32, 1)
#11: (32, 1)
#12: (32, 1)
#13: (32, 1)
#14: (32, 1)
#15: (32, 1)
#16: (32, 1)
#17: (32, 1)
#18: (32, 1)
#19: (32, 1)
#20: (32, 1)
#21: (32, 1)
#22: (32, 1)
#23: (32, 1)
#24: (32, 1)
#25: (32, 1)
#26: (32, 1)
#27: (32, 1)
#28: (32, 1)
#29: (32, 1)
#30: (32, 1)
#31: (32, 1)
#32: (32, 1)
#33: (32, 1)
#34: (32, 1)
#35: (32, 1)
*** Error in `python': malloc(): smallbin double linked list corrupted: 0x00007fb6c001c960 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7f5e4)[0x7fb9816b75e4]
/lib64/libc.so.6(+0x82d00)[0x7fb9816bad00]
/lib64/libc.so.6(__libc_malloc+0x4c)[0x7fb9816bd84c]
/home/hyabe/anaconda3/envs/work/bin/../lib/libstdc++.so.6(_Znwm+0x16)[0x7fb936087084]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(_ZN10tensorflow15OpKernelContext15allocate_outputEiRKNS_11TensorShapeEPPNS_6TensorENS_19AllocatorAttributesE+0x48)[0x7fb93f0c0608]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(_ZN10tensorflow15OpKernelContext15allocate_outputEiRKNS_11TensorShapeEPPNS_6TensorE+0xc5)[0x7fb93f0c0785]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so(_ZN10tensorflow7MergeOp7ComputeEPNS_15OpKernelContextE+0xa4)[0x7fb9423854b4]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(_ZN10tensorflow13BaseGPUDevice13ComputeHelperEPNS_8OpKernelEPNS_15OpKernelContextE+0x37d)[0x7fb93f23ac9d]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(_ZN10tensorflow13BaseGPUDevice7ComputeEPNS_8OpKernelEPNS_15OpKernelContextE+0x8d)[0x7fb93f23b1dd]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(+0x63a4bc)[0x7fb93f2844bc]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(+0x63ae2a)[0x7fb93f284e2a]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(_ZN5Eigen26NonBlockingThreadPoolTemplIN10tensorflow6thread16EigenEnvironmentEE10WorkerLoopEi+0x21a)[0x7fb93f2f296a]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(_ZNSt17_Function_handlerIFvvEZN10tensorflow6thread16EigenEnvironment12CreateThreadESt8functionIS0_EEUlvE_E9_M_invokeERKSt9_Any_data+0x32)[0x7fb93f2f1a12]
/home/hyabe/anaconda3/envs/work/bin/../lib/libstdc++.so.6(+0xb8678)[0x7fb9360a2678]
/lib64/libpthread.so.0(+0x7e25)[0x7fb981a0ce25]
/lib64/libc.so.6(clone+0x6d)[0x7fb981736bad]
======= Memory map: ========
200000000-200200000 rw-s 00000000 00:05 25687 /dev/nvidiactl
200200000-200400000 ---p 00000000 00:00 0
200400000-200404000 rw-s 00000000 00:05 25687 /dev/nvidiactl
200404000-200600000 ---p 00000000 00:00 0
200600000-200a00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
200a00000-201200000 ---p 00000000 00:00 0
201200000-201204000 rw-s 00000000 00:05 25687 /dev/nvidiactl
201204000-201400000 ---p 00000000 00:00 0
201400000-201800000 rw-s 00000000 00:05 25687 /dev/nvidiactl
201800000-201804000 rw-s 00000000 00:05 25687 /dev/nvidiactl
201804000-201a00000 ---p 00000000 00:00 0
201a00000-201e00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
201e00000-201e04000 rw-s 00000000 00:05 25687 /dev/nvidiactl
201e04000-202000000 ---p 00000000 00:00 0
202000000-202400000 rw-s 00000000 00:05 25687 /dev/nvidiactl
202400000-202404000 rw-s 00000000 00:05 25687 /dev/nvidiactl
202404000-202600000 ---p 00000000 00:00 0
202600000-202a00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
202a00000-202a04000 rw-s 00000000 00:05 25687 /dev/nvidiactl
202a04000-202c00000 ---p 00000000 00:00 0
202c00000-203000000 rw-s 00000000 00:05 25687 /dev/nvidiactl
203000000-203004000 rw-s 00000000 00:05 25687 /dev/nvidiactl
203004000-203200000 ---p 00000000 00:00 0
203200000-203600000 rw-s 00000000 00:05 25687 /dev/nvidiactl
203600000-203604000 rw-s 00000000 00:05 25687 /dev/nvidiactl
203604000-203800000 ---p 00000000 00:00 0
203800000-203c00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
203c00000-203c04000 rw-s 00000000 00:05 25687 /dev/nvidiactl
203c04000-203e00000 ---p 00000000 00:00 0
203e00000-204200000 rw-s 00000000 00:05 25687 /dev/nvidiactl
204200000-204204000 rw-s 00000000 00:05 25687 /dev/nvidiactl
204204000-204400000 ---p 00000000 00:00 0
204400000-204800000 rw-s 00000000 00:05 25687 /dev/nvidiactl
204800000-204804000 rw-s 00000000 00:05 25687 /dev/nvidiactl
204804000-204a00000 ---p 00000000 00:00 0
204a00000-204e00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
204e00000-204e04000 rw-s 00000000 00:05 25687 /dev/nvidiactl
204e04000-205000000 ---p 00000000 00:00 0
205000000-205400000 rw-s 00000000 00:05 25687 /dev/nvidiactl
205400000-205404000 rw-s 00000000 00:05 25687 /dev/nvidiactl
205404000-205600000 ---p 00000000 00:00 0
205600000-205a00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
205a00000-205a04000 rw-s 00000000 00:05 25687 /dev/nvidiactl
205a04000-205c00000 ---p 00000000 00:00 0
205c00000-206000000 rw-s 00000000 00:05 25687 /dev/nvidiactl
206000000-206004000 rw-s 00000000 00:05 25687 /dev/nvidiactl
206004000-206200000 ---p 00000000 00:00 0
206200000-206600000 rw-s 00000000 00:05 25687 /dev/nvidiactl
206600000-206604000 rw-s 00000000 00:05 25687 /dev/nvidiactl
206604000-206800000 ---p 00000000 00:00 0
206800000-206c00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
206c00000-206e00000 ---p 00000000 00:00 0
206e00000-207000000 rw-s 00000000 00:05 25687 /dev/nvidiactl
207000000-300200000 ---p 00000000 00:00 0
10000000000-10204000000 ---p 00000000 00:00 0
5596eb5dd000-5596eb89c000 r-xp 00000000 fd:02 86155766 /home/hyabe/anaconda3/envs/work/bin/python3.6
5596eba9c000-5596eba9f000 r--p 002bf000 fd:02 86155766 /home/hyabe/anaconda3/envs/work/bin/python3.6
5596eba9f000-5596ebb02000 rw-p 002c2000 fd:02 86155766 /home/hyabe/anaconda3/envs/work/bin/python3.6
5596ebb02000-5596ebb33000 rw-p 00000000 00:00 0
5596eda67000-5597016ee000 rw-p 00000000 00:00 0 [heap]
7fb698000000-7fb69803a000 rw-p 00000000 00:00 0
7fb69803a000-7fb69c000000 ---p 00000000 00:00 0
7fb69c000000-7fb69c021000 rw-p 00000000 00:00 0
7fb69c021000-7fb6a0000000 ---p 00000000 00:00 0
7fb6a0000000-7fb6a0036000 rw-p 00000000 00:00 0
7fb6a0036000-7fb6a4000000 ---p 00000000 00:00 0
7fb6a4000000-7fb6a4049000 rw-p 00000000 00:00 0
7fb6a4049000-7fb6a8000000 ---p 00000000 00:00 0
7fb6a8000000-7fb6a8039000 rw-p 00000000 00:00 0
7fb6a8039000-7fb6ac000000 ---p 00000000 00:00 0
7fb6b0000000-7fb6b0036000 rw-p 00000000 00:00 0
7fb6b0036000-7fb6b4000000 ---p 00000000 00:00 0
7fb6b4000000-7fb6b403b000 rw-p 00000000 00:00 0
7fb6b403b000-7fb6b8000000 ---p 00000000 00:00 0
7fb6b8000000-7fb6b8037000 rw-p 00000000 00:00 0
7fb6b8037000-7fb6bc000000 ---p 00000000 00:00 0
7fb6c0000000-7fb6c003c000 rw-p 00000000 00:00 0
7fb6c003c000-7fb6c4000000 ---p 00000000 00:00 0
7fb6c5400000-7fb6c5a00000 rw-p 00000000 00:00 0
7fb6c5ad4000-7fb6c5ad5000 ---p 00000000 00:00 0
7fb6c5ad5000-7fb6c6326000 rw-p 00000000 00:00 0
7fb6c6326000-7fb6c6327000 ---p 00000000 00:00 0
7fb6c6327000-7fb6c6b78000 rw-p 00000000 00:00 0
7fb6c6b78000-7fb6c6b79000 ---p 00000000 00:00 0
7fb6c6b79000-7fb6d6000000 rw-p 00000000 00:00 0
7fb6d6000000-7fb8ae800000 ---p 00000000 00:00 0
7fb8ae800000-7fb8aea00000 rw-s 00000000 00:04 31968 /dev/zero (deleted)
7fb8aea00000-7fb8aec00000 rw-s 00000000 00:04 29039 /dev/zero (deleted)
7fb8aec00000-7fb8b0000000 ---p 00000000 00:00 0
7fb8b0000000-7fb8b0021000 rw-p 00000000 00:00 0
7fb8b0021000-7fb8b4000000 ---p 00000000 00:00 0
7fb8b4000000-7fb8b4021000 rw-p 00000000 00:00 0
7fb8b4021000-7fb8b8000000 ---p 00000000 00:00 0
7fb8b8000000-7fb8bc000000 ---p 00000000 00:00 0
7fb8bc000000-7fb8bc021000 rw-p 00000000 00:00 0
7fb8bc021000-7fb8c0000000 ---p 00000000 00:00 0
7fb8c0000000-7fb8c0001000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0001000-7fb8c0002000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0002000-7fb8c0003000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0003000-7fb8c0004000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0004000-7fb8c0005000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0005000-7fb8c0006000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0006000-7fb8c0007000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0007000-7fb8c0008000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0008000-7fb8c0009000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0009000-7fb8c000a000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c000a000-7fb8c000b000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c000b000-7fb8c000c000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c000c000-7fb8c000d000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c000d000-7fb8c000e000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c000e000-7fb8c000f000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c000f000-7fb8c0010000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0010000-7fb8d0000000 ---p 00000000 00:00 0
7fb8d0000000-7fb8d0021000 rw-p 00000000 00:00 0
7fb8d0021000-7fb8d4000000 ---p 00000000 00:00 0
7fb8d4200000-7fb8d4600000 rw-p 00000000 00:00 0
7fb8d470a000-7fb8d470b000 ---p 00000000 00:00 0
7fb8d470b000-7fb8d4f5c000 rw-p 00000000 00:00 0
7fb8d4f5c000-7fb8d4f5d000 ---p 00000000 00:00 0
7fb8d4f5d000-7fb8d57ae000 rw-p 00000000 00:00 0
7fb8d57ae000-7fb8d57af000 ---p 00000000 00:00 0
7fb8d57af000-7fb8d6000000 rw-p 00000000 00:00 0
7fb8d6000000-7fb8d6200000 ---p 00000000 00:00 0
7fb8d6200000-7fb8d6400000 rw-s 00000000 00:04 31965 /dev/zero (deleted)
7fb8d6400000-7fb8d6600000 rw-s 00000000 00:05 25687 /dev/nvidiactl
7fb8d6600000-7fb8d6800000 rw-s 00000000 00:04 31966 /dev/zero (deleted)
7fb8d6800000-7fb8d6a00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
7fb8d6a00000-7fb8d6c00000 ---p 00000000 00:00 0
7fb8d6c00000-7fb8d6ed6000 rw-s 00000000 00:05 25687 /dev/nvidiactl
7fb8d6ed6000-7fb8d8000000 ---p 00000000 00:00 0
7fb8d8000000-7fb8d8021000 rw-p 00000000 00:00 0
7fb8d8021000-7fb8dc000000 ---p 00000000 00:00 0
7fb8dc200000-7fb8dc600000 rw-p 00000000 00:00 0
7fb8dc70a000-7fb8dc70b000 ---p 00000000 00:00 0
7fb8dc70b000-7fb8dcf5c000 rw-p 00000000 00:00 0
7fb8dcf5c000-7fb8dcf5d000 ---p 00000000 00:00 0
7fb8dcf5d000-7fb8dd7ae000 rw-p 00000000 00:00 0
7fb8dd7ae000-7fb8dd7af000 ---p 00000000 00:00 0
7fb8dd7af000-7fb8de000000 rw-p 00000000 00:00 0
7fb8de000000-7fb8e4000000 ---p 00000000 00:00 0
7fb8e4000000-7fb8e4021000 rw-p 00000000 00:00 0
7fb8e4021000-7fb8e8000000 ---p 00000000 00:00 0
7fb8e8000000-7fb8e8021000 rw-p 00000000 00:00 0
7fb8e8021000-7fb8ec000000 ---p 00000000 00:00 0
7fb8ec000000-7fb8ec021000 rw-p 00000000 00:00 0
7fb8ec021000-7fb8f0000000 ---p 00000000 00:00 0
7fb8f0000000-7fb8f0021000 rw-p 00000000 00:00 0
7fb8f0021000-7fb8f4000000 ---p 00000000 00:00 0
7fb8f4200000-7fb8f4400000 rw-p 00000000 00:00 0
7fb8f45c2000-7fb8f45c3000 ---p 00000000 00:00 0
7fb8f45c3000-7fb8f4e14000 rw-p 00000000 00:00 0
7fb8f4e14000-7fb8f4e15000 ---p 00000000 00:00 0
7fb8f4e15000-7fb8f5666000 rw-p 00000000 00:00 0
7fb8f5666000-7fb8f5667000 ---p 00000000 00:00 0
7fb8f5667000-7fb8f5eb8000 rw-p 00000000 00:00 0
7fb8f5eb8000-7fb8f5eb9000 ---p 00000000 00:00 0
7fb8f5eb9000-7fb8f670a000 rw-p 00000000 00:00 0
7fb8f670a000-7fb8f670b000 ---p 00000000 00:00 0
7fb8f670b000-7fb8f6f5c000 rw-p 00000000 00:00 0
7fb8f6f5c000-7fb8f6f5d000 ---p 00000000 00:00 0
7fb8f6f5d000-7fb8f77ae000 rw-p 00000000 00:00 0
7fb8f77ae000-7fb8f77af00Aborted"><pre class="notranslate"><code class="notranslate">$ python nmstest.py
2018-09-28 13:18:42.760545: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-09-28 13:18:43.123328: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:964] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-09-28 13:18:43.124208: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1411] Found device 0 with properties:
name: GeForce GTX 1070 major: 6 minor: 1 memoryClockRate(GHz): 1.683
pciBusID: 0000:01:00.0
totalMemory: 7.93GiB freeMemory: 7.83GiB
2018-09-28 13:18:43.124232: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1490] Adding visible gpu devices: 0
2018-09-28 13:18:43.351813: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-09-28 13:18:43.351847: I tensorflow/core/common_runtime/gpu/gpu_device.cc:977] 0
2018-09-28 13:18:43.351859: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0: N
2018-09-28 13:18:43.352078: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1103] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7558 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1070, pci bus id: 0000:01:00.0, compute capability: 6.1)
#0: (32, 1)
#1: (32, 1)
#2: (32, 1)
#3: (32, 1)
#4: (32, 1)
#5: (32, 1)
#6: (32, 1)
#7: (32, 1)
#8: (32, 1)
#9: (32, 1)
#10: (32, 1)
#11: (32, 1)
#12: (32, 1)
#13: (32, 1)
#14: (32, 1)
#15: (32, 1)
#16: (32, 1)
#17: (32, 1)
#18: (32, 1)
#19: (32, 1)
#20: (32, 1)
#21: (32, 1)
#22: (32, 1)
#23: (32, 1)
#24: (32, 1)
#25: (32, 1)
#26: (32, 1)
#27: (32, 1)
#28: (32, 1)
#29: (32, 1)
#30: (32, 1)
#31: (32, 1)
#32: (32, 1)
#33: (32, 1)
#34: (32, 1)
#35: (32, 1)
*** Error in `python': malloc(): smallbin double linked list corrupted: 0x00007fb6c001c960 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7f5e4)[0x7fb9816b75e4]
/lib64/libc.so.6(+0x82d00)[0x7fb9816bad00]
/lib64/libc.so.6(__libc_malloc+0x4c)[0x7fb9816bd84c]
/home/hyabe/anaconda3/envs/work/bin/../lib/libstdc++.so.6(_Znwm+0x16)[0x7fb936087084]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(_ZN10tensorflow15OpKernelContext15allocate_outputEiRKNS_11TensorShapeEPPNS_6TensorENS_19AllocatorAttributesE+0x48)[0x7fb93f0c0608]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(_ZN10tensorflow15OpKernelContext15allocate_outputEiRKNS_11TensorShapeEPPNS_6TensorE+0xc5)[0x7fb93f0c0785]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so(_ZN10tensorflow7MergeOp7ComputeEPNS_15OpKernelContextE+0xa4)[0x7fb9423854b4]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(_ZN10tensorflow13BaseGPUDevice13ComputeHelperEPNS_8OpKernelEPNS_15OpKernelContextE+0x37d)[0x7fb93f23ac9d]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(_ZN10tensorflow13BaseGPUDevice7ComputeEPNS_8OpKernelEPNS_15OpKernelContextE+0x8d)[0x7fb93f23b1dd]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(+0x63a4bc)[0x7fb93f2844bc]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(+0x63ae2a)[0x7fb93f284e2a]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(_ZN5Eigen26NonBlockingThreadPoolTemplIN10tensorflow6thread16EigenEnvironmentEE10WorkerLoopEi+0x21a)[0x7fb93f2f296a]
/home/hyabe/anaconda3/envs/work/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so(_ZNSt17_Function_handlerIFvvEZN10tensorflow6thread16EigenEnvironment12CreateThreadESt8functionIS0_EEUlvE_E9_M_invokeERKSt9_Any_data+0x32)[0x7fb93f2f1a12]
/home/hyabe/anaconda3/envs/work/bin/../lib/libstdc++.so.6(+0xb8678)[0x7fb9360a2678]
/lib64/libpthread.so.0(+0x7e25)[0x7fb981a0ce25]
/lib64/libc.so.6(clone+0x6d)[0x7fb981736bad]
======= Memory map: ========
200000000-200200000 rw-s 00000000 00:05 25687 /dev/nvidiactl
200200000-200400000 ---p 00000000 00:00 0
200400000-200404000 rw-s 00000000 00:05 25687 /dev/nvidiactl
200404000-200600000 ---p 00000000 00:00 0
200600000-200a00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
200a00000-201200000 ---p 00000000 00:00 0
201200000-201204000 rw-s 00000000 00:05 25687 /dev/nvidiactl
201204000-201400000 ---p 00000000 00:00 0
201400000-201800000 rw-s 00000000 00:05 25687 /dev/nvidiactl
201800000-201804000 rw-s 00000000 00:05 25687 /dev/nvidiactl
201804000-201a00000 ---p 00000000 00:00 0
201a00000-201e00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
201e00000-201e04000 rw-s 00000000 00:05 25687 /dev/nvidiactl
201e04000-202000000 ---p 00000000 00:00 0
202000000-202400000 rw-s 00000000 00:05 25687 /dev/nvidiactl
202400000-202404000 rw-s 00000000 00:05 25687 /dev/nvidiactl
202404000-202600000 ---p 00000000 00:00 0
202600000-202a00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
202a00000-202a04000 rw-s 00000000 00:05 25687 /dev/nvidiactl
202a04000-202c00000 ---p 00000000 00:00 0
202c00000-203000000 rw-s 00000000 00:05 25687 /dev/nvidiactl
203000000-203004000 rw-s 00000000 00:05 25687 /dev/nvidiactl
203004000-203200000 ---p 00000000 00:00 0
203200000-203600000 rw-s 00000000 00:05 25687 /dev/nvidiactl
203600000-203604000 rw-s 00000000 00:05 25687 /dev/nvidiactl
203604000-203800000 ---p 00000000 00:00 0
203800000-203c00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
203c00000-203c04000 rw-s 00000000 00:05 25687 /dev/nvidiactl
203c04000-203e00000 ---p 00000000 00:00 0
203e00000-204200000 rw-s 00000000 00:05 25687 /dev/nvidiactl
204200000-204204000 rw-s 00000000 00:05 25687 /dev/nvidiactl
204204000-204400000 ---p 00000000 00:00 0
204400000-204800000 rw-s 00000000 00:05 25687 /dev/nvidiactl
204800000-204804000 rw-s 00000000 00:05 25687 /dev/nvidiactl
204804000-204a00000 ---p 00000000 00:00 0
204a00000-204e00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
204e00000-204e04000 rw-s 00000000 00:05 25687 /dev/nvidiactl
204e04000-205000000 ---p 00000000 00:00 0
205000000-205400000 rw-s 00000000 00:05 25687 /dev/nvidiactl
205400000-205404000 rw-s 00000000 00:05 25687 /dev/nvidiactl
205404000-205600000 ---p 00000000 00:00 0
205600000-205a00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
205a00000-205a04000 rw-s 00000000 00:05 25687 /dev/nvidiactl
205a04000-205c00000 ---p 00000000 00:00 0
205c00000-206000000 rw-s 00000000 00:05 25687 /dev/nvidiactl
206000000-206004000 rw-s 00000000 00:05 25687 /dev/nvidiactl
206004000-206200000 ---p 00000000 00:00 0
206200000-206600000 rw-s 00000000 00:05 25687 /dev/nvidiactl
206600000-206604000 rw-s 00000000 00:05 25687 /dev/nvidiactl
206604000-206800000 ---p 00000000 00:00 0
206800000-206c00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
206c00000-206e00000 ---p 00000000 00:00 0
206e00000-207000000 rw-s 00000000 00:05 25687 /dev/nvidiactl
207000000-300200000 ---p 00000000 00:00 0
10000000000-10204000000 ---p 00000000 00:00 0
5596eb5dd000-5596eb89c000 r-xp 00000000 fd:02 86155766 /home/hyabe/anaconda3/envs/work/bin/python3.6
5596eba9c000-5596eba9f000 r--p 002bf000 fd:02 86155766 /home/hyabe/anaconda3/envs/work/bin/python3.6
5596eba9f000-5596ebb02000 rw-p 002c2000 fd:02 86155766 /home/hyabe/anaconda3/envs/work/bin/python3.6
5596ebb02000-5596ebb33000 rw-p 00000000 00:00 0
5596eda67000-5597016ee000 rw-p 00000000 00:00 0 [heap]
7fb698000000-7fb69803a000 rw-p 00000000 00:00 0
7fb69803a000-7fb69c000000 ---p 00000000 00:00 0
7fb69c000000-7fb69c021000 rw-p 00000000 00:00 0
7fb69c021000-7fb6a0000000 ---p 00000000 00:00 0
7fb6a0000000-7fb6a0036000 rw-p 00000000 00:00 0
7fb6a0036000-7fb6a4000000 ---p 00000000 00:00 0
7fb6a4000000-7fb6a4049000 rw-p 00000000 00:00 0
7fb6a4049000-7fb6a8000000 ---p 00000000 00:00 0
7fb6a8000000-7fb6a8039000 rw-p 00000000 00:00 0
7fb6a8039000-7fb6ac000000 ---p 00000000 00:00 0
7fb6b0000000-7fb6b0036000 rw-p 00000000 00:00 0
7fb6b0036000-7fb6b4000000 ---p 00000000 00:00 0
7fb6b4000000-7fb6b403b000 rw-p 00000000 00:00 0
7fb6b403b000-7fb6b8000000 ---p 00000000 00:00 0
7fb6b8000000-7fb6b8037000 rw-p 00000000 00:00 0
7fb6b8037000-7fb6bc000000 ---p 00000000 00:00 0
7fb6c0000000-7fb6c003c000 rw-p 00000000 00:00 0
7fb6c003c000-7fb6c4000000 ---p 00000000 00:00 0
7fb6c5400000-7fb6c5a00000 rw-p 00000000 00:00 0
7fb6c5ad4000-7fb6c5ad5000 ---p 00000000 00:00 0
7fb6c5ad5000-7fb6c6326000 rw-p 00000000 00:00 0
7fb6c6326000-7fb6c6327000 ---p 00000000 00:00 0
7fb6c6327000-7fb6c6b78000 rw-p 00000000 00:00 0
7fb6c6b78000-7fb6c6b79000 ---p 00000000 00:00 0
7fb6c6b79000-7fb6d6000000 rw-p 00000000 00:00 0
7fb6d6000000-7fb8ae800000 ---p 00000000 00:00 0
7fb8ae800000-7fb8aea00000 rw-s 00000000 00:04 31968 /dev/zero (deleted)
7fb8aea00000-7fb8aec00000 rw-s 00000000 00:04 29039 /dev/zero (deleted)
7fb8aec00000-7fb8b0000000 ---p 00000000 00:00 0
7fb8b0000000-7fb8b0021000 rw-p 00000000 00:00 0
7fb8b0021000-7fb8b4000000 ---p 00000000 00:00 0
7fb8b4000000-7fb8b4021000 rw-p 00000000 00:00 0
7fb8b4021000-7fb8b8000000 ---p 00000000 00:00 0
7fb8b8000000-7fb8bc000000 ---p 00000000 00:00 0
7fb8bc000000-7fb8bc021000 rw-p 00000000 00:00 0
7fb8bc021000-7fb8c0000000 ---p 00000000 00:00 0
7fb8c0000000-7fb8c0001000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0001000-7fb8c0002000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0002000-7fb8c0003000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0003000-7fb8c0004000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0004000-7fb8c0005000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0005000-7fb8c0006000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0006000-7fb8c0007000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0007000-7fb8c0008000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0008000-7fb8c0009000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0009000-7fb8c000a000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c000a000-7fb8c000b000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c000b000-7fb8c000c000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c000c000-7fb8c000d000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c000d000-7fb8c000e000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c000e000-7fb8c000f000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c000f000-7fb8c0010000 rw-s 00000000 00:05 25688 /dev/nvidia0
7fb8c0010000-7fb8d0000000 ---p 00000000 00:00 0
7fb8d0000000-7fb8d0021000 rw-p 00000000 00:00 0
7fb8d0021000-7fb8d4000000 ---p 00000000 00:00 0
7fb8d4200000-7fb8d4600000 rw-p 00000000 00:00 0
7fb8d470a000-7fb8d470b000 ---p 00000000 00:00 0
7fb8d470b000-7fb8d4f5c000 rw-p 00000000 00:00 0
7fb8d4f5c000-7fb8d4f5d000 ---p 00000000 00:00 0
7fb8d4f5d000-7fb8d57ae000 rw-p 00000000 00:00 0
7fb8d57ae000-7fb8d57af000 ---p 00000000 00:00 0
7fb8d57af000-7fb8d6000000 rw-p 00000000 00:00 0
7fb8d6000000-7fb8d6200000 ---p 00000000 00:00 0
7fb8d6200000-7fb8d6400000 rw-s 00000000 00:04 31965 /dev/zero (deleted)
7fb8d6400000-7fb8d6600000 rw-s 00000000 00:05 25687 /dev/nvidiactl
7fb8d6600000-7fb8d6800000 rw-s 00000000 00:04 31966 /dev/zero (deleted)
7fb8d6800000-7fb8d6a00000 rw-s 00000000 00:05 25687 /dev/nvidiactl
7fb8d6a00000-7fb8d6c00000 ---p 00000000 00:00 0
7fb8d6c00000-7fb8d6ed6000 rw-s 00000000 00:05 25687 /dev/nvidiactl
7fb8d6ed6000-7fb8d8000000 ---p 00000000 00:00 0
7fb8d8000000-7fb8d8021000 rw-p 00000000 00:00 0
7fb8d8021000-7fb8dc000000 ---p 00000000 00:00 0
7fb8dc200000-7fb8dc600000 rw-p 00000000 00:00 0
7fb8dc70a000-7fb8dc70b000 ---p 00000000 00:00 0
7fb8dc70b000-7fb8dcf5c000 rw-p 00000000 00:00 0
7fb8dcf5c000-7fb8dcf5d000 ---p 00000000 00:00 0
7fb8dcf5d000-7fb8dd7ae000 rw-p 00000000 00:00 0
7fb8dd7ae000-7fb8dd7af000 ---p 00000000 00:00 0
7fb8dd7af000-7fb8de000000 rw-p 00000000 00:00 0
7fb8de000000-7fb8e4000000 ---p 00000000 00:00 0
7fb8e4000000-7fb8e4021000 rw-p 00000000 00:00 0
7fb8e4021000-7fb8e8000000 ---p 00000000 00:00 0
7fb8e8000000-7fb8e8021000 rw-p 00000000 00:00 0
7fb8e8021000-7fb8ec000000 ---p 00000000 00:00 0
7fb8ec000000-7fb8ec021000 rw-p 00000000 00:00 0
7fb8ec021000-7fb8f0000000 ---p 00000000 00:00 0
7fb8f0000000-7fb8f0021000 rw-p 00000000 00:00 0
7fb8f0021000-7fb8f4000000 ---p 00000000 00:00 0
7fb8f4200000-7fb8f4400000 rw-p 00000000 00:00 0
7fb8f45c2000-7fb8f45c3000 ---p 00000000 00:00 0
7fb8f45c3000-7fb8f4e14000 rw-p 00000000 00:00 0
7fb8f4e14000-7fb8f4e15000 ---p 00000000 00:00 0
7fb8f4e15000-7fb8f5666000 rw-p 00000000 00:00 0
7fb8f5666000-7fb8f5667000 ---p 00000000 00:00 0
7fb8f5667000-7fb8f5eb8000 rw-p 00000000 00:00 0
7fb8f5eb8000-7fb8f5eb9000 ---p 00000000 00:00 0
7fb8f5eb9000-7fb8f670a000 rw-p 00000000 00:00 0
7fb8f670a000-7fb8f670b000 ---p 00000000 00:00 0
7fb8f670b000-7fb8f6f5c000 rw-p 00000000 00:00 0
7fb8f6f5c000-7fb8f6f5d000 ---p 00000000 00:00 0
7fb8f6f5d000-7fb8f77ae000 rw-p 00000000 00:00 0
7fb8f77ae000-7fb8f77af00Aborted
</code></pre></div> | <h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>:yes</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: archlinux</li>
<li><strong>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device</strong>:n/a</li>
<li><strong>TensorFlow installed from (source or binary)</strong>:binary</li>
<li><strong>TensorFlow version (use command below)</strong>:b'v1.9.0-rc2-5276-ge57874169f' 1.12.0-dev20181004</li>
<li><strong>Python version</strong>:3.6</li>
<li><strong>Bazel version (if compiling from source)</strong>:n/a</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>:n/a</li>
<li><strong>CUDA/cuDNN version</strong>:9.0</li>
<li><strong>GPU model and memory</strong>:1080Ti</li>
<li><strong>Exact command to reproduce</strong>:below</li>
</ul>
<p dir="auto">This code:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import tensorflow as tf
import numpy as np
def f(boxes, scores):
def f(X):
prob, box = X
output_shape = tf.shape(prob)
ids = tf.reshape(tf.where(prob > 0.05), [-1])
prob = tf.gather(prob, ids)
box = tf.gather(box, ids)
# prob = tf.Print(prob, [box, prob], summarize=100, message='boxandprob')
selection = tf.image.non_max_suppression(box, prob, 100, 0.5)
selection = tf.to_int32(tf.gather(ids, selection))
selection = tf.Print(selection, [ids, selection], summarize=100, message='ids_selection_2')
sorted_selection = -tf.nn.top_k(-selection, k=tf.size(selection))[0]
mask = tf.sparse_to_dense(
sparse_indices=sorted_selection,
output_shape=output_shape,
sparse_values=True,
default_value=False)
return mask
masks = tf.map_fn(f, (scores, boxes), dtype=tf.bool, parallel_iterations=10) # #cat x N
return masks
with tf.device('/gpu:0'):
boxes = tf.placeholder(tf.float32, (80, None, 4), name='boxes')
scores = tf.placeholder(tf.float32, (80, None), name='scores')
outs = f(boxes, scores)
config = tf.ConfigProto()
config.allow_soft_placement = True
sess = tf.Session(config=config)
data = dict(np.load('debug.npz'))
for k in range(1000):
sess.run(outs, feed_dict={boxes: data['boxes'].transpose(1, 0, 2)[1:, :, :], scores: data['scores'][:, 1:].T})
print(k)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">tensorflow</span> <span class="pl-k">as</span> <span class="pl-s1">tf</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-k">def</span> <span class="pl-en">f</span>(<span class="pl-s1">boxes</span>, <span class="pl-s1">scores</span>):
<span class="pl-k">def</span> <span class="pl-en">f</span>(<span class="pl-v">X</span>):
<span class="pl-s1">prob</span>, <span class="pl-s1">box</span> <span class="pl-c1">=</span> <span class="pl-v">X</span>
<span class="pl-s1">output_shape</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">shape</span>(<span class="pl-s1">prob</span>)
<span class="pl-s1">ids</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">reshape</span>(<span class="pl-s1">tf</span>.<span class="pl-en">where</span>(<span class="pl-s1">prob</span> <span class="pl-c1">></span> <span class="pl-c1">0.05</span>), [<span class="pl-c1">-</span><span class="pl-c1">1</span>])
<span class="pl-s1">prob</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">gather</span>(<span class="pl-s1">prob</span>, <span class="pl-s1">ids</span>)
<span class="pl-s1">box</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">gather</span>(<span class="pl-s1">box</span>, <span class="pl-s1">ids</span>)
<span class="pl-c"># prob = tf.Print(prob, [box, prob], summarize=100, message='boxandprob')</span>
<span class="pl-s1">selection</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">image</span>.<span class="pl-en">non_max_suppression</span>(<span class="pl-s1">box</span>, <span class="pl-s1">prob</span>, <span class="pl-c1">100</span>, <span class="pl-c1">0.5</span>)
<span class="pl-s1">selection</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">to_int32</span>(<span class="pl-s1">tf</span>.<span class="pl-en">gather</span>(<span class="pl-s1">ids</span>, <span class="pl-s1">selection</span>))
<span class="pl-s1">selection</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-v">Print</span>(<span class="pl-s1">selection</span>, [<span class="pl-s1">ids</span>, <span class="pl-s1">selection</span>], <span class="pl-s1">summarize</span><span class="pl-c1">=</span><span class="pl-c1">100</span>, <span class="pl-s1">message</span><span class="pl-c1">=</span><span class="pl-s">'ids_selection_2'</span>)
<span class="pl-s1">sorted_selection</span> <span class="pl-c1">=</span> <span class="pl-c1">-</span><span class="pl-s1">tf</span>.<span class="pl-s1">nn</span>.<span class="pl-en">top_k</span>(<span class="pl-c1">-</span><span class="pl-s1">selection</span>, <span class="pl-s1">k</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-en">size</span>(<span class="pl-s1">selection</span>))[<span class="pl-c1">0</span>]
<span class="pl-s1">mask</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">sparse_to_dense</span>(
<span class="pl-s1">sparse_indices</span><span class="pl-c1">=</span><span class="pl-s1">sorted_selection</span>,
<span class="pl-s1">output_shape</span><span class="pl-c1">=</span><span class="pl-s1">output_shape</span>,
<span class="pl-s1">sparse_values</span><span class="pl-c1">=</span><span class="pl-c1">True</span>,
<span class="pl-s1">default_value</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)
<span class="pl-k">return</span> <span class="pl-s1">mask</span>
<span class="pl-s1">masks</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">map_fn</span>(<span class="pl-s1">f</span>, (<span class="pl-s1">scores</span>, <span class="pl-s1">boxes</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-s1">bool</span>, <span class="pl-s1">parallel_iterations</span><span class="pl-c1">=</span><span class="pl-c1">10</span>) <span class="pl-c"># #cat x N</span>
<span class="pl-k">return</span> <span class="pl-s1">masks</span>
<span class="pl-k">with</span> <span class="pl-s1">tf</span>.<span class="pl-en">device</span>(<span class="pl-s">'/gpu:0'</span>):
<span class="pl-s1">boxes</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">placeholder</span>(<span class="pl-s1">tf</span>.<span class="pl-s1">float32</span>, (<span class="pl-c1">80</span>, <span class="pl-c1">None</span>, <span class="pl-c1">4</span>), <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'boxes'</span>)
<span class="pl-s1">scores</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">placeholder</span>(<span class="pl-s1">tf</span>.<span class="pl-s1">float32</span>, (<span class="pl-c1">80</span>, <span class="pl-c1">None</span>), <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'scores'</span>)
<span class="pl-s1">outs</span> <span class="pl-c1">=</span> <span class="pl-en">f</span>(<span class="pl-s1">boxes</span>, <span class="pl-s1">scores</span>)
<span class="pl-s1">config</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-v">ConfigProto</span>()
<span class="pl-s1">config</span>.<span class="pl-s1">allow_soft_placement</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span>
<span class="pl-s1">sess</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-v">Session</span>(<span class="pl-s1">config</span><span class="pl-c1">=</span><span class="pl-s1">config</span>)
<span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-en">dict</span>(<span class="pl-s1">np</span>.<span class="pl-en">load</span>(<span class="pl-s">'debug.npz'</span>))
<span class="pl-k">for</span> <span class="pl-s1">k</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-c1">1000</span>):
<span class="pl-s1">sess</span>.<span class="pl-en">run</span>(<span class="pl-s1">outs</span>, <span class="pl-s1">feed_dict</span><span class="pl-c1">=</span>{<span class="pl-s1">boxes</span>: <span class="pl-s1">data</span>[<span class="pl-s">'boxes'</span>].<span class="pl-en">transpose</span>(<span class="pl-c1">1</span>, <span class="pl-c1">0</span>, <span class="pl-c1">2</span>)[<span class="pl-c1">1</span>:, :, :], <span class="pl-s1">scores</span>: <span class="pl-s1">data</span>[<span class="pl-s">'scores'</span>][:, <span class="pl-c1">1</span>:].<span class="pl-v">T</span>})
<span class="pl-en">print</span>(<span class="pl-s1">k</span>)</pre></div>
<p dir="auto">causes segmentation fault on tf-nightly-gpu, as well as tensorflow-gpu==1.11.0. It works on 1.10.<br>
It needs the data file <code class="notranslate">debug.npz</code> here:<br>
<a href="https://github.com/tensorflow/tensorflow/files/2448247/debug.zip">debug.zip</a></p>
<p dir="auto">Note:</p>
<ol dir="auto">
<li>I tested on two machines, an error happen in >90% runs.</li>
<li>The code was distilled from the bug report about MaskRCNN evaluation <a href="https://github.com/tensorpack/tensorpack/issues/919" data-hovercard-type="issue" data-hovercard-url="/tensorpack/tensorpack/issues/919/hovercard">here</a>. The original bug report does not always segfault, but occasionally crash with other <strong>different</strong> unreasonable TF internal errors, such as:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="InvalidArgumentError (see above for traceback): scores has incompatible shape
[[node map/while/non_max_suppression/NonMaxSuppressionV3 (defined at bug.py:15) = NonMaxSuppressionV3[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"](map/while/Gather
V2_1/_29, map/while/GatherV2/_31, map/while/non_max_suppression/NonMaxSuppressionV3/max_output_size/_33, map/while/non_max_suppression/iou_threshold/_35, map/while/non_max_suppression/score_thresh
old/_37)]]"><pre class="notranslate"><code class="notranslate">InvalidArgumentError (see above for traceback): scores has incompatible shape
[[node map/while/non_max_suppression/NonMaxSuppressionV3 (defined at bug.py:15) = NonMaxSuppressionV3[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"](map/while/Gather
V2_1/_29, map/while/GatherV2/_31, map/while/non_max_suppression/NonMaxSuppressionV3/max_output_size/_33, map/while/non_max_suppression/iou_threshold/_35, map/while/non_max_suppression/score_thresh
old/_37)]]
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2018-10-04 14:59:14.736180: F tensorflow/core/common_runtime/bfc_allocator.cc:458] Check failed: c->in_use() && (c->bin_num == kInvalidBinNum) "><pre class="notranslate"><code class="notranslate">2018-10-04 14:59:14.736180: F tensorflow/core/common_runtime/bfc_allocator.cc:458] Check failed: c->in_use() && (c->bin_num == kInvalidBinNum)
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2018-10-04 14:59:49.523436: F tensorflow/core/common_runtime/bfc_allocator.cc:380] Check failed: h != kInvalidChunkHandle "><pre class="notranslate"><code class="notranslate">2018-10-04 14:59:49.523436: F tensorflow/core/common_runtime/bfc_allocator.cc:380] Check failed: h != kInvalidChunkHandle
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2018-10-05 00:12:03.720295: F ./tensorflow/core/framework/tensor.h:643] Check failed: new_num_elements == NumElements() (39 vs. 0)"><pre class="notranslate"><code class="notranslate">2018-10-05 00:12:03.720295: F ./tensorflow/core/framework/tensor.h:643] Check failed: new_num_elements == NumElements() (39 vs. 0)
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
InvalidArgumentError (see above for traceback): indices[1] = [0] is repeated
[[{{node map/while/SparseToDense}} = SparseToDense[T=DT_BOOL, Tindices=DT_INT32, _class=["loc:@map/while/TensorArrayWrite/TensorArrayWriteV3"], validate_indices=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](map/while/Neg_1/_51, map/while/Shape/_53, map/while/SparseToDense/sparse_values/_55, map/while/SparseToDense/default_value/_57)]]
[[{{node map/while/SparseToDense/sparse_values/_54}} = _Send[T=DT_BOOL, client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_111_map/while/SparseToDense/sparse_values", _device="/job:localhost/replica:0/task:0/device:GPU:0"](map/while/SparseToDense/sparse_values)]]"><pre class="notranslate"><code class="notranslate">
InvalidArgumentError (see above for traceback): indices[1] = [0] is repeated
[[{{node map/while/SparseToDense}} = SparseToDense[T=DT_BOOL, Tindices=DT_INT32, _class=["loc:@map/while/TensorArrayWrite/TensorArrayWriteV3"], validate_indices=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](map/while/Neg_1/_51, map/while/Shape/_53, map/while/SparseToDense/sparse_values/_55, map/while/SparseToDense/default_value/_57)]]
[[{{node map/while/SparseToDense/sparse_values/_54}} = _Send[T=DT_BOOL, client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_111_map/while/SparseToDense/sparse_values", _device="/job:localhost/replica:0/task:0/device:GPU:0"](map/while/SparseToDense/sparse_values)]]
</code></pre></div>
<p dir="auto">After distilled to this small repro, it seems to mostly do segfault. But the above error messages might help. Seems like a memory corruption.</p> | 1 |
<ul dir="auto">
<li>VSCode Version: 0.10.11</li>
<li>OS Version: Mac OS X Yosemite (10.10.5)</li>
<li>Default syntax highlighting</li>
<li>Issue persists when running VSCode with <code class="notranslate">--disable-extensions</code></li>
</ul>
<p dir="auto">Syntax highlighting gets confused within for loop. Strings don't get recognized. Elements that follow a string are considered to be strings instead (as it seems to me).<br>
After the for-loop there are still syntax highlighting errors but line 74 in screenshot looks fine again.</p>
<p dir="auto">Steps to Reproduce:</p>
<ol dir="auto">
<li>Open new TypeScript file within Angular 2 project (aka create new component)</li>
<li>Create for loop (see Screenshot)<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/7312890/14386505/78de89da-fda5-11e5-8b20-6fc7947b08af.jpg"><img src="https://cloud.githubusercontent.com/assets/7312890/14386505/78de89da-fda5-11e5-8b20-6fc7947b08af.jpg" alt="screen shot 2016-04-08 at 16 00 39" style="max-width: 100%;"></a></li>
</ol> | <p dir="auto">Ported from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="94376232" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript-Sublime-Plugin/issues/285" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript-Sublime-Plugin/issues/285/hovercard" href="https://github.com/microsoft/TypeScript-Sublime-Plugin/issues/285">microsoft/TypeScript-Sublime-Plugin#285</a></p>
<p dir="auto">Related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="91870539" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript-Sublime-Plugin/issues/265" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript-Sublime-Plugin/issues/265/hovercard" href="https://github.com/microsoft/TypeScript-Sublime-Plugin/issues/265">microsoft/TypeScript-Sublime-Plugin#265</a>.</p>
<p dir="auto">Issue:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1707813/8627292/da8f8be4-26fe-11e5-97ce-2b2a8b257afa.png"><img src="https://cloud.githubusercontent.com/assets/1707813/8627292/da8f8be4-26fe-11e5-97ce-2b2a8b257afa.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Correct:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1707813/8627340/3e27dbf2-26ff-11e5-8751-7e8576cbd230.png"><img src="https://cloud.githubusercontent.com/assets/1707813/8627340/3e27dbf2-26ff-11e5-8751-7e8576cbd230.png" alt="image" style="max-width: 100%;"></a></p> | 1 |
<p dir="auto"><a href="https://github.com/huggingface/transformers/blob/53ce3854a16ad2a715bc6ac8af3e30c18b5a1d11/src/transformers/activations.py#L21">gelu = getattr(F, "gelu", _gelu_python)</a></p>
<p dir="auto">should be changed to:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="if torch.__version__ < '1.4.0':
gelu = _gelu_python
else:
gelu = getattr(F, "gelu", _gelu_python)"><pre class="notranslate"><span class="pl-k">if</span> <span class="pl-s1">torch</span>.<span class="pl-s1">__version__</span> <span class="pl-c1"><</span> <span class="pl-s">'1.4.0'</span>:
<span class="pl-s1">gelu</span> <span class="pl-c1">=</span> <span class="pl-s1">_gelu_python</span>
<span class="pl-k">else</span>:
<span class="pl-s1">gelu</span> <span class="pl-c1">=</span> <span class="pl-en">getattr</span>(<span class="pl-v">F</span>, <span class="pl-s">"gelu"</span>, <span class="pl-s1">_gelu_python</span>)</pre></div> | <h1 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h1>
<p dir="auto">BERT breaks during FP16 training due to the gelu function.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="File "/home/user/miniconda/envs/py36/lib/python3.6/site-packages/transformers/modeling_bert.py", line 407, in forward
hidden_states, attention_mask, head_mask[i], encoder_hidden_states, encoder_attention_mask
File "/home/user/miniconda/envs/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
result = self.forward(*input, **kwargs)
File "/home/user/miniconda/envs/py36/lib/python3.6/site-packages/transformers/modeling_bert.py", line 379, in forward
intermediate_output = self.intermediate(attention_output)
File "/home/user/miniconda/envs/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
result = self.forward(*input, **kwargs)
File "/home/user/miniconda/envs/py36/lib/python3.6/site-packages/transformers/modeling_bert.py", line 332, in forward
hidden_states = self.intermediate_act_fn(hidden_states)
File "/home/user/miniconda/envs/py36/lib/python3.6/site-packages/torch/nn/functional.py", line 1125, in gelu
return torch._C._nn.gelu(input)
RuntimeError: "GeluCUDAKernelImpl" not implemented for 'Half'"><pre class="notranslate"><code class="notranslate">File "/home/user/miniconda/envs/py36/lib/python3.6/site-packages/transformers/modeling_bert.py", line 407, in forward
hidden_states, attention_mask, head_mask[i], encoder_hidden_states, encoder_attention_mask
File "/home/user/miniconda/envs/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
result = self.forward(*input, **kwargs)
File "/home/user/miniconda/envs/py36/lib/python3.6/site-packages/transformers/modeling_bert.py", line 379, in forward
intermediate_output = self.intermediate(attention_output)
File "/home/user/miniconda/envs/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
result = self.forward(*input, **kwargs)
File "/home/user/miniconda/envs/py36/lib/python3.6/site-packages/transformers/modeling_bert.py", line 332, in forward
hidden_states = self.intermediate_act_fn(hidden_states)
File "/home/user/miniconda/envs/py36/lib/python3.6/site-packages/torch/nn/functional.py", line 1125, in gelu
return torch._C._nn.gelu(input)
RuntimeError: "GeluCUDAKernelImpl" not implemented for 'Half'
</code></pre></div>
<h2 dir="auto">Information</h2>
<p dir="auto">The reason this is happening is because in <code class="notranslate">modeling_bert.py</code>, in 2.4.1 we had:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def gelu(x):
""" Original Implementation of the gelu activation function in Google Bert repo when initially created.
For information: OpenAI GPT's gelu is slightly different (and gives slightly different results):
0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3))))
Also see https://arxiv.org/abs/1606.08415
"""
return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0)))
...
ACT2FN = {"gelu": gelu, "relu": torch.nn.functional.relu, "swish": swish, "gelu_new": gelu_new, "mish": mish}"><pre class="notranslate"><code class="notranslate">def gelu(x):
""" Original Implementation of the gelu activation function in Google Bert repo when initially created.
For information: OpenAI GPT's gelu is slightly different (and gives slightly different results):
0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3))))
Also see https://arxiv.org/abs/1606.08415
"""
return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0)))
...
ACT2FN = {"gelu": gelu, "relu": torch.nn.functional.relu, "swish": swish, "gelu_new": gelu_new, "mish": mish}
</code></pre></div>
<p dir="auto">whereas in 2.5.0 we have:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ACT2FN = {"gelu": gelu, "relu": torch.nn.functional.relu, "swish": swish, "gelu_new": gelu_new, "mish": mish}"><pre class="notranslate"><code class="notranslate">ACT2FN = {"gelu": gelu, "relu": torch.nn.functional.relu, "swish": swish, "gelu_new": gelu_new, "mish": mish}
</code></pre></div>
<p dir="auto">where <code class="notranslate">gelu</code> now comes from <code class="notranslate">activations.py</code> as:<br>
<code class="notranslate">gelu = getattr(F, "gelu", _gelu_python)</code> on line 21.</p>
<h2 dir="auto">Environment info</h2>
<ul dir="auto">
<li><code class="notranslate">transformers</code> version:</li>
<li>Platform: Linux</li>
<li>Python version: 3.6</li>
<li>PyTorch version (GPU?): 1.2.0 CUDA 10.0</li>
<li>Tensorflow version (GPU?): 2.5.0</li>
<li>Using GPU in script?: V100</li>
<li>Using distributed or parallel set-up in script?: No, but using Apex FP16 training</li>
</ul> | 1 |
<p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-target-the-children-of-an-element-using-jquery#?solution=fccss%0A%20%20%24%28document%29.ready%28function%28%29%20%7B%0A%20%20%20%20%24%28%22%23target1%22%29.css%28%22color%22%2C%20%22red%22%29%3B%0A%20%20%20%20%24%28%22%23target1%22%29.prop%28%22disabled%22%2C%20true%29%3B%0A%20%20%20%20%24%28%22%23target4%22%29.remove%28%29%3B%0A%20%20%20%20%24%28%22%23target2%22%29.appendTo%28%22%23right-well%22%29%3B%0A%20%20%20%20%24%28%22%23target5%22%29.clone%28%29.appendTo%28%22%23left-well%22%29%3B%0A%20%20%20%20%24%28%22%23target1%22%29.parent%28%29.css%28%22background-color%22%2C%20%22red%22%29%3B%0A%0A%20%20%7D%29%3B%0Afcces%0A%0A%3C!--%20Only%20change%20code%20above%20this%20line.%20--%3E%0A%0A%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%3Ch3%20class%3D%22text-primary%20text-center%22%3EjQuery%20Playground%3C%2Fh3%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23left-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22left-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target1%22%3E%23target1%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target2%22%3E%23target2%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target3%22%3E%23target3%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23right-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22right-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target4%22%3E%23target4%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target5%22%3E%23target5%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target6%22%3E%23target6%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A" rel="nofollow">Waypoint: Target the Children of an Element Using jQuery</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36</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="<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#target1").parent().css("background-color", "red");
});
</script>
<!-- Only change code above this line. -->
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<h4>#left-well</h4>
<div class="well" id="left-well">
<button class="btn btn-default target" id="target1">#target1</button>
<button class="btn btn-default target" id="target2">#target2</button>
<button class="btn btn-default target" id="target3">#target3</button>
</div>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn btn-default target" id="target4">#target4</button>
<button class="btn btn-default target" id="target5">#target5</button>
<button class="btn btn-default target" id="target6">#target6</button>
</div>
</div>
</div>
</div>
"><pre class="notranslate"><span class="pl-kos"><</span><span class="pl-ent">script</span><span class="pl-kos">></span>
<span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-smi">document</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">ready</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-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#target1"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">css</span><span class="pl-kos">(</span><span class="pl-s">"color"</span><span class="pl-kos">,</span> <span class="pl-s">"red"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#target1"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">prop</span><span class="pl-kos">(</span><span class="pl-s">"disabled"</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">$</span><span class="pl-kos">(</span><span class="pl-s">"#target4"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">remove</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#target2"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">appendTo</span><span class="pl-kos">(</span><span class="pl-s">"#right-well"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#target5"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">clone</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">appendTo</span><span class="pl-kos">(</span><span class="pl-s">"#left-well"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#target1"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">parent</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">css</span><span class="pl-kos">(</span><span class="pl-s">"background-color"</span><span class="pl-kos">,</span> <span class="pl-s">"red"</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-ent">script</span><span class="pl-kos">></span>
<span class="pl-c"><!-- Only change code above this line. --></span>
<span class="pl-kos"><</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">container-fluid</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">h3</span> <span class="pl-c1">class</span>="<span class="pl-s">text-primary text-center</span>"<span class="pl-kos">></span>jQuery Playground<span class="pl-kos"></</span><span class="pl-ent">h3</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">row</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">col-xs-6</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">h4</span><span class="pl-kos">></span>#left-well<span class="pl-kos"></</span><span class="pl-ent">h4</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">well</span>" <span class="pl-c1">id</span>="<span class="pl-s">left-well</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target1</span>"<span class="pl-kos">></span>#target1<span class="pl-kos"></</span><span class="pl-ent">button</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target2</span>"<span class="pl-kos">></span>#target2<span class="pl-kos"></</span><span class="pl-ent">button</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target3</span>"<span class="pl-kos">></span>#target3<span class="pl-kos"></</span><span class="pl-ent">button</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">col-xs-6</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">h4</span><span class="pl-kos">></span>#right-well<span class="pl-kos"></</span><span class="pl-ent">h4</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">well</span>" <span class="pl-c1">id</span>="<span class="pl-s">right-well</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target4</span>"<span class="pl-kos">></span>#target4<span class="pl-kos"></</span><span class="pl-ent">button</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target5</span>"<span class="pl-kos">></span>#target5<span class="pl-kos"></</span><span class="pl-ent">button</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target6</span>"<span class="pl-kos">></span>#target6<span class="pl-kos"></</span><span class="pl-ent">button</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span></pre></div>
<p dir="auto">The Above code creates a total of 3 "#target5" elemets, 2 on the "#left-well" and 1 on the "#right-well".</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/7903100/11997732/28cd4b32-aaaa-11e5-98a5-acc1b91641c5.PNG"><img src="https://cloud.githubusercontent.com/assets/7903100/11997732/28cd4b32-aaaa-11e5-98a5-acc1b91641c5.PNG" alt="capture" style="max-width: 100%;"></a></p>
<p dir="auto">I tried refreshing my browser several times but this didn't go.<br>
But this keeps changing i mean to 1 element on the left then to 2 when ever i keep typing or changing code.</p> | <p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-clone-an-element-using-jquery#?solution=fccss%0A%20%20%24%28document%29.ready%28function%28%29%20%7B%0A%20%20%20%20%24%28%22%23target1%22%29.css%28%22color%22%2C%20%22red%22%29%3B%0A%20%20%20%20%24%28%22%23target1%22%29.prop%28%22disabled%22%2C%20true%29%3B%0A%20%20%20%20%24%28%22%23target4%22%29.remove%28%29%3B%0A%20%20%20%20%24%28%22%23target2%22%29.appendTo%28%22%23right-well%22%29%3B%0A%20%20%20%20%24%28%22%23target5%22%29.clone%28%29.appendTo%28%22%23left-well%22%29%3B%0A%20%20%7D%29%3B%0Afcces%0A%0A%3C!--%20Only%20change%20code%20above%20this%20line.%20--%3E%0A%0A%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%3Ch3%20class%3D%22text-primary%20text-center%22%3EjQuery%20Playground%3C%2Fh3%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23left-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22left-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target1%22%3E%23target1%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target2%22%3E%23target2%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target3%22%3E%23target3%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23right-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22right-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target4%22%3E%23target4%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target5%22%3E%23target5%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target6%22%3E%23target6%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A" rel="nofollow">Waypoint: Clone an Element Using jQuery</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36</code>.<br>
Please describe how to reproduce this issue, and include links to screenshots if possible.</p>
<h2 dir="auto">Issue</h2>
<p dir="auto">I believe I've found bug in the phone simulation in <strong>Waypoint: Clone an Element Using jQuery</strong>:</p>
<p dir="auto">I entered the code to clone <code class="notranslate">target5</code> and append it to <code class="notranslate">left-well</code>, and now I see three <strong>target5</strong> buttons in the phone simulator. FCC says my code is correct and advances me to the next challenge. The following challenges also show three target5 buttons:</p>
<ul dir="auto">
<li>Waypoint: Target the Parent of an Element Using jQuery</li>
<li>Waypoint: Target the Children of an Element Using jQuery</li>
</ul>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/qualitymanifest/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/qualitymanifest">@qualitymanifest</a> confirms this issue on his <strong>Linux</strong> box.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/5673126/11647398/76751658-9d35-11e5-8fcf-112ab89c6920.png"><img src="https://cloud.githubusercontent.com/assets/5673126/11647398/76751658-9d35-11e5-8fcf-112ab89c6920.png" alt="image" style="max-width: 100%;"></a></p>
<h2 dir="auto">My code:</h2>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
});
</script>
<!-- Only change code above this line. -->
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<h4>#left-well</h4>
<div class="well" id="left-well">
<button class="btn btn-default target" id="target1">#target1</button>
<button class="btn btn-default target" id="target2">#target2</button>
<button class="btn btn-default target" id="target3">#target3</button>
</div>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn btn-default target" id="target4">#target4</button>
<button class="btn btn-default target" id="target5">#target5</button>
<button class="btn btn-default target" id="target6">#target6</button>
</div>
</div>
</div>
</div>
"><pre class="notranslate"><span class="pl-kos"><</span><span class="pl-ent">script</span><span class="pl-kos">></span>
<span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-smi">document</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">ready</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-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#target1"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">css</span><span class="pl-kos">(</span><span class="pl-s">"color"</span><span class="pl-kos">,</span> <span class="pl-s">"red"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#target1"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">prop</span><span class="pl-kos">(</span><span class="pl-s">"disabled"</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">$</span><span class="pl-kos">(</span><span class="pl-s">"#target4"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">remove</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#target2"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">appendTo</span><span class="pl-kos">(</span><span class="pl-s">"#right-well"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#target5"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">clone</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">appendTo</span><span class="pl-kos">(</span><span class="pl-s">"#left-well"</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-ent">script</span><span class="pl-kos">></span>
<span class="pl-c"><!-- Only change code above this line. --></span>
<span class="pl-kos"><</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">container-fluid</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">h3</span> <span class="pl-c1">class</span>="<span class="pl-s">text-primary text-center</span>"<span class="pl-kos">></span>jQuery Playground<span class="pl-kos"></</span><span class="pl-ent">h3</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">row</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">col-xs-6</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">h4</span><span class="pl-kos">></span>#left-well<span class="pl-kos"></</span><span class="pl-ent">h4</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">well</span>" <span class="pl-c1">id</span>="<span class="pl-s">left-well</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target1</span>"<span class="pl-kos">></span>#target1<span class="pl-kos"></</span><span class="pl-ent">button</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target2</span>"<span class="pl-kos">></span>#target2<span class="pl-kos"></</span><span class="pl-ent">button</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target3</span>"<span class="pl-kos">></span>#target3<span class="pl-kos"></</span><span class="pl-ent">button</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">col-xs-6</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">h4</span><span class="pl-kos">></span>#right-well<span class="pl-kos"></</span><span class="pl-ent">h4</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">well</span>" <span class="pl-c1">id</span>="<span class="pl-s">right-well</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target4</span>"<span class="pl-kos">></span>#target4<span class="pl-kos"></</span><span class="pl-ent">button</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target5</span>"<span class="pl-kos">></span>#target5<span class="pl-kos"></</span><span class="pl-ent">button</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-default target</span>" <span class="pl-c1">id</span>="<span class="pl-s">target6</span>"<span class="pl-kos">></span>#target6<span class="pl-kos"></</span><span class="pl-ent">button</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">div</span><span class="pl-kos">></span></pre></div> | 1 |
<p dir="auto">Back in January, <a href="https://github.com/atom/electron/commit/bda3711815ef0e01ae0c380dbc262d7efd604aa9#diff-b0dbfed07f681b0f2ecb1eb01f0ed85b">it was documented</a> that an API to set window shape would be coming once an upstream bug was resolved. That bug was already "lower than Priority 1" at the time.</p>
<p dir="auto">I'm curious if it would be possible to make a setting in the interim to just ignore all clicks and pass them through to whatever's underneath? I'd like to make an overlay type program and would effectively like to say my window shape is a 0x0 rectangle. In my case, I'd be fine with strictly Windows compatibility.</p> | <p dir="auto">As commented here, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="52707377" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/949" data-hovercard-type="pull_request" data-hovercard-url="/electron/electron/pull/949/hovercard?comment_id=87087841&comment_type=issue_comment" href="https://github.com/electron/electron/pull/949#issuecomment-87087841">#949 (comment)</a> - transparent windows unfortunately are of limited use unless you can click through the transparent area.</p>
<p dir="auto">I noticed that in the <a href="https://github.com/atom/atom-shell/blob/master/docs/api/frameless-window.md#limitations">documentation</a> it is stated that this is blocked by an upstream bug. The nw.js project DOES have <a href="https://github.com/nwjs/nw.js/wiki/Transparency#click-through-transparency">support for this</a>, but i'm not sure how different their implementation is...</p>
<p dir="auto">I think this is worth the issue to track discussion and implementation, so here it is.</p> | 1 |
<p dir="auto">ansible 0.8 (devel <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/761330b125d1809fa72cd0ca06a441363ad85847/hovercard" href="https://github.com/ansible/ansible/commit/761330b125d1809fa72cd0ca06a441363ad85847"><tt>761330b</tt></a>) last updated 2012/10/04 10:13:36 (GMT +200)</p>
<p dir="auto">Hello,</p>
<p dir="auto">I have a host in the inventory which uses a non-standard SSH port (in my case: 2222).<br>
If I use delegate_to to delegate to another host, ansible connects to the host (vz112.local) with the port from the host (10.20.20.208) which is processed by the playbook (port 2222 in my case). Of course this fails.</p>
<p dir="auto">It seems I'm not able to override the port via "delegate_to: otherhost:22".</p>
<p dir="auto">Is this a bug, feature or do I something wrong?<br>
(Well, workaround is to use redir on the delegate_to host for now.)</p>
<p dir="auto">Thanks,<br>
Dietmar</p>
<hr>
<p dir="auto">[xxx]<br>
10.20.20.208:2222</p>
<hr>
<ul dir="auto">
<li>name: Create base Nagios host configuration<br>
action: template src=files/etc/nagios/hosts/host.cfg.j2 dest=/etc/nagios/hosts/${ansible_hostname}.cfg<br>
delegate_to: vz112.local</li>
</ul>
<hr>
<p dir="auto">TASK: [Create base Nagios host configuration] *********************<br>
fatal: [10.20.20.208] => failed to transfer file to /source:</p>
<p dir="auto">Connecting to vz112.local...<br>
ssh: connect to host vz112.local port 2222: Connection refused<br>
Couldn't read packet: Connection reset by peer</p>
<p dir="auto">FATAL: all hosts have already failed -- aborting</p> | <p dir="auto">Thanks to a tip earlier, I'm using <code class="notranslate">ansible_python_interpreter</code> to jiggle with the Python version nodes can use: hosts in my inventory have that variable set accordingly.</p>
<p dir="auto">Installing 0.7 now allows me to use some of the new cool features, but I find certain inconsistencies:</p>
<ol dir="auto">
<li>Jinja2 templates don't use the specified interpreter. The following code complains that <code class="notranslate">simplejson</code> cannot be imported, though the Python-2.7.3 I point to with <code class="notranslate">ansible_python_interpreter</code> can, indeed, <code class="notranslate">import json</code>:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{{ ansible_facts | to_json }}"><pre class="notranslate"><code class="notranslate">{{ ansible_facts | to_json }}
</code></pre></div>
<ol dir="auto">
<li>A Playbook which has a <code class="notranslate">local_action: template src=xx.j2 dest=/tmp/xx</code> uses the default <code class="notranslate">/usr/bin/python</code> on the target system (i.e. <code class="notranslate">127.0.0.1</code>) instead of that configured with <code class="notranslate">ansible_python_interpreter</code>.</li>
</ol> | 1 |
<h3 dir="auto">Vue.js version</h3>
<p dir="auto">1.0.20</p>
<h3 dir="auto">Reproduction Link</h3>
<p dir="auto"><a href="https://jsfiddle.net/ardoramor/hyk86ca3/" rel="nofollow">https://jsfiddle.net/ardoramor/hyk86ca3/</a></p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">Run fiddle, examine console.</p>
<h3 dir="auto">What is Expected?</h3>
<p dir="auto">Entries will be tracked by the specified path, just like in filters (e.g., <code class="notranslate">orderBy</code>)</p>
<h3 dir="auto">What is actually happening?</h3>
<p dir="auto">VueJs prints out a warning and fails to get the unique value specified by path</p>
<h3 dir="auto">Required change</h3>
<p dir="auto">There are three lines that would need to change from <code class="notranslate">value[trackByKey]</code> to <code class="notranslate">getPath(value, trackByKey)</code> in functions <code class="notranslate">cacheFrag</code>, <code class="notranslate">getCachedFrag</code>, and <code class="notranslate">deleteCachedFrag</code>. I can make a PR but maybe such a small change doesn't require it?</p>
<p dir="auto">Also, is it possible to add expression evaluation for <code class="notranslate">track-by</code>? This way, a combination of fields can yield a unique identifier (e.g., <code class="notranslate">track-by="employee.company + employee.id"</code>, in case <code class="notranslate">id</code> can be reused by companies). I have a different application but this should make sense as well.</p> | <h3 dir="auto">What problem does this feature solve?</h3>
<p dir="auto">Keep-alive filter by slot instance.</p>
<p dir="auto">I need to use it to filter my route component in <code class="notranslate">router-view</code> by <code class="notranslate">:key="$route.fullPath"</code></p>
<h3 dir="auto">What does the proposed API look like?</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<keep-alive :include-keys="function(keyOfSlot:string) or regex or string">
<component :key="myKey"/>
</keep-alive>"><pre class="notranslate"><code class="notranslate"><keep-alive :include-keys="function(keyOfSlot:string) or regex or string">
<component :key="myKey"/>
</keep-alive>
</code></pre></div> | 0 |
<h4 dir="auto">Challenge</h4>
<p dir="auto">Using Objects for Lookups<br>
<a href="https://www.freecodecamp.com/challenges/using-objects-for-lookups" rel="nofollow">https://www.freecodecamp.com/challenges/using-objects-for-lookups</a></p>
<h4 dir="auto">Issue Description</h4>
<p dir="auto">Cannot progress to the next challenge although all conditions are met</p>
<h4 dir="auto">Browser Information</h4>
<ul dir="auto">
<li>Google Chrome, Version: Version 51.0.2704.106 (64-bit)</li>
<li>Operating System: Mac OSX v10.11.6</li>
<li>Mobile, Desktop, or Tablet: Laptop</li>
</ul>
<h4 dir="auto">Your Code</h4>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Setup
function phoneticLookup(val) {
var result = "";
// Only change code below this line
lookup = {
alpha: 'Adams',
bravo: 'Boston',
charlie: 'Chicago',
delta: 'Denver',
echo: 'Easy',
foxtrot: 'Frank'
};
result = lookup[val]; //must use [ ] notation if looking up variables
// Only change code above this line
return result;
}
// Change this value to test
phoneticLookup("alpha");
"><pre class="notranslate"><span class="pl-c">// Setup</span>
<span class="pl-k">function</span> <span class="pl-en">phoneticLookup</span><span class="pl-kos">(</span><span class="pl-s1">val</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-s">""</span><span class="pl-kos">;</span>
<span class="pl-c">// Only change code below this line</span>
<span class="pl-s1">lookup</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-c1">alpha</span>: <span class="pl-s">'Adams'</span><span class="pl-kos">,</span>
<span class="pl-c1">bravo</span>: <span class="pl-s">'Boston'</span><span class="pl-kos">,</span>
<span class="pl-c1">charlie</span>: <span class="pl-s">'Chicago'</span><span class="pl-kos">,</span>
<span class="pl-c1">delta</span>: <span class="pl-s">'Denver'</span><span class="pl-kos">,</span>
<span class="pl-c1">echo</span>: <span class="pl-s">'Easy'</span><span class="pl-kos">,</span>
<span class="pl-c1">foxtrot</span>: <span class="pl-s">'Frank'</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-s1">lookup</span><span class="pl-kos">[</span><span class="pl-s1">val</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">//must use [ ] notation if looking up variables</span>
<span class="pl-c">// Only change code above this line</span>
<span class="pl-k">return</span> <span class="pl-s1">result</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c">// Change this value to test</span>
<span class="pl-en">phoneticLookup</span><span class="pl-kos">(</span><span class="pl-s">"alpha"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h4 dir="auto">Screenshot</h4>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/7964516/17146887/78257330-5360-11e6-81a8-06921f7d636c.jpg"><img src="https://cloud.githubusercontent.com/assets/7964516/17146887/78257330-5360-11e6-81a8-06921f7d636c.jpg" alt="screenshot 2016-07-26 18 39 56" style="max-width: 100%;"></a></p> | <p dir="auto">Challenge tests for jQuery fail to run if syntax errors are present in a campers code.</p>
<p dir="auto">Examples:<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="161661570" data-permission-text="Title is private" data-url="https://github.com/freeCodeCamp/freeCodeCamp/issues/9289" data-hovercard-type="issue" data-hovercard-url="/freeCodeCamp/freeCodeCamp/issues/9289/hovercard" href="https://github.com/freeCodeCamp/freeCodeCamp/issues/9289">#9289</a><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="159738958" data-permission-text="Title is private" data-url="https://github.com/freeCodeCamp/freeCodeCamp/issues/9082" data-hovercard-type="issue" data-hovercard-url="/freeCodeCamp/freeCodeCamp/issues/9082/hovercard" href="https://github.com/freeCodeCamp/freeCodeCamp/issues/9082">#9082</a><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="163218773" data-permission-text="Title is private" data-url="https://github.com/freeCodeCamp/freeCodeCamp/issues/9470" data-hovercard-type="issue" data-hovercard-url="/freeCodeCamp/freeCodeCamp/issues/9470/hovercard" href="https://github.com/freeCodeCamp/freeCodeCamp/issues/9470">#9470</a><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="164753410" data-permission-text="Title is private" data-url="https://github.com/freeCodeCamp/freeCodeCamp/issues/9672" data-hovercard-type="issue" data-hovercard-url="/freeCodeCamp/freeCodeCamp/issues/9672/hovercard" href="https://github.com/freeCodeCamp/freeCodeCamp/issues/9672">#9672</a><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="165201340" data-permission-text="Title is private" data-url="https://github.com/freeCodeCamp/freeCodeCamp/issues/9698" data-hovercard-type="issue" data-hovercard-url="/freeCodeCamp/freeCodeCamp/issues/9698/hovercard" href="https://github.com/freeCodeCamp/freeCodeCamp/issues/9698">#9698</a></p>
<p dir="auto">What is stopping the tests running? Can we fix it?</p>
<p dir="auto">Is there a way to lint jQuery in codemirror so campers get visual clues to syntax errors, like in the JS challenges?</p>
<p dir="auto">-Or-</p>
<p dir="auto">When there is a syntax error, can we present a modal to the camper saying there is a syntax error present in their code when they click 'Run tests'?</p> | 1 |
<p dir="auto">Hi<br>
I am using transformer 4.1.1 on multiple gpus with distributed launch script below, the n_gpu set in this case is 1 instead of actual n_gpus, could you tell me how I can access to the total number of ranks calling the launcher with? Is there any variable in huggingface library which could show the number of gpus the script is called with? Here is the command I run:</p>
<p dir="auto"><code class="notranslate">export BS=4; CUDA_VISIBLE_DEVICES=0,1 USE_TF=0 python -m torch.distributed.launch --nproc_per_node=2 --master_port=9915 finetune_trainer.py --model_name_or_path t5-small --output_dir output_dir --adam_eps 1e-06 --data_dir wmt_en_ro --do_train --freeze_embeds --label_smoothing 0.1 --learning_rate 3e-5 --logging_first_step --logging_steps 1000 --max_source_length 128 --max_target_length 128 --num_train_epochs 1 --overwrite_output_dir --per_device_train_batch_size $BS --sortish_sampler --task translation --val_max_target_length 128 --warmup_steps 500 --n_train 500 </code></p>
<p dir="auto">thanks</p> | <p dir="auto">Hi<br>
I am using transformer 4.1.1 on multiple gpus with distributed launch script below, the n_gpu set in this case is 1 instead of actual n_gpus, could you tell me how I can access to the total number of ranks calling the launcher with? Is there any variable in huggingface library which could show the number of gpus the script is called with? Here is the command I run:</p>
<p dir="auto"><code class="notranslate">export BS=4; CUDA_VISIBLE_DEVICES=0,1 USE_TF=0 python -m torch.distributed.launch --nproc_per_node=2 --master_port=9915 finetune_trainer.py --model_name_or_path t5-small --output_dir output_dir --adam_eps 1e-06 --data_dir wmt_en_ro --do_train --freeze_embeds --label_smoothing 0.1 --learning_rate 3e-5 --logging_first_step --logging_steps 1000 --max_source_length 128 --max_target_length 128 --num_train_epochs 1 --overwrite_output_dir --per_device_train_batch_size $BS --sortish_sampler --task translation --val_max_target_length 128 --warmup_steps 500 --n_train 500 </code></p>
<p dir="auto">thanks</p> | 1 |
<h2 dir="auto">Bug Report</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I would like to work on a fix!</li>
</ul>
<p dir="auto"><strong>Current behavior</strong></p>
<p dir="auto">When using the programmatic API, babel always throws an error when I use <code class="notranslate">path.buildCodeFrameError</code>.</p>
<p dir="auto"><strong>Input Code</strong></p>
<p dir="auto">A simple example:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const { parseAsync, traverse } = require('@babel/core');
async function demo() {
const parsed = await parseAsync('foo.bar()', { sourceFileName: 'foo.js' });
traverse(parsed, {
enter(path) {
path.buildCodeFrameError('some error');
}
})
}
demo().catch(console.error);"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-kos">{</span> parseAsync<span class="pl-kos">,</span> traverse <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">'@babel/core'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">demo</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">parsed</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-en">parseAsync</span><span class="pl-kos">(</span><span class="pl-s">'foo.bar()'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">sourceFileName</span>: <span class="pl-s">'foo.js'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">traverse</span><span class="pl-kos">(</span><span class="pl-s1">parsed</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
<span class="pl-en">enter</span><span class="pl-kos">(</span><span class="pl-s1">path</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">buildCodeFrameError</span><span class="pl-kos">(</span><span class="pl-s">'some error'</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-en">demo</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-smi">console</span><span class="pl-kos">.</span><span class="pl-c1">error</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior</strong><br>
I would expect an awesomely formatted code frame error.</p>
<p dir="auto"><strong>Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)</strong><br>
<em>none</em></p>
<p dir="auto"><strong>Environment</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
System:
OS: Windows 10 10.0.19041
Binaries:
Node: 12.16.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.4 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
npmPackages:
@babel/core: ^7.9.6 => 7.10.4
@babel/generator: ^7.9.6 => 7.10.4
@babel/parser: ^7.9.6 => 7.10.4
@babel/plugin-proposal-decorators: ^7.8.3 => 7.10.4
@babel/preset-react: ^7.9.4 => 7.10.4
@babel/preset-typescript: ^7.9.0 => 7.10.4
babel-plugin-transform-decorators-legacy: ^1.3.5 => 1.3.5"><pre class="notranslate"><code class="notranslate">
System:
OS: Windows 10 10.0.19041
Binaries:
Node: 12.16.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.4 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
npmPackages:
@babel/core: ^7.9.6 => 7.10.4
@babel/generator: ^7.9.6 => 7.10.4
@babel/parser: ^7.9.6 => 7.10.4
@babel/plugin-proposal-decorators: ^7.8.3 => 7.10.4
@babel/preset-react: ^7.9.4 => 7.10.4
@babel/preset-typescript: ^7.9.0 => 7.10.4
babel-plugin-transform-decorators-legacy: ^1.3.5 => 1.3.5
</code></pre></div> | <h2 dir="auto">Bug Report</h2>
<p dir="auto">This related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="356502875" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/8617" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/8617/hovercard" href="https://github.com/babel/babel/issues/8617">#8617</a></p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I would like to work on a fix!</li>
</ul>
<p dir="auto"><strong>Current Behavior</strong><br>
<code class="notranslate">@babel/parser</code> has a different behavior when <code class="notranslate">estree</code> enabled, and when not.</p>
<p dir="auto"><strong>Input Code</strong><br>
When <code class="notranslate">estree</code> disabled code with <code class="notranslate">Duplicated variable declaration</code> throws while parsing:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const {parse} = require('@babel/parser');
const traverse = require('@babel/traverse').default;
const code = `function square(n) {
const n = 1;
}`;
// crash with an error: Identifier 'n' has already been declared (1:16)
const ast = parse(code);"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-kos">{</span>parse<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">'@babel/parser'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">traverse</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/traverse'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">default</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">code</span> <span class="pl-c1">=</span> <span class="pl-s">`function square(n) {</span>
<span class="pl-s"> const n = 1;</span>
<span class="pl-s">}`</span><span class="pl-kos">;</span>
<span class="pl-c">// crash with an error: Identifier 'n' has already been declared (1:16)</span>
<span class="pl-k">const</span> <span class="pl-s1">ast</span> <span class="pl-c1">=</span> <span class="pl-en">parse</span><span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">When <code class="notranslate">estree</code> mode enabled code is parsed, but can't be traversed because of <code class="notranslate">this.hub</code> is undefined:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const {parse} = require('@babel/parser');
const traverse = require('@babel/traverse').default;
const code = `function square(n) {
const n = 1;
}`;
const ast = parse(code, {
plugins: [
'estree',
]
});
traverse(ast, {
enter(path) {
console.log('n');
}
});
/*
throw this.hub.buildError(id, `Duplicate declaration "${name}"`, TypeError);
^
TypeError: Cannot read property 'buildError' of undefined
at Scope.checkBlockScopedCollisions (/home/coderaiser/node_modules/@babel/traverse/lib/scope/index.js:402:22)
*/"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-kos">{</span>parse<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">'@babel/parser'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">traverse</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/traverse'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">default</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">code</span> <span class="pl-c1">=</span> <span class="pl-s">`function square(n) {</span>
<span class="pl-s"> const n = 1;</span>
<span class="pl-s">}`</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">ast</span> <span class="pl-c1">=</span> <span class="pl-en">parse</span><span class="pl-kos">(</span><span class="pl-s1">code</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-s">'estree'</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">traverse</span><span class="pl-kos">(</span><span class="pl-s1">ast</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
<span class="pl-en">enter</span><span class="pl-kos">(</span><span class="pl-s1">path</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">'n'</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">/*</span>
<span class="pl-c"> throw this.hub.buildError(id, `Duplicate declaration "${name}"`, TypeError);</span>
<span class="pl-c"> ^</span>
<span class="pl-c"></span>
<span class="pl-c">TypeError: Cannot read property 'buildError' of undefined</span>
<span class="pl-c"> at Scope.checkBlockScopedCollisions (/home/coderaiser/node_modules/@babel/traverse/lib/scope/index.js:402:22)</span>
<span class="pl-c">*/</span></pre></div>
<p dir="auto">Same result when instead of <code class="notranslate">estree</code> plugin, <code class="notranslate">errorRecovery</code> enabled.</p>
<p dir="auto"><strong>Expected behavior/code</strong><br>
Would be great if in <code class="notranslate">estree</code> mode <code class="notranslate">babel</code> throws while parsing and/or can throw while traversing<br>
about <code class="notranslate">Duplicate declaration</code>.</p>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): <code class="notranslate">v7.9.4</code></li>
<li>Node/npm version: Node 12(13)/npm 6</li>
<li>OS: <code class="notranslate">Ubuntu</code></li>
<li>Monorepo: no</li>
<li>How you are using Babel: <code class="notranslate">parse</code>, <code class="notranslate">traverse</code></li>
</ul>
<p dir="auto"><strong>Possible Solution</strong></p>
<p dir="auto">I suggest to use <code class="notranslate">TypeError</code>, because this is what <a href="https://github.com/babel/babel/blob/f6c7bf36cec81baaba8c37e572985bb59ca334b1/packages/babel-traverse/src/hub.js">hub actually does</a>, this way:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="throw TypeError(`Duplicate declaration "${name}"`);"><pre class="notranslate"><span class="pl-k">throw</span> <span class="pl-v">TypeError</span><span class="pl-kos">(</span><span class="pl-s">`Duplicate declaration "<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">name</span><span class="pl-kos">}</span></span>"`</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">If of course <code class="notranslate">buildError</code> doesn't used in development purpose to set breakpoint on error building, anyways <code class="notranslate">Chrome Developer Tools</code> debugger already suggest similar feature <code class="notranslate">pause on exceptions</code> (caught and uncaught).</p> | 1 |
<h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> This has already been asked to the <a href="https://groups.google.com/forum/#!forum/celery-users" rel="nofollow">discussion group</a> first.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br>
<a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br>
on reporting bugs.</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/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical bug reports.</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/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</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/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all the versions of all the external dependencies required<br>
to reproduce this bug.</li>
</ul>
<h2 dir="auto">Optional Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one Python version<br>
and/or implementation.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one message broker and/or<br>
result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br>
broker and/or result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one operating system.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br>
ETA/Countdown & rate limits disabled.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue after downgrading<br>
and/or upgrading Celery and its dependencies.</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>
<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h2 dir="auto">Environment & Settings</h2>
<p dir="auto"><strong>Celery version</strong>:</p>
<details>
<summary><b><code class="notranslate">celery report</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="~/celery $ docker build -f docker/Dockerfile ."><pre class="notranslate"><code class="notranslate">~/celery $ docker build -f docker/Dockerfile .
</code></pre></div>
<h2 dir="auto">Required Dependencies</h2>
<ul dir="auto">
<li><strong>Minimal Python Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Celery Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Kombu Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li>
</ul>
<h3 dir="auto">Python Packages</h3>
<details>
<summary><b><code class="notranslate">pip freeze</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Not applicable"><pre class="notranslate"><code class="notranslate">Not applicable
</code></pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Other Dependencies</h3>
<details>
<p dir="auto">
N/A
</p>
</details>
<h2 dir="auto">Minimally Reproducible Test Case</h2>
<details>
<p dir="auto">
</p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>
<p dir="auto">The docker image should build without error.</p>
<h1 dir="auto">Actual Behavior</h1>
<p dir="auto">The image fails to build due to a dependency versioning issue with couchbase.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ podman build -t celery -f docker/Dockerfile .
STEP 1: FROM ubuntu:focal
STEP 2: ENV PYTHONIOENCODING UTF-8
--> Using cache acaba7be84835036fb85e90b837986d94871823c68921aca8b9bc6858f7eede6
STEP 3: ARG DEBIAN_FRONTEND=noninteractive
--> Using cache f53b7bd5d6f45cd40239c7d083c268db8b62e826a8018a47c32d96c8e439952f
STEP 4: RUN apt-get update && apt-get install -y build-essential libcurl4-openssl-dev libffi-dev tk-dev xz-utils curl lsb-release git libmemcached-dev make liblzma-dev libreadline-dev libbz2-dev llvm libncurses5-dev libsqlite3-dev wget pypy python-openssl libncursesw5-dev zlib1g-dev pkg-config libssl-dev sudo
--> Using cache 3528dd3a7bde42f48e3f792b717ce95ad3bcc1d169b2d676abf20faaa2eaaacc
STEP 5: ENV PROVISIONING /provisioning
--> Using cache 5cd403e630187ed510ed7aa5c1a7279b2e169e77a35a17dacaf82a49bbc8ce7c
STEP 6: ARG CELERY_USER=developer
--> Using cache faa9faee390dded0bab0e78ebca4b9075b19f05a50bc055bb77f88efbd64682f
STEP 7: RUN : "${CELERY_USER:?CELERY_USER build argument needs to be set and non-empty.}"
--> Using cache 43389d0aac47abf3b16a5af3689c5371180a6b3950841c179a2569affffed4eb
STEP 8: ENV HOME /home/$CELERY_USER
--> Using cache ec0be7e288094b41313bd80d5ea9df3fbb44b99cd8a7299f5a4b21a4d7932b39
STEP 9: ENV PATH="$HOME/.pyenv/bin:$PATH"
--> Using cache e7239a2d2c12e00bfabaec790d0c1937690095b55c3473b80a13c3afbd9a0333
STEP 10: WORKDIR $PROVISIONING
--> Using cache f0f43f30b813e023ba7a9edb2fdef8761187b529deb69f4e131d207665a8016b
STEP 11: COPY docker/scripts/install-couchbase.sh .
--> Using cache 86faecc53eba42812d4ac16e7498707e855e93030de83e14230f5da13391ca4f
STEP 12: RUN sh install-couchbase.sh
sudo: setrlimit(RLIMIT_CORE): Operation not permitted
sudo: setrlimit(RLIMIT_CORE): Operation not permitted
--2020-07-14 01:15:18-- http://packages.couchbase.com/ubuntu/couchbase.key
Resolving packages.couchbase.com (packages.couchbase.com)... 143.204.83.79, 143.204.83.24, 143.204.83.78, ...
Connecting to packages.couchbase.com (packages.couchbase.com)|143.204.83.79|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4815 (4.7K) [application/pgp-keys]
Saving to: 'STDOUT'
- 100%[=============================================================>] 4.70K --.-KB/s in 0s
2020-07-14 01:15:19 (57.3 MB/s) - written to stdout [4815/4815]
OK
sudo: setrlimit(RLIMIT_CORE): Operation not permitted
deb http://packages.couchbase.com/ubuntu bionic bionic/main
Get:1 http://packages.couchbase.com/ubuntu bionic InRelease [2992 B]
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Get:4 http://packages.couchbase.com/ubuntu bionic/bionic/main amd64 Packages [1419 B]
Hit:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Fetched 4411 B in 2s (2570 B/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.8ubuntu1).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libcouchbase2-bin : Depends: libcouchbase2-libevent (= 2.10.6-1) but it is not going to be installed
Depends: libevent-core-2.1-6 (>= 2.1.8-stable) but it is not installable
E: Unable to correct problems, you have held broken packages.
Error: error building at STEP "RUN sh install-couchbase.sh": error while running runtime: exit status 100"><pre class="notranslate"><code class="notranslate">$ podman build -t celery -f docker/Dockerfile .
STEP 1: FROM ubuntu:focal
STEP 2: ENV PYTHONIOENCODING UTF-8
--> Using cache acaba7be84835036fb85e90b837986d94871823c68921aca8b9bc6858f7eede6
STEP 3: ARG DEBIAN_FRONTEND=noninteractive
--> Using cache f53b7bd5d6f45cd40239c7d083c268db8b62e826a8018a47c32d96c8e439952f
STEP 4: RUN apt-get update && apt-get install -y build-essential libcurl4-openssl-dev libffi-dev tk-dev xz-utils curl lsb-release git libmemcached-dev make liblzma-dev libreadline-dev libbz2-dev llvm libncurses5-dev libsqlite3-dev wget pypy python-openssl libncursesw5-dev zlib1g-dev pkg-config libssl-dev sudo
--> Using cache 3528dd3a7bde42f48e3f792b717ce95ad3bcc1d169b2d676abf20faaa2eaaacc
STEP 5: ENV PROVISIONING /provisioning
--> Using cache 5cd403e630187ed510ed7aa5c1a7279b2e169e77a35a17dacaf82a49bbc8ce7c
STEP 6: ARG CELERY_USER=developer
--> Using cache faa9faee390dded0bab0e78ebca4b9075b19f05a50bc055bb77f88efbd64682f
STEP 7: RUN : "${CELERY_USER:?CELERY_USER build argument needs to be set and non-empty.}"
--> Using cache 43389d0aac47abf3b16a5af3689c5371180a6b3950841c179a2569affffed4eb
STEP 8: ENV HOME /home/$CELERY_USER
--> Using cache ec0be7e288094b41313bd80d5ea9df3fbb44b99cd8a7299f5a4b21a4d7932b39
STEP 9: ENV PATH="$HOME/.pyenv/bin:$PATH"
--> Using cache e7239a2d2c12e00bfabaec790d0c1937690095b55c3473b80a13c3afbd9a0333
STEP 10: WORKDIR $PROVISIONING
--> Using cache f0f43f30b813e023ba7a9edb2fdef8761187b529deb69f4e131d207665a8016b
STEP 11: COPY docker/scripts/install-couchbase.sh .
--> Using cache 86faecc53eba42812d4ac16e7498707e855e93030de83e14230f5da13391ca4f
STEP 12: RUN sh install-couchbase.sh
sudo: setrlimit(RLIMIT_CORE): Operation not permitted
sudo: setrlimit(RLIMIT_CORE): Operation not permitted
--2020-07-14 01:15:18-- http://packages.couchbase.com/ubuntu/couchbase.key
Resolving packages.couchbase.com (packages.couchbase.com)... 143.204.83.79, 143.204.83.24, 143.204.83.78, ...
Connecting to packages.couchbase.com (packages.couchbase.com)|143.204.83.79|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4815 (4.7K) [application/pgp-keys]
Saving to: 'STDOUT'
- 100%[=============================================================>] 4.70K --.-KB/s in 0s
2020-07-14 01:15:19 (57.3 MB/s) - written to stdout [4815/4815]
OK
sudo: setrlimit(RLIMIT_CORE): Operation not permitted
deb http://packages.couchbase.com/ubuntu bionic bionic/main
Get:1 http://packages.couchbase.com/ubuntu bionic InRelease [2992 B]
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Get:4 http://packages.couchbase.com/ubuntu bionic/bionic/main amd64 Packages [1419 B]
Hit:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Fetched 4411 B in 2s (2570 B/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.8ubuntu1).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libcouchbase2-bin : Depends: libcouchbase2-libevent (= 2.10.6-1) but it is not going to be installed
Depends: libevent-core-2.1-6 (>= 2.1.8-stable) but it is not installable
E: Unable to correct problems, you have held broken packages.
Error: error building at STEP "RUN sh install-couchbase.sh": error while running runtime: exit status 100
</code></pre></div>
<p dir="auto">The dockerfile was originally changed to be based on focal in <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/celery/celery/commit/8246f3a914376fe060668731f37b0f2e4ecb822d/hovercard" href="https://github.com/celery/celery/commit/8246f3a914376fe060668731f37b0f2e4ecb822d"><tt>8246f3a</tt></a>, but it's likely that a more recent change in the Couchbase bionic package repo or the Ubuntu focal repos is what causes the breakage. Changing the docker image to be based on bionic again allows the image to build again.</p> | <p dir="auto">The Task.retry function sets a default "countdown" option even if "eta" is set, and passes on these options to Task.apply_async. Apply_async ignores "eta" if "countdown" is set. Hence, "retry" always ends up ignoring "eta". Bug exists in both 2.1 & 2.2</p> | 0 |
<ul dir="auto">
<li>VSCode Version: 0.10.11</li>
<li>OS Version: Mac OS X 10.10.5</li>
</ul>
<p dir="auto">Steps to Reproduce:</p>
<ol dir="auto">
<li>Create a new javascript file and add this source</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import React from 'react';
export default class Item extends React.Component {
update(e) {
console.log(e.target.value);
}
test = (e) => {
console.log(e.target.value);
}
render() {
return <span>{this.props.name}<br/>
<input type="text" onChange={(e) => this.update(e)} /><br/>
<input type="text" onChange={this.test} />
</span>;
}
}"><pre class="notranslate"><code class="notranslate">import React from 'react';
export default class Item extends React.Component {
update(e) {
console.log(e.target.value);
}
test = (e) => {
console.log(e.target.value);
}
render() {
return <span>{this.props.name}<br/>
<input type="text" onChange={(e) => this.update(e)} /><br/>
<input type="text" onChange={this.test} />
</span>;
}
}
</code></pre></div>
<ol dir="auto">
<li>IDE show me as syntax error.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/421794/13802334/75c0345e-eb19-11e5-89bd-c74837b1eba8.png"><img width="1140" alt="screen shot 2016-03-16 at 1 49 48 am" src="https://cloud.githubusercontent.com/assets/421794/13802334/75c0345e-eb19-11e5-89bd-c74837b1eba8.png" style="max-width: 100%;"></a></li>
</ol> | <p dir="auto">… and I can't turn it off by setting <code class="notranslate">javascript.validate.enable</code> false.</p>
<p dir="auto">Perhaps this is a soft documentation bug: the <a href="https://code.visualstudio.com/Updates" rel="nofollow">release notes</a> proudly mention <code class="notranslate">experimentalObjectRestSpread</code> but then say:</p>
<blockquote>
<p dir="auto">Support for ObjectRestSpread is not yet provided by Salsa but it is on the roadmap (see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="58475863" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/2103" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/2103/hovercard" href="https://github.com/microsoft/TypeScript/issues/2103">microsoft/TypeScript#2103</a>).</p>
</blockquote>
<p dir="auto">… which is confusing and misleading.</p>
<p dir="auto">It's confusing because the stand-out tone of core dev responses to that issue is "not until TC39 moves it to stage 3; bother them, not us", which is much less optimistic than the Feb 2016 release notes or the <a href="https://github.com/Microsoft/TypeScript/wiki/Roadmap">TypeScript Roadmap</a> itself.</p>
<p dir="auto">It's misleading because it fails to <strong>describe the impact</strong> of "support… not yet provided" as <strong>error messages you can't make go away</strong>. If there's some way to make them go away, please describe it in that part of the release notes. If not, I don't think it's too strong to outright <strong>advise users of object spread properties to delay upgrading</strong>.</p>
<p dir="auto">Without a work-around, this kills <code class="notranslate">code</code> for me, as I now have to dig for the real errors amongst a few dozen erroneous:</p>
<ul dir="auto">
<li><code class="notranslate">Property assignment expected.</code></li>
<li><code class="notranslate">Argument expression expected.</code></li>
<li><code class="notranslate">Declaration or statement expected.</code></li>
</ul>
<p dir="auto">I trust a workaround is possible, as <code class="notranslate">code</code> is not erroring in JSX.</p> | 1 |
<p dir="auto">As <code class="notranslate">numpy.matrix</code> <a href="https://github.com/numpy/numpy/pull/10142" data-hovercard-type="pull_request" data-hovercard-url="/numpy/numpy/pull/10142/hovercard">will be removed</a>, we should remove SciPy's dependency in 1.1.0:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Add <code class="notranslate">sparray</code>:
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> bsr_array</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> coo_array</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> csc_array</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> csr_array</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> dia_array</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> dok_array</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> lil_array</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> sparray</li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Deprecate <code class="notranslate">spmatrix</code>.</li>
</ul> | <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">Thank u for the excellent works on next@5.<br>
I found that it uses 'blob:<a href="http://localhost:3000/0xxxxxxx" rel="nofollow">http://localhost:3000/0xxxxxxx</a>' to load css/scss into the page after dom is rendered.<br>
So the users will see the page without styles about 1 or 2 seconds. I believe it is the only behavior in development mode at first.<br>
So I tried build with <code class="notranslate">yarn build</code> & run server in production model with <code class="notranslate">yarn start</code>.But this time, I see no css files loaded.<br>
Did I miss something or this is designed?</p> | <p dir="auto">In <a href="https://github.com/hanford/nextjs-cssmodules">this small repo</a> I've illustrated <code class="notranslate">next-css</code> not working with SSR, this is a blocker from my team moving off of <a href="https://github.com/traveloka/styled-modules">https://github.com/traveloka/styled-modules</a> which we're super eager to do.</p>
<p dir="auto">Great work on Next.js 5.0! Can't wait to fully migrate to it :)</p>
<p dir="auto">I would mind if Next.js apps had to have a custom <code class="notranslate">_document.js</code> to support this, but I guess thats more of an implementation detail.</p> | 1 |
<p dir="auto">The ParameterBag class is implemented in two components and has different interfaces.</p>
<p dir="auto"><code class="notranslate">Symfony\Component\HttpFoundation\ParameterBag</code><br>
<code class="notranslate">Symfony\Component\DependencyInjection\ParameterBag</code></p>
<p dir="auto">I can understand the duplication to avoid inter-module dependencies, but i do not understand why the different interfaces. For example the Http version allows default values:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$bag->get('name', null)"><pre class="notranslate"><code class="notranslate">$bag->get('name', null)
</code></pre></div>
<p dir="auto">Where the DI version does not and makes you do:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$bag->has('name') ? $bag->get('name') : null"><pre class="notranslate"><code class="notranslate">$bag->has('name') ? $bag->get('name') : null
</code></pre></div>
<p dir="auto">Could these be united? at least the interfaces? or is it a issue with requirements?</p> | <p dir="auto">Hello,</p>
<p dir="auto">After a discussion on Symfony Slack about environment variables and CLI around my question:</p>
<blockquote>
<p dir="auto">I’m interested into how the community solves the <em>environnement variable and the CLI</em>.</p>
</blockquote>
<p dir="auto">It seems that nothing solid came out out of this discussion.</p>
<p dir="auto">The documentation states that environment variables <a href="https://symfony.com/doc/current/configuration/external_parameters.html#environment-variables" rel="nofollow">should be added on the webserver level on production</a>.</p>
<p dir="auto">Nothing is said reguarding the <code class="notranslate">CLI</code>, so a lot of people (like me) will end up spending time looking for why a crontab entries is not executed.</p>
<p dir="auto">To me, prefixing the executed commands by the environment variables is <em>not a good solution</em>. I mean, it would involve:</p>
<ul dir="auto">
<li><em>variable duplication</em> (so bad maintenance, "oops forgot to add this variable in this place"),</li>
<li>and very <em>bad lisibility</em> (prefix with 20+ environment variables <g-emoji class="g-emoji" alias="thinking" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f914.png">🤔</g-emoji>?)</li>
</ul>
<p dir="auto">Regarding of this, why push in favor of environement variable if the only way of achieving this is to use a <em>not recommended way</em> (<code class="notranslate">.env</code> file).</p>
<p dir="auto">One alternate solution would be to create a file on the system in <code class="notranslate">/etc/environment</code> that contains those environment variable, BUT again, <em>what happens if your server hosts multiple projects</em> and you want one app X to be <code class="notranslate">APP_ENV=prod</code> and the other Y <code class="notranslate">APP_ENV=dev</code>, then you have a variable collusion with the name unless you change the <code class="notranslate">APP_ENV</code> variable name in all project to include a vendor prefix ? (I don't even know if it's feasible).</p>
<p dir="auto">Not all of us use containers to run in production (or doesn't even want to).</p>
<p dir="auto">PS: I open this here instead of the documentation repository because it reveals more questions than just "how to deal with that in doc is missing".</p> | 0 |
<h1 dir="auto">Feature request</h1>
<h2 dir="auto">Is your feature request related to a problem? Please describe.</h2>
<p dir="auto">Currently it is not possible to display two separate Next.js-based applications on the same page, if one attemps to do so, he gets an error. It is caused by the fact that Next.js-based application mounts on DOM elements with fixed IDs: <code class="notranslate">__next</code> and <code class="notranslate">__NEXT_DATA__</code>.</p>
<h2 dir="auto">Describe the solution you'd like</h2>
<p dir="auto">We'd like IDs of elements on which Next.js-based application mounts to be parameterized, possibly provided in application build script. We've forked Next.js and implemented this change in our fork: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/Raudos/next.js/commit/a4da2b6c2dbbec2f3f5d5b3e1c9cf24273d79dde/hovercard" href="https://github.com/Raudos/next.js/commit/a4da2b6c2dbbec2f3f5d5b3e1c9cf24273d79dde">Raudos@<tt>a4da2b6</tt></a>. This PoC was created during workshop at meet.js in Katowice, Poland on 29.09.2019 (<a href="https://summit.meetjs.pl/2019/zeit-workshop" rel="nofollow">https://summit.meetjs.pl/2019/zeit-workshop</a>).</p>
<h2 dir="auto">Describe alternatives you've considered</h2>
<p dir="auto">We've considered not having multiple separate Next.js-based applications on one page, but we're building our application in microfrontend architecture, hence in many cases we want to avoid having whole page as a single application.</p>
<h2 dir="auto">Additional context</h2>
<p dir="auto">More information on our approach to microfrontend architecture can be found here: <a href="https://medium.com/stepstone-tech/microfrontends-extending-service-oriented-architecture-to-frontend-development-part-1-120b71c87b68" rel="nofollow">https://medium.com/stepstone-tech/microfrontends-extending-service-oriented-architecture-to-frontend-development-part-1-120b71c87b68</a> (we've not considered Next.js at the time of writing this article).</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>
<p dir="auto">I notice that next.js ignores the node_modules directory from being compiled by babel. It will cause some errors in old version browsers.</p>
<p dir="auto">For example, after <code class="notranslate">npm run dev</code> in example of <a href="https://github.com/zeit/next.js/tree/canary/examples/data-fetch">data-fetch</a>, it would generate the following code in .next/main.js</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/* 347 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const ansiRegex = __webpack_require__(348);
module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;
/***/ }),
/* 348 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = () => {
const pattern = [
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
].join('|');
return new RegExp(pattern, 'g');
};"><pre class="notranslate"><span class="pl-c">/* 347 */</span>
<span class="pl-c">/***/</span> <span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">module</span><span class="pl-kos">,</span> <span class="pl-s1">exports</span><span class="pl-kos">,</span> <span class="pl-s1">__webpack_require__</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">const</span> <span class="pl-s1">ansiRegex</span> <span class="pl-c1">=</span> <span class="pl-s1">__webpack_require__</span><span class="pl-kos">(</span><span class="pl-c1">348</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">module</span><span class="pl-kos">.</span><span class="pl-en">exports</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span> <span class="pl-c1">=></span> <span class="pl-k">typeof</span> <span class="pl-s1">input</span> <span class="pl-c1">===</span> <span class="pl-s">'string'</span> ? <span class="pl-s1">input</span><span class="pl-kos">.</span><span class="pl-en">replace</span><span class="pl-kos">(</span><span class="pl-s1">ansiRegex</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s">''</span><span class="pl-kos">)</span> : <span class="pl-s1">input</span><span class="pl-kos">;</span>
<span class="pl-c">/***/</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-c">/* 348 */</span>
<span class="pl-c">/***/</span> <span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">module</span><span class="pl-kos">,</span> <span class="pl-s1">exports</span><span class="pl-kos">,</span> <span class="pl-s1">__webpack_require__</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-s1">module</span><span class="pl-kos">.</span><span class="pl-en">exports</span> <span class="pl-c1">=</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">pattern</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span>
<span class="pl-s">'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)'</span><span class="pl-kos">,</span>
<span class="pl-s">'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'</span>
<span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s">'|'</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">RegExp</span><span class="pl-kos">(</span><span class="pl-s1">pattern</span><span class="pl-kos">,</span> <span class="pl-s">'g'</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">These code is generated from <code class="notranslate">strip-ansi</code>, which is one of the dependencies of next.js.<br>
However, Chrome browsers whose version < 41 would throw error of "SyntaxError: Use of const in strict mode" according to <a href="https://caniuse.com/#search=const" rel="nofollow">caniuse</a>. In addition, a few old browsers don't recogize <code class="notranslate">arrow functions</code>.</p>
<p dir="auto">How can I make babel compile node_modules so that my project can run on these old version browsers?</p> | 0 |
<p dir="auto">Not sure if this is related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="797738933" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/9348" data-hovercard-type="issue" data-hovercard-url="/denoland/deno/issues/9348/hovercard" href="https://github.com/denoland/deno/issues/9348">#9348</a>.</p>
<p dir="auto">I am working on two projects at the same time and project <code class="notranslate">B</code> imports a local file from project <code class="notranslate">A</code> (for development only).<br>
When I change the file in project <code class="notranslate">A</code>, I get the following LSP error in project <code class="notranslate">B</code>.<br>
I think that the LSP is not updated when an imported file has changed that is outside the project directory.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Starting Deno language server...
version: 1.8.0 (release, x86_64-apple-darwin)
Connected to "Visual Studio Code" 1.54.1
language server initialized
Server ready.
Error processing TypeScript request: Error: The current snapshot version is missing.
Args: "GetChangeRangeArgs { specifier: "file:///******/deno-cliffy/command/command.ts", old_length: 50291, old_version: "1615124690846", version: "1615124762886" }"
at processResponse (deno:core/core.js:212:11)
at Object.jsonOpSync (deno:core/core.js:236:12)
at ScriptSnapshot.getChangeRange (deno:cli/tsc/99_main_compiler.js:224:19)
at acquireOrUpdateDocument (deno:cli/tsc/00_typescript.js:123008:133)
at Object.updateDocumentWithKey (deno:cli/tsc/00_typescript.js:122974:20)
at Object.getOrCreateSourceFileByPath [as getSourceFileByPath] (deno:cli/tsc/00_typescript.js:149726:49)
at tryReuseStructureFromOldProgram (deno:cli/tsc/00_typescript.js:107087:28)
at Object.createProgram (deno:cli/tsc/00_typescript.js:106618:29)
at synchronizeHostData (deno:cli/tsc/00_typescript.js:149648:26)
at Object.getReferencesAtPosition (deno:cli/tsc/00_typescript.js:149911:13)
[Error - 14:46:04] Request codeLens/resolve failed.
Message: Internal error
Code: -32603"><pre class="notranslate"><code class="notranslate">Starting Deno language server...
version: 1.8.0 (release, x86_64-apple-darwin)
Connected to "Visual Studio Code" 1.54.1
language server initialized
Server ready.
Error processing TypeScript request: Error: The current snapshot version is missing.
Args: "GetChangeRangeArgs { specifier: "file:///******/deno-cliffy/command/command.ts", old_length: 50291, old_version: "1615124690846", version: "1615124762886" }"
at processResponse (deno:core/core.js:212:11)
at Object.jsonOpSync (deno:core/core.js:236:12)
at ScriptSnapshot.getChangeRange (deno:cli/tsc/99_main_compiler.js:224:19)
at acquireOrUpdateDocument (deno:cli/tsc/00_typescript.js:123008:133)
at Object.updateDocumentWithKey (deno:cli/tsc/00_typescript.js:122974:20)
at Object.getOrCreateSourceFileByPath [as getSourceFileByPath] (deno:cli/tsc/00_typescript.js:149726:49)
at tryReuseStructureFromOldProgram (deno:cli/tsc/00_typescript.js:107087:28)
at Object.createProgram (deno:cli/tsc/00_typescript.js:106618:29)
at synchronizeHostData (deno:cli/tsc/00_typescript.js:149648:26)
at Object.getReferencesAtPosition (deno:cli/tsc/00_typescript.js:149911:13)
[Error - 14:46:04] Request codeLens/resolve failed.
Message: Internal error
Code: -32603
</code></pre></div> | <p dir="auto">I have no idea what exactly happened</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', cli\lsp\tsc.rs:806:43
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error processing TypeScript diagnostics:
channel closed
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "PoisonError { inner: .. }"', cli\lsp\language_server.rs:532:8"><pre class="notranslate"><code class="notranslate">thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', cli\lsp\tsc.rs:806:43
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error processing TypeScript diagnostics:
channel closed
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "PoisonError { inner: .. }"', cli\lsp\language_server.rs:532:8
</code></pre></div> | 1 |
<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>
<p dir="auto">Next5 causes some subtle breakage when developing in code that worked correctly in Next4, for a site that uses express. In particular, two things are observed in dev mode:</p>
<ol dir="auto">
<li>There is a flash of unstyled site before all <code class="notranslate"><styled jsx></code> CSS loads on first load. (Client side navs are still fine.)</li>
<li>401s on HMR, when using express-basic-auth.</li>
</ol>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<p dir="auto">I created a minimal folder structure to demo the second behaviour: <a href="https://www.dropbox.com/s/ulazf3kutnsve2v/simple.tgz?dl=0" rel="nofollow">https://www.dropbox.com/s/ulazf3kutnsve2v/simple.tgz?dl=0</a></p>
<ol dir="auto">
<li>Unzip, run yarn install, yarn dev (this uses Next 4.2.3.)</li>
<li>Visit localhost:3000, enter "something", "secure"</li>
<li>Open console.</li>
<li>Edit index.js</li>
<li>In the Network tab, observe that <code class="notranslate">on-demand-entries-ping?page=/</code> returns a 200.</li>
<li>Stop the server</li>
<li>yarn add next@latest, yarn dev.</li>
<li>Visit localhost:3000, enter "something", "secure" (new incognito window if you like)</li>
<li>Edit index.js</li>
<li>In the Network tab, observe that <code class="notranslate">on-demand-entries-ping?page=/</code> returns a 401.</li>
</ol> | <h1 dir="auto">Bug report</h1>
<h2 dir="auto">Describe the bug</h2>
<p dir="auto">In the case using <code class="notranslate">target: 'serverless'</code> flag in <code class="notranslate">next.config.js</code>, the <a href="https://github.com/zeit/next.js/tree/canary/examples/with-ant-design-less">with-ant-design-less</a> sample code build failed.</p>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ yarn build
yarn run v1.17.3
$ next build
Creating an optimized production build ...
> Using external babel configuration
> Location: "/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.babelrc"
Compiled with warnings.
./node_modules/component-classes/index.js
Module not found: Can't resolve 'indexof' in '/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/node_modules/component-classes'
> Build error occurred
TypeError: (0 , _styleChecker.default) is not a function
at Object.g5iu (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:37583:55)
at __webpack_require__ (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:23:31)
at Object.3PeW (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:3977:36)
at __webpack_require__ (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:23:31)
at Object.lbd2 (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:42120:36)
at __webpack_require__ (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:23:31)
at Module.ILaR (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:15153:18)
at __webpack_require__ (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:23:31)
at /Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:91:18
at Object.<anonymous> (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:94:10)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
"><pre class="notranslate">$ <span class="pl-s1">yarn build</span>
<span class="pl-c1">yarn run v1.17.3</span>
$ <span class="pl-s1">next build</span>
<span class="pl-c1">Creating an optimized production build ...</span>
> <span class="pl-s1">Using external babel configuration</span>
> <span class="pl-s1">Location: <span class="pl-s"><span class="pl-pds">"</span>/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.babelrc<span class="pl-pds">"</span></span></span>
<span class="pl-c1">Compiled with warnings.</span>
<span class="pl-c1">./node_modules/component-classes/index.js</span>
<span class="pl-c1">Module not found: Can't resolve 'indexof' in '/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/node_modules/component-classes'</span>
> <span class="pl-s1">Build error occurred</span>
<span class="pl-c1">TypeError: (0 , _styleChecker.default) is not a function</span>
<span class="pl-c1"> at Object.g5iu (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:37583:55)</span>
<span class="pl-c1"> at __webpack_require__ (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:23:31)</span>
<span class="pl-c1"> at Object.3PeW (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:3977:36)</span>
<span class="pl-c1"> at __webpack_require__ (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:23:31)</span>
<span class="pl-c1"> at Object.lbd2 (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:42120:36)</span>
<span class="pl-c1"> at __webpack_require__ (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:23:31)</span>
<span class="pl-c1"> at Module.ILaR (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:15153:18)</span>
<span class="pl-c1"> at __webpack_require__ (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:23:31)</span>
<span class="pl-c1"> at /Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:91:18</span>
<span class="pl-c1"> at Object.<anonymous> (/Users/bko/data/dev/_projects/next-with-ant-design-less-failed/.next/serverless/pages/index.js:94:10)</span>
<span class="pl-c1">error Command failed with exit code 1.</span>
<span class="pl-c1">info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.</span>
</pre></div>
<h2 dir="auto">To Reproduce</h2>
<ol dir="auto">
<li>Go to '<a href="https://github.com/bokuo-okubo/next-with-ant-design-less-failed">https://github.com/bokuo-okubo/next-with-ant-design-less-failed</a>'</li>
<li><code class="notranslate">yarn</code></li>
<li>next => working fine</li>
<li>next build => Error</li>
</ol>
<p dir="auto">(also in the case remove <code class="notranslate">target: 'serverless'</code> flag, build works fine.)</p>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">I tried to build with the check condition also options.dev flag, it works fine.</p>
<p dir="auto"><a href="https://github.com/bokuo-okubo/next-with-ant-design-less-failed/blob/4ceee6c40d3a3e52ef52407715b3a056c03f9605/next.config.js#L34">https://github.com/bokuo-okubo/next-with-ant-design-less-failed/blob/4ceee6c40d3a3e52ef52407715b3a056c03f9605/next.config.js#L34</a></p>
<p dir="auto">In the case of using <code class="notranslate">target: 'serverless'</code> mode, <code class="notranslate">config.externals</code> contain the <code class="notranslate">amp-toolbox-optimizer</code>, so the something wrong around there.</p>
<h2 dir="auto">Screenshots</h2>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6664709/62014476-6102b680-b1dc-11e9-8e4f-5df01453f132.png"><img src="https://user-images.githubusercontent.com/6664709/62014476-6102b680-b1dc-11e9-8e4f-5df01453f132.png" alt="Screenshot 2019-07-29 08 37 21" style="max-width: 100%;"></a></p>
<hr>
<ul dir="auto">
<li>dump the option in the build time<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6664709/62008025-a220a980-b18f-11e9-9845-f3f6de7f2932.png"><img src="https://user-images.githubusercontent.com/6664709/62008025-a220a980-b18f-11e9-9845-f3f6de7f2932.png" alt="" style="max-width: 100%;"></a></li>
</ul>
<h2 dir="auto">System information</h2>
<ul dir="auto">
<li>OS: macOS, Mojave, Version 10.14.5</li>
<li>Browser (if applies) [e.g. chrome, safari]</li>
<li>next version: "9.0.2"</li>
<li>package.json
<ul dir="auto">
<li>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"name": "next-with-ant-design-less-failed",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "node server.js",
"build": "next build",
"start": "cross-env NODE_ENV=production node server.js"
},
"dependencies": {
"antd": "^3.20.7",
"babel-plugin-import": "^1.12.0",
"cross-env": "^5.2.0",
"css-animation": "^1.6.0",
"express": "^4.17.1",
"less": "^3.9.0",
"less-vars-to-js": "^1.3.0",
"next": "9.0.2",
"react": "16.8.6",
"react-dom": "16.8.6"
},
"resolutions": {
"css-animation": "1.5.0"
},
"devDependencies": {
"@zeit/next-less": "^1.0.1",
"null-loader": "^3.0.0",
"style-loader": "^0.23.1"
}
}"><pre class="notranslate">{
<span class="pl-ent">"name"</span>: <span class="pl-s"><span class="pl-pds">"</span>next-with-ant-design-less-failed<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">"scripts"</span>: {
<span class="pl-ent">"dev"</span>: <span class="pl-s"><span class="pl-pds">"</span>node 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>cross-env NODE_ENV=production node server.js<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"dependencies"</span>: {
<span class="pl-ent">"antd"</span>: <span class="pl-s"><span class="pl-pds">"</span>^3.20.7<span class="pl-pds">"</span></span>,
<span class="pl-ent">"babel-plugin-import"</span>: <span class="pl-s"><span class="pl-pds">"</span>^1.12.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"cross-env"</span>: <span class="pl-s"><span class="pl-pds">"</span>^5.2.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"css-animation"</span>: <span class="pl-s"><span class="pl-pds">"</span>^1.6.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"express"</span>: <span class="pl-s"><span class="pl-pds">"</span>^4.17.1<span class="pl-pds">"</span></span>,
<span class="pl-ent">"less"</span>: <span class="pl-s"><span class="pl-pds">"</span>^3.9.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"less-vars-to-js"</span>: <span class="pl-s"><span class="pl-pds">"</span>^1.3.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"next"</span>: <span class="pl-s"><span class="pl-pds">"</span>9.0.2<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">"resolutions"</span>: {
<span class="pl-ent">"css-animation"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.5.0<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"devDependencies"</span>: {
<span class="pl-ent">"@zeit/next-less"</span>: <span class="pl-s"><span class="pl-pds">"</span>^1.0.1<span class="pl-pds">"</span></span>,
<span class="pl-ent">"null-loader"</span>: <span class="pl-s"><span class="pl-pds">"</span>^3.0.0<span class="pl-pds">"</span></span>,
<span class="pl-ent">"style-loader"</span>: <span class="pl-s"><span class="pl-pds">"</span>^0.23.1<span class="pl-pds">"</span></span>
}
}</pre></div>
</li>
</ul>
</li>
</ul>
<h2 dir="auto">Additional context</h2>
<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>
The most recent recent publish of <code class="notranslate">@babel/types</code> is not compiling with TypeScript. The error is <code class="notranslate">TS8020</code>, JSDoc types can only be used inside documentation comments.</p>
<p dir="auto"><strong>Input Code</strong></p>
<ul dir="auto">
<li><a href="https://github.com/o15y/staart/pulls">https://github.com/o15y/staart/pulls</a></li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="node_modules/@babel/types/lib/index.d.ts:2098:30 - error TS8020: JSDoc types can only be used inside documentation comments.
2098 export function isNode(node: ?object): boolean
~~~~~~~
node_modules/@babel/types/lib/index.d.ts:2100:52 - error TS8020: JSDoc types can only be used inside documentation comments.
2100 export function isPlaceholderType(placeholderType: ?string, targetType: string): boolean
~~~~~~~
node_modules/@babel/types/lib/index.d.ts:2104:34 - error TS8020: JSDoc types can only be used inside documentation comments.
2104 export function isType(nodetype: ?string, targetType: string): boolean
~~~~~~~
Found 3 errors."><pre class="notranslate"><code class="notranslate">node_modules/@babel/types/lib/index.d.ts:2098:30 - error TS8020: JSDoc types can only be used inside documentation comments.
2098 export function isNode(node: ?object): boolean
~~~~~~~
node_modules/@babel/types/lib/index.d.ts:2100:52 - error TS8020: JSDoc types can only be used inside documentation comments.
2100 export function isPlaceholderType(placeholderType: ?string, targetType: string): boolean
~~~~~~~
node_modules/@babel/types/lib/index.d.ts:2104:34 - error TS8020: JSDoc types can only be used inside documentation comments.
2104 export function isType(nodetype: ?string, targetType: string): boolean
~~~~~~~
Found 3 errors.
</code></pre></div> | <h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ babel ./test.js --no-babelrc --presets=module:@babel/preset-react --plugins=module:@babel/plugin-transform-regenerator
TypeError: /Users/stevefar/sc/labeltron/test.js: Duplicate declaration "newSessionId" (This is an error on an internal node. Probably an internal error.)
at File.buildCodeFrameError (/Users/stevefar/sc/labeltron/node_modules/@babel/core/lib/transformation/file/file.js:259:12)
at Scope.checkBlockScopedCollisions (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:347:22)
at Scope.registerBinding (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:504:16)
at Scope.registerDeclaration (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:444:14)
at Object.Declaration (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:125:12)
at NodePath._call (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/path/context.js:53:20)
at NodePath.call (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/path/context.js:88:12)
at TraversalContext.visitQueue (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/context.js:118:16)
at TraversalContext.visitMultiple (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/context.js:85:17)"><pre class="notranslate"><code class="notranslate">$ babel ./test.js --no-babelrc --presets=module:@babel/preset-react --plugins=module:@babel/plugin-transform-regenerator
TypeError: /Users/stevefar/sc/labeltron/test.js: Duplicate declaration "newSessionId" (This is an error on an internal node. Probably an internal error.)
at File.buildCodeFrameError (/Users/stevefar/sc/labeltron/node_modules/@babel/core/lib/transformation/file/file.js:259:12)
at Scope.checkBlockScopedCollisions (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:347:22)
at Scope.registerBinding (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:504:16)
at Scope.registerDeclaration (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:444:14)
at Object.Declaration (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:125:12)
at NodePath._call (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/path/context.js:53:20)
at NodePath.call (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/path/context.js:88:12)
at TraversalContext.visitQueue (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/context.js:118:16)
at TraversalContext.visitMultiple (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/context.js:85:17)
</code></pre></div>
<p dir="auto"><strong>Input Code</strong><br>
The is the contents of test.js</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<Component>
{() => {
const saveSession = async () => {
const newSessionId = await someAsyncFunc();
};
}}
</Component>;
"><pre class="notranslate"><span class="pl-c1"><</span><span class="pl-ent">Component</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-kos">{</span>
<span class="pl-k">const</span> <span class="pl-en">saveSession</span> <span class="pl-c1">=</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">const</span> <span class="pl-s1">newSessionId</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-en">someAsyncFunc</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"><</span><span class="pl-c1">/</span><span class="pl-ent">Component</span><span class="pl-c1">></span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
I get a runtime error running <code class="notranslate">babel</code>, I expected it to create the transpiled code.</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<p dir="auto">babel ./test.js --no-babelrc --presets=module:@babel/preset-react --plugins=module:@babel/plugin-transform-regenerator</p>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): 7.0.0-rc.2 (@babel/core 7.0.0-rc.2)</li>
<li>Node/npm version: Node 8/npm 5</li>
<li>OS: OSX 10.13.6</li>
<li>Monorepo no</li>
<li>How you are using Babel: cli</li>
</ul>
<p dir="auto"><strong>Additional context/Screenshots</strong><br>
If I do each transform as a individual step it works:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ cat ./test.js | babel --no-babelrc --presets=module:@babel/preset-react | babel --no-babelrc --plugins=module:@babel/plugin-transform-regenerator
"><pre class="notranslate"><code class="notranslate">$ cat ./test.js | babel --no-babelrc --presets=module:@babel/preset-react | babel --no-babelrc --plugins=module:@babel/plugin-transform-regenerator
</code></pre></div>
<p dir="auto">Its not clear why this would work, but including both the preset and plugin would not.</p> | 0 |
<p dir="auto">Hi,</p>
<p dir="auto">I've been experiencing some dificulty using Pkg.init() and Pkg.add() behind a corporate proxy. See below...</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[31510:31508 - 0:1029] 01:16:24 [root@gb-slo-svb-0139:o +1] /opt $ julia
Version 0.5.0-dev
x86_64-redhat-linux
julia> Pkg.init()
INFO: Initializing package repository /opt/julia/lib/v0.5
INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
ERROR: GitError(Code:ERROR, Class:OS, Failed to connect to github.com: Connection refused)
[inlined code] from libgit2/error.jl:98
in clone at libgit2/repository.jl:189
in __clone#364__ at libgit2.jl:310
in anonymous at pkg/dir.jl:49
in cd at file.jl:47
in init at pkg/dir.jl:47
in init at pkg.jl:22
in eval at ./boot.jl:263
julia>
[31510:31508 - 0:1030] 01:16:32 [root@gb-slo-svb-0139:o +1] /opt $ cd /tmp/
[31510:31508 - 0:1031] 01:16:38 [root@gb-slo-svb-0139:o +1] /tmp $ git clone https://github.com/JuliaLang/METADATA.jl
Cloning into 'METADATA.jl'...
remote: Counting objects: 52190, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 52190 (delta 3), reused 0 (delta 0), pack-reused 52178
Receiving objects: 100% (52190/52190), 6.68 MiB | 3.47 MiB/s, done.
Resolving deltas: 100% (13081/13081), done.
[31510:31508 - 0:1032] 01:16:52 [root@gb-slo-svb-0139:o +1] /tmp $"><pre class="notranslate"><code class="notranslate">[31510:31508 - 0:1029] 01:16:24 [root@gb-slo-svb-0139:o +1] /opt $ julia
Version 0.5.0-dev
x86_64-redhat-linux
julia> Pkg.init()
INFO: Initializing package repository /opt/julia/lib/v0.5
INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
ERROR: GitError(Code:ERROR, Class:OS, Failed to connect to github.com: Connection refused)
[inlined code] from libgit2/error.jl:98
in clone at libgit2/repository.jl:189
in __clone#364__ at libgit2.jl:310
in anonymous at pkg/dir.jl:49
in cd at file.jl:47
in init at pkg/dir.jl:47
in init at pkg.jl:22
in eval at ./boot.jl:263
julia>
[31510:31508 - 0:1030] 01:16:32 [root@gb-slo-svb-0139:o +1] /opt $ cd /tmp/
[31510:31508 - 0:1031] 01:16:38 [root@gb-slo-svb-0139:o +1] /tmp $ git clone https://github.com/JuliaLang/METADATA.jl
Cloning into 'METADATA.jl'...
remote: Counting objects: 52190, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 52190 (delta 3), reused 0 (delta 0), pack-reused 52178
Receiving objects: 100% (52190/52190), 6.68 MiB | 3.47 MiB/s, done.
Resolving deltas: 100% (13081/13081), done.
[31510:31508 - 0:1032] 01:16:52 [root@gb-slo-svb-0139:o +1] /tmp $
</code></pre></div>
<p dir="auto">I've tried the <code class="notranslate">git config --global https.proxy <comeproxy></code> and also <code class="notranslate">git config --global url."git://".insteadOf https://"</code> , i've tried configuring environment variables in the shell. I've even tried issuing Pkg.init() with the full url, replacing https with git or http. I'm a bit stuck at the moment. I can't see any reason why this shouldn't work behind our proxy.</p>
<p dir="auto">Any ideas guys?</p>
<p dir="auto">Cheers,</p>
<p dir="auto">Morgan</p> | <p dir="auto">I'm seeing the following issue when trying to use <code class="notranslate">Pkg.init()</code> on a fresh build of master:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ./julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.5.0-dev+640 (2015-10-06 18:24 UTC)
_/ |\__'_|_|_|\__'_| | Commit 128f8c6 (0 days old master)
|__/ | x86_64-linux-gnu
julia> Pkg.init()
INFO: Initializing package repository /home/lkuper/.julia/v0.5
INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
ERROR: GitError(Code:ERROR, Class:Net, SSL error: error:140E0114:SSL routines:SSL_shutdown:uninitialized)
[inlined code] from libgit2/error.jl:96
in clone at libgit2/repository.jl:185
in clone at libgit2.jl:303
in anonymous at pkg/dir.jl:49
in cd at file.jl:22
in init at pkg/dir.jl:47
in init at pkg.jl:23"><pre class="notranslate"><code class="notranslate">$ ./julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.5.0-dev+640 (2015-10-06 18:24 UTC)
_/ |\__'_|_|_|\__'_| | Commit 128f8c6 (0 days old master)
|__/ | x86_64-linux-gnu
julia> Pkg.init()
INFO: Initializing package repository /home/lkuper/.julia/v0.5
INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
ERROR: GitError(Code:ERROR, Class:Net, SSL error: error:140E0114:SSL routines:SSL_shutdown:uninitialized)
[inlined code] from libgit2/error.jl:96
in clone at libgit2/repository.jl:185
in clone at libgit2.jl:303
in anonymous at pkg/dir.jl:49
in cd at file.jl:22
in init at pkg/dir.jl:47
in init at pkg.jl:23
</code></pre></div>
<p dir="auto">I started seeing this after pulling and rebuilding to fix the libgit2 SSL certificate issue in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="109228540" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/13399" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/13399/hovercard" href="https://github.com/JuliaLang/julia/issues/13399">#13399</a>. I'm now seeing this error instead of the certificate error. There's more discussion on that bug.</p>
<p dir="auto">This is on Ubuntu 14.04, and I have <code class="notranslate">libssl-dev</code> installed. I've already tried <code class="notranslate">make -C deps distclean-libgit2</code>. I even did a <code class="notranslate">make distcleanall</code> to make extra sure.</p>
<p dir="auto">Before I deleted my <code class="notranslate">~/.julia/v0.5</code> directory (because I hoped that doing that and running <code class="notranslate">Pkg.init()</code> might solve the problem), I was seeing a similar error message from <code class="notranslate">Pkg.update()</code>.</p>
<p dir="auto">I'm also having the same problem on CentOS with <code class="notranslate">openssl-devel</code> installed.</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: 18363.418
Windows Terminal version (if applicable):
Any other software?"><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: 18363.418
Windows Terminal version (if applicable):
Any other software?
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">enter the "<g-emoji class="g-emoji" alias="artificial_satellite" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f6f0.png">🛰</g-emoji>" character into the terminal (you will need a patched version of conhost that has the emoji fix).</p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">Emoji should be rendered at full size.</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">Emoji is rendered at half scale:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8010244/68792249-e5b9f900-0642-11ea-8447-afee536b2433.png"><img src="https://user-images.githubusercontent.com/8010244/68792249-e5b9f900-0642-11ea-8447-afee536b2433.png" alt="image" style="max-width: 100%;"></a></p> | <h1 dir="auto">Summary of the new feature/enhancement</h1>
<p dir="auto">Very often when I'm working on a project, I want to open multiple tabs in the same directory. For example, for a web React project, I might want one tab for <code class="notranslate">npm start</code>, another for <code class="notranslate">npm test --watch</code>, and probably keep another around for various console commands I want to run (like <code class="notranslate">git</code>). It'd be very convenient to <code class="notranslate">cd</code> into my project directory and then just hit Ctrl-T a few times to open up more tabs in that project directory.</p>
<p dir="auto">Instead, each tab current seems to be opened in the normal "startingDirectory", which is <code class="notranslate">%USERPROFILE%</code> by default, so you have to <code class="notranslate">cd</code> into the desired working directory for every new tab.</p> | 0 |
<p dir="auto">Several puzzling behaviors appear below wherein calling <code class="notranslate">Series.iloc[int]</code> for a Series with a MultiIndex gives confusing results. Namely, I see unexpected indices mutated. Unexpected indices read and then added to others. As well as more than one index being mutated. Contrast all of the behaviors below with indexing a vanilla numpy array where none of the mystery occurs. Full recreates below along with why I find them surprising. I've seen similar behavior back in the Pandas 0.19.x series.</p>
<h4 dir="auto">Code Sample 1</h4>
<p dir="auto">The length-2 case with duplicated keys at the first level.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [1]: import pandas as pd
In [2]: z = pd.DataFrame()
...: z['i'] = [1, 1]
...: z['j'] = [22, 33]
...: z['k'] = [555, 666]
...: z.set_index(['i', 'j'], inplace=True)
...: v = z.k
...:
In [3]: v
Out[3]:
i j
1 22 555
33 666
Name: k, dtype: int64
In [4]: v.values
Out[4]: array([555, 666])
In [5]: v.iloc[0] += 200; v
Out[5]:
i j
1 22 755
33 666
Name: k, dtype: int64
In [6]: v.iloc[-1] += 300; v
Out[6]:
i j
1 22 755
33 966
Name: k, dtype: int64
In [7]: v.iloc[1] += 100; v
Out[7]:
i j
1 22 1066
33 1066
Name: k, dtype: int64"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">1</span>]: <span class="pl-s1">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-v">In</span> [<span class="pl-c1">2</span>]: <span class="pl-s1">z</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>()
...: <span class="pl-s1">z</span>[<span class="pl-s">'i'</span>] <span class="pl-c1">=</span> [<span class="pl-c1">1</span>, <span class="pl-c1">1</span>]
...: <span class="pl-s1">z</span>[<span class="pl-s">'j'</span>] <span class="pl-c1">=</span> [<span class="pl-c1">22</span>, <span class="pl-c1">33</span>]
...: <span class="pl-s1">z</span>[<span class="pl-s">'k'</span>] <span class="pl-c1">=</span> [<span class="pl-c1">555</span>, <span class="pl-c1">666</span>]
...: <span class="pl-s1">z</span>.<span class="pl-en">set_index</span>([<span class="pl-s">'i'</span>, <span class="pl-s">'j'</span>], <span class="pl-s1">inplace</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
...: <span class="pl-s1">v</span> <span class="pl-c1">=</span> <span class="pl-s1">z</span>.<span class="pl-s1">k</span>
...:
<span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-s1">v</span>
<span class="pl-v">Out</span>[<span class="pl-c1">3</span>]:
<span class="pl-s1">i</span> <span class="pl-s1">j</span>
<span class="pl-c1">1</span> <span class="pl-c1">22</span> <span class="pl-c1">555</span>
<span class="pl-c1">33</span> <span class="pl-c1">666</span>
<span class="pl-v">Name</span>: <span class="pl-s1">k</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span>
<span class="pl-v">In</span> [<span class="pl-c1">4</span>]: <span class="pl-s1">v</span>.<span class="pl-s1">values</span>
<span class="pl-v">Out</span>[<span class="pl-c1">4</span>]: <span class="pl-en">array</span>([<span class="pl-c1">555</span>, <span class="pl-c1">666</span>])
<span class="pl-v">In</span> [<span class="pl-c1">5</span>]: <span class="pl-s1">v</span>.<span class="pl-s1">iloc</span>[<span class="pl-c1">0</span>] <span class="pl-c1">+=</span> <span class="pl-c1">200</span>; <span class="pl-s1">v</span>
<span class="pl-v">Out</span>[<span class="pl-c1">5</span>]:
<span class="pl-s1">i</span> <span class="pl-s1">j</span>
<span class="pl-c1">1</span> <span class="pl-c1">22</span> <span class="pl-c1">755</span>
<span class="pl-c1">33</span> <span class="pl-c1">666</span>
<span class="pl-v">Name</span>: <span class="pl-s1">k</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span>
<span class="pl-v">In</span> [<span class="pl-c1">6</span>]: <span class="pl-s1">v</span>.<span class="pl-s1">iloc</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>] <span class="pl-c1">+=</span> <span class="pl-c1">300</span>; <span class="pl-s1">v</span>
<span class="pl-v">Out</span>[<span class="pl-c1">6</span>]:
<span class="pl-s1">i</span> <span class="pl-s1">j</span>
<span class="pl-c1">1</span> <span class="pl-c1">22</span> <span class="pl-c1">755</span>
<span class="pl-c1">33</span> <span class="pl-c1">966</span>
<span class="pl-v">Name</span>: <span class="pl-s1">k</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span>
<span class="pl-v">In</span> [<span class="pl-c1">7</span>]: <span class="pl-s1">v</span>.<span class="pl-s1">iloc</span>[<span class="pl-c1">1</span>] <span class="pl-c1">+=</span> <span class="pl-c1">100</span>; <span class="pl-s1">v</span>
<span class="pl-v">Out</span>[<span class="pl-c1">7</span>]:
<span class="pl-s1">i</span> <span class="pl-s1">j</span>
<span class="pl-c1">1</span> <span class="pl-c1">22</span> <span class="pl-c1">1066</span>
<span class="pl-c1">33</span> <span class="pl-c1">1066</span>
<span class="pl-v">Name</span>: <span class="pl-s1">k</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span></pre></div>
<h4 dir="auto">Code Sample 1 Problem / Expected Result</h4>
<p dir="auto">Final statement incremented key (1, 33) then wrote the result to be (1, 22) and (1, 33)?<br>
Expected (1, 22) to remain 755 and (1, 33) to become 1066.</p>
<h4 dir="auto">Code Sample 2</h4>
<p dir="auto">The length-2 case with unique keys at each level.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [1]: import pandas as pd
In [2]: z = pd.DataFrame()
...: z['i'] = [1, 2]
...: z['j'] = [3, 4]
...: z['k'] = [7, 8]
...: z.set_index(['i', 'j'], inplace=True)
...: v = z.k
...:
In [3]: v
Out[3]:
i j
1 3 7
2 4 8
Name: k, dtype: int64
In [4]: v.values
Out[4]: array([7, 8])
In [5]: v.iloc[0] += 10; v
Out[5]:
i j
1 3 17
2 4 8
Name: k, dtype: int64
In [6]: v.iloc[-1] += 10; v
Out[6]:
i j
1 3 17
2 4 18
Name: k, dtype: int64
In [7]: v.iloc[1] += 1000; v
Out[7]:
i j
1 3 1018
2 4 18
Name: k, dtype: int64"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">1</span>]: <span class="pl-s1">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-v">In</span> [<span class="pl-c1">2</span>]: <span class="pl-s1">z</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>()
...: <span class="pl-s1">z</span>[<span class="pl-s">'i'</span>] <span class="pl-c1">=</span> [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>]
...: <span class="pl-s1">z</span>[<span class="pl-s">'j'</span>] <span class="pl-c1">=</span> [<span class="pl-c1">3</span>, <span class="pl-c1">4</span>]
...: <span class="pl-s1">z</span>[<span class="pl-s">'k'</span>] <span class="pl-c1">=</span> [<span class="pl-c1">7</span>, <span class="pl-c1">8</span>]
...: <span class="pl-s1">z</span>.<span class="pl-en">set_index</span>([<span class="pl-s">'i'</span>, <span class="pl-s">'j'</span>], <span class="pl-s1">inplace</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
...: <span class="pl-s1">v</span> <span class="pl-c1">=</span> <span class="pl-s1">z</span>.<span class="pl-s1">k</span>
...:
<span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-s1">v</span>
<span class="pl-v">Out</span>[<span class="pl-c1">3</span>]:
<span class="pl-s1">i</span> <span class="pl-s1">j</span>
<span class="pl-c1">1</span> <span class="pl-c1">3</span> <span class="pl-c1">7</span>
<span class="pl-c1">2</span> <span class="pl-c1">4</span> <span class="pl-c1">8</span>
<span class="pl-v">Name</span>: <span class="pl-s1">k</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span>
<span class="pl-v">In</span> [<span class="pl-c1">4</span>]: <span class="pl-s1">v</span>.<span class="pl-s1">values</span>
<span class="pl-v">Out</span>[<span class="pl-c1">4</span>]: <span class="pl-en">array</span>([<span class="pl-c1">7</span>, <span class="pl-c1">8</span>])
<span class="pl-v">In</span> [<span class="pl-c1">5</span>]: <span class="pl-s1">v</span>.<span class="pl-s1">iloc</span>[<span class="pl-c1">0</span>] <span class="pl-c1">+=</span> <span class="pl-c1">10</span>; <span class="pl-s1">v</span>
<span class="pl-v">Out</span>[<span class="pl-c1">5</span>]:
<span class="pl-s1">i</span> <span class="pl-s1">j</span>
<span class="pl-c1">1</span> <span class="pl-c1">3</span> <span class="pl-c1">17</span>
<span class="pl-c1">2</span> <span class="pl-c1">4</span> <span class="pl-c1">8</span>
<span class="pl-v">Name</span>: <span class="pl-s1">k</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span>
<span class="pl-v">In</span> [<span class="pl-c1">6</span>]: <span class="pl-s1">v</span>.<span class="pl-s1">iloc</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>] <span class="pl-c1">+=</span> <span class="pl-c1">10</span>; <span class="pl-s1">v</span>
<span class="pl-v">Out</span>[<span class="pl-c1">6</span>]:
<span class="pl-s1">i</span> <span class="pl-s1">j</span>
<span class="pl-c1">1</span> <span class="pl-c1">3</span> <span class="pl-c1">17</span>
<span class="pl-c1">2</span> <span class="pl-c1">4</span> <span class="pl-c1">18</span>
<span class="pl-v">Name</span>: <span class="pl-s1">k</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span>
<span class="pl-v">In</span> [<span class="pl-c1">7</span>]: <span class="pl-s1">v</span>.<span class="pl-s1">iloc</span>[<span class="pl-c1">1</span>] <span class="pl-c1">+=</span> <span class="pl-c1">1000</span>; <span class="pl-s1">v</span>
<span class="pl-v">Out</span>[<span class="pl-c1">7</span>]:
<span class="pl-s1">i</span> <span class="pl-s1">j</span>
<span class="pl-c1">1</span> <span class="pl-c1">3</span> <span class="pl-c1">1018</span>
<span class="pl-c1">2</span> <span class="pl-c1">4</span> <span class="pl-c1">18</span>
<span class="pl-v">Name</span>: <span class="pl-s1">k</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span></pre></div>
<h4 dir="auto">Code Sample 2 Problem / Expected Result</h4>
<p dir="auto">Above iloc[0] incremented key (1, 3) but then iloc[1] does?<br>
Do not expect 2 different iloc indices differing by 1 to point to the same location in a length 2 array.</p>
<h4 dir="auto">Code Sample 3</h4>
<p dir="auto">The length-3 case.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [1]: import pandas as pd
In [2]: x = pd.DataFrame()
...: x['i'] = [1, 2, 3]
...: x['j'] = [11, 22, 33]
...: x['k'] = [4, 5, 6]
...: x.set_index(['i', 'j'], inplace=True)
...: v = x.k
...:
In [3]: v
Out[3]:
i j
1 11 4
2 22 5
3 33 6
Name: k, dtype: int64
In [4]: v.values
Out[4]: array([4, 5, 6])
In [5]: v.iloc[0] += 4; v
Out[5]:
i j
1 11 8
2 22 5
3 33 6
Name: k, dtype: int64
In [6]: # Expected (3, 33) to be incremented but instead (2, 22) is?
...: v.iloc[2] += 7; v
...:
Out[6]:
i j
1 11 8
2 22 13
3 33 6
Name: k, dtype: int64
In [7]: # Expected (2, 22) to be incremented but instead (1, 11) is set to (2, 22) + increment?
...: v.iloc[1] += 10; v
...:
Out[7]:
i j
1 11 23
2 22 13
3 33 6
Name: k, dtype: int64"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">1</span>]: <span class="pl-s1">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-v">In</span> [<span class="pl-c1">2</span>]: <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>()
...: <span class="pl-s1">x</span>[<span class="pl-s">'i'</span>] <span class="pl-c1">=</span> [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>]
...: <span class="pl-s1">x</span>[<span class="pl-s">'j'</span>] <span class="pl-c1">=</span> [<span class="pl-c1">11</span>, <span class="pl-c1">22</span>, <span class="pl-c1">33</span>]
...: <span class="pl-s1">x</span>[<span class="pl-s">'k'</span>] <span class="pl-c1">=</span> [<span class="pl-c1">4</span>, <span class="pl-c1">5</span>, <span class="pl-c1">6</span>]
...: <span class="pl-s1">x</span>.<span class="pl-en">set_index</span>([<span class="pl-s">'i'</span>, <span class="pl-s">'j'</span>], <span class="pl-s1">inplace</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
...: <span class="pl-s1">v</span> <span class="pl-c1">=</span> <span class="pl-s1">x</span>.<span class="pl-s1">k</span>
...:
<span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-s1">v</span>
<span class="pl-v">Out</span>[<span class="pl-c1">3</span>]:
<span class="pl-s1">i</span> <span class="pl-s1">j</span>
<span class="pl-c1">1</span> <span class="pl-c1">11</span> <span class="pl-c1">4</span>
<span class="pl-c1">2</span> <span class="pl-c1">22</span> <span class="pl-c1">5</span>
<span class="pl-c1">3</span> <span class="pl-c1">33</span> <span class="pl-c1">6</span>
<span class="pl-v">Name</span>: <span class="pl-s1">k</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span>
<span class="pl-v">In</span> [<span class="pl-c1">4</span>]: <span class="pl-s1">v</span>.<span class="pl-s1">values</span>
<span class="pl-v">Out</span>[<span class="pl-c1">4</span>]: <span class="pl-en">array</span>([<span class="pl-c1">4</span>, <span class="pl-c1">5</span>, <span class="pl-c1">6</span>])
<span class="pl-v">In</span> [<span class="pl-c1">5</span>]: <span class="pl-s1">v</span>.<span class="pl-s1">iloc</span>[<span class="pl-c1">0</span>] <span class="pl-c1">+=</span> <span class="pl-c1">4</span>; <span class="pl-s1">v</span>
<span class="pl-v">Out</span>[<span class="pl-c1">5</span>]:
<span class="pl-s1">i</span> <span class="pl-s1">j</span>
<span class="pl-c1">1</span> <span class="pl-c1">11</span> <span class="pl-c1">8</span>
<span class="pl-c1">2</span> <span class="pl-c1">22</span> <span class="pl-c1">5</span>
<span class="pl-c1">3</span> <span class="pl-c1">33</span> <span class="pl-c1">6</span>
<span class="pl-v">Name</span>: <span class="pl-s1">k</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span>
<span class="pl-v">In</span> [<span class="pl-c1">6</span>]: <span class="pl-c"># Expected (3, 33) to be incremented but instead (2, 22) is?</span>
...: <span class="pl-s1">v</span>.<span class="pl-s1">iloc</span>[<span class="pl-c1">2</span>] <span class="pl-c1">+=</span> <span class="pl-c1">7</span>; <span class="pl-s1">v</span>
...:
<span class="pl-v">Out</span>[<span class="pl-c1">6</span>]:
<span class="pl-s1">i</span> <span class="pl-s1">j</span>
<span class="pl-c1">1</span> <span class="pl-c1">11</span> <span class="pl-c1">8</span>
<span class="pl-c1">2</span> <span class="pl-c1">22</span> <span class="pl-c1">13</span>
<span class="pl-c1">3</span> <span class="pl-c1">33</span> <span class="pl-c1">6</span>
<span class="pl-v">Name</span>: <span class="pl-s1">k</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span>
<span class="pl-v">In</span> [<span class="pl-c1">7</span>]: <span class="pl-c"># Expected (2, 22) to be incremented but instead (1, 11) is set to (2, 22) + increment?</span>
...: <span class="pl-s1">v</span>.<span class="pl-s1">iloc</span>[<span class="pl-c1">1</span>] <span class="pl-c1">+=</span> <span class="pl-c1">10</span>; <span class="pl-s1">v</span>
...:
<span class="pl-v">Out</span>[<span class="pl-c1">7</span>]:
<span class="pl-s1">i</span> <span class="pl-s1">j</span>
<span class="pl-c1">1</span> <span class="pl-c1">11</span> <span class="pl-c1">23</span>
<span class="pl-c1">2</span> <span class="pl-c1">22</span> <span class="pl-c1">13</span>
<span class="pl-c1">3</span> <span class="pl-c1">33</span> <span class="pl-c1">6</span>
<span class="pl-v">Name</span>: <span class="pl-s1">k</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span></pre></div>
<h4 dir="auto">Code Sample 3 Problem / Expected Result</h4>
<p dir="auto">Comments inline above</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
INSTALLED VERSIONS
------------------
commit: None
python: 3.5.3.final.0
python-bits: 64
OS: Linux
OS-release: 4.1.35-pv-ts2
machine: x86_64
processor:
byteorder: little
LC_ALL: en_US.UTF-8
LANG: en_US.utf8
LOCALE: en_US.UTF-8
<p dir="auto">pandas: 0.20.3<br>
pytest: None<br>
pip: 9.0.1<br>
setuptools: 27.2.0<br>
Cython: None<br>
numpy: 1.13.1<br>
scipy: None<br>
xarray: None<br>
IPython: 6.1.0<br>
sphinx: None<br>
patsy: None<br>
dateutil: 2.6.1<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: None<br>
feather: None<br>
matplotlib: None<br>
openpyxl: None<br>
xlrd: None<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: None<br>
html5lib: None<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.9.6<br>
s3fs: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details> | <p dir="auto">I'll propose a</p>
<p dir="auto"><code class="notranslate">cache_datetime=False</code> keyword as an addition to <code class="notranslate">read_csv</code> and <code class="notranslate">pd.to_datetime</code></p>
<p dir="auto">this would use a lookup cache (a dict will probably work), to map datetime strings to Timestamp objects. For repeated dates this will lead to some dramatic speedups.</p>
<p dir="auto">Care must be taken if a <code class="notranslate">format</code> kw is provided (in <code class="notranslate">to_datetime</code> as the cache will have to be exposed). This would be an optional (and default <code class="notranslate">False</code>) as I think if you have unique dates this could modestly slow down things (but can be revisted if needed).</p>
<p dir="auto">This <em>might</em> need also want to accept a list of column names (like <code class="notranslate">parse_dates</code>) to enable per-column caching (e.g. you might want to apply to a column, but not the index of example).</p>
<p dir="auto">possibly we could overload <code class="notranslate">parse_dates='cache'</code> to mean this as well</p>
<p dir="auto">trivial example</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: pd.DataFrame({'A' : ['20130101 00:00:00']*10000}).to_csv('test.csv',index=True)
In [14]: def parser(x):
....: uniques = pd.Series(pd.unique(x))
....: d = pd.to_datetime(uniques)
....: d.index = uniques
....: return Series(x).map(d).values
....:
In [3]: df1 = pd.read_csv('test.csv',index_col=0, parse_dates=['A'])
In [4]: df2 = pd.read_csv('test.csv',index_col=0, parse_dates=['A'], date_parser=parser)
In [17]: %timeit pd.read_csv('test.csv',index_col=0, parse_dates=['A'])
1 loops, best of 3: 969 ms per loop
In [18]: %timeit pd.read_csv('test.csv',index_col=0, parse_dates=['A'], date_parser=parser)
100 loops, best of 3: 5.31 ms per loop
In [7]: df1.equals(df2)
Out[7]: True"><pre class="notranslate"><code class="notranslate">In [1]: pd.DataFrame({'A' : ['20130101 00:00:00']*10000}).to_csv('test.csv',index=True)
In [14]: def parser(x):
....: uniques = pd.Series(pd.unique(x))
....: d = pd.to_datetime(uniques)
....: d.index = uniques
....: return Series(x).map(d).values
....:
In [3]: df1 = pd.read_csv('test.csv',index_col=0, parse_dates=['A'])
In [4]: df2 = pd.read_csv('test.csv',index_col=0, parse_dates=['A'], date_parser=parser)
In [17]: %timeit pd.read_csv('test.csv',index_col=0, parse_dates=['A'])
1 loops, best of 3: 969 ms per loop
In [18]: %timeit pd.read_csv('test.csv',index_col=0, parse_dates=['A'], date_parser=parser)
100 loops, best of 3: 5.31 ms per loop
In [7]: df1.equals(df2)
Out[7]: True
</code></pre></div> | 0 |
<p dir="auto">If you add multiple child elements to a ToolTip, you will receive the following error:</p>
<p dir="auto"><strong>Invariant Violation</strong><br>
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in.</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/mui-org/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">The current error message is associated with forgetting to import a component, making troubleshooting more difficult.</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">Either update the ToolTip component to allow multiple children, or throw a more descriptive error.</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<p dir="auto"><a href="https://codesandbox.io/s/qv37l9w609" rel="nofollow">https://codesandbox.io/s/qv37l9w609</a></p>
<h2 dir="auto">Context</h2>
<p dir="auto">Took extra time to find the cause of the Invariant Violation</p>
<h2 dir="auto">Your Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Material-UI</td>
<td>24</td>
</tr>
<tr>
<td>React</td>
<td>16</td>
</tr>
<tr>
<td>browser</td>
<td>Chrome</td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table> | <p dir="auto">Hi, for the url here: <a href="https://github.com/callemall/material-ui/blob/v1-beta/docs/src/pages/guides/testing.md#examples">Testing Documentation of material UI</a> where is 'material-ui/test-utils' coming from? is that a package included or does that need to be installed separately?</p>
<p dir="auto">Also, what is the best way to test your components when mounting them with Enzyme? there seem to be different suggestions which are adding to my confusion. 1. Pass context to the mount call: <code class="notranslate">const wrapper = mount( <CreateAssessment />, { context: {muiTheme}, childContextTypes: {muiTheme: React.PropTypes.object} } )</code></p>
<p dir="auto">or use Material-UI's mount wrapper?</p>
<ul dir="auto">
<li>[x ] I have searched the <a href="https://github.com/callemall/material-ui/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></li>
<li></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>Material-UI</td>
<td>0.16.7</td>
</tr>
<tr>
<td>React</td>
<td>15.3.2</td>
</tr>
<tr>
<td>browser</td>
<td></td>
</tr>
<tr>
<td>Jest</td>
<td>21.2.1</td>
</tr>
<tr>
<td>Enzyme</td>
<td>3.1.1</td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table> | 0 |
<p dir="auto">Hello,</p>
<p dir="auto">there are some issues with <a href="http://twbs.github.io/bootstrap/" rel="nofollow">http://twbs.github.io/bootstrap/</a></p>
<p dir="auto">here are errors from chrome console</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" GET http://twbs.github.io/dist/css/bootstrap.min.css 404 (Not Found) twbs.github.io/:19
GET http://twbs.github.io/assets/css/docs.min.css 404 (Not Found) twbs.github.io/:22
GET http://twbs.github.io/assets/js/docs.min.js 404 (Not Found) (index):231
GET http://twbs.github.io/dist/js/bootstrap.min.js 404 (Not Found) (index):230"><pre class="notranslate"><code class="notranslate"> GET http://twbs.github.io/dist/css/bootstrap.min.css 404 (Not Found) twbs.github.io/:19
GET http://twbs.github.io/assets/css/docs.min.css 404 (Not Found) twbs.github.io/:22
GET http://twbs.github.io/assets/js/docs.min.js 404 (Not Found) (index):231
GET http://twbs.github.io/dist/js/bootstrap.min.js 404 (Not Found) (index):230
</code></pre></div>
<p dir="auto">the index page is ko and links are ko but other pages are fine<br>
Cheers,<br>
Jamal</p> | <p dir="auto">Hey guys. Did you notice that the home page mentioned in the title is broken?</p>
<p dir="auto">This is what I see since a few weeks (!) now.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/dea6925fae3c5c2228e0ce860e12401ad2c8977b201d70c2cb98c4402dd42a58/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313038373030322f323234363636362f36666232623236302d396436362d313165332d393036362d3535316636376664396665322e706e67"><img src="https://camo.githubusercontent.com/dea6925fae3c5c2228e0ce860e12401ad2c8977b201d70c2cb98c4402dd42a58/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313038373030322f323234363636362f36666232623236302d396436362d313165332d393036362d3535316636376664396665322e706e67" alt="croppercapture 1" data-canonical-src="https://f.cloud.github.com/assets/1087002/2246666/6fb2b260-9d66-11e3-9066-551f67fd9fe2.png" style="max-width: 100%;"></a></p>
<p dir="auto">It only appears on the index.html, every sub page works fine.<br>
Also all the travis builds appear to be working (<a href="https://travis-ci.org/twbs/bootstrap" rel="nofollow">https://travis-ci.org/twbs/bootstrap</a>).</p>
<p dir="auto">Hope I could help with some issues.</p> | 1 |
<p dir="auto">I want to use <code class="notranslate">sklearn.compose.ColumnTransformer</code> consistently (not parallel, so, the second transformer should be executed only after the first) for intersecting lists of columns in this way:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="log_transformer = p.FunctionTransformer(lambda x: np.log(x))
df = pd.DataFrame({'a': [1,2, np.NaN, 4], 'b': [1,np.NaN, 3, 4], 'c': [1 ,2, 3, 4]})
compose.ColumnTransformer(n_jobs=1,
transformers=[
('num', impute.SimpleImputer() , ['a', 'b']),
('log', log_transformer, ['b', 'c']),
('scale', p.StandardScaler(), ['a', 'b', 'c'])
]).fit_transform(df)"><pre class="notranslate"><code class="notranslate">log_transformer = p.FunctionTransformer(lambda x: np.log(x))
df = pd.DataFrame({'a': [1,2, np.NaN, 4], 'b': [1,np.NaN, 3, 4], 'c': [1 ,2, 3, 4]})
compose.ColumnTransformer(n_jobs=1,
transformers=[
('num', impute.SimpleImputer() , ['a', 'b']),
('log', log_transformer, ['b', 'c']),
('scale', p.StandardScaler(), ['a', 'b', 'c'])
]).fit_transform(df)
</code></pre></div>
<p dir="auto">So, I want to use <code class="notranslate">SimpleImputer</code> for <code class="notranslate">'a'</code>, <code class="notranslate">'b'</code>, then <code class="notranslate">log</code> for <code class="notranslate">'b'</code>, <code class="notranslate">'c'</code>, and then <code class="notranslate">StandardScaler</code> for <code class="notranslate">'a'</code>, <code class="notranslate">'b'</code>, <code class="notranslate">'c'</code>.</p>
<p dir="auto">But:</p>
<ol dir="auto">
<li>I get array of <code class="notranslate">(4, 7)</code> shape.</li>
<li>I still get <code class="notranslate">Nan</code> in <code class="notranslate">a</code> and <code class="notranslate">b</code> columns.</li>
</ol>
<p dir="auto">So, how can I use <code class="notranslate">ColumnTransformer</code> for different columns in the manner of <code class="notranslate">Pipeline</code>?</p>
<p dir="auto">P.S. please note that I already <a href="https://stackoverflow.com/questions/62225230/consistent-columntransformer-for-intersecting-lists-of-columns" rel="nofollow">asked a question on SO.</a></p> | <p dir="auto"><a href="https://scikit-learn.org/stable/modules/clustering.html#k-means" rel="nofollow">In the documentation</a> , you wrote:</p>
<blockquote>
<p dir="auto">The algorithm supports sample weights, which can be given by a parameter sample_weight. This allows to assign more weight to some samples when computing cluster centers and values of inertia. For example, assigning a weight of 2 to a sample is equivalent to adding a duplicate of that sample to the dataset X.</p>
</blockquote>
<p dir="auto">This is disproved by the following code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sklearn.cluster import KMeans
vecs = [[0], [1]]
weights = [2 , 2]
kmeans = KMeans(n_clusters=1)
kmeans.fit(vecs, sample_weight=weights)
print(kmeans.inertia_) #Outputs 0.5
vecs = [[0], [0], [1], [1]]
weights = [1 , 1, 1, 1]
kmeans = KMeans(n_clusters=1)
kmeans.fit(vecs, sample_weight=weights)
print(kmeans.inertia_) #Outputs 1.0"><pre class="notranslate"><code class="notranslate">from sklearn.cluster import KMeans
vecs = [[0], [1]]
weights = [2 , 2]
kmeans = KMeans(n_clusters=1)
kmeans.fit(vecs, sample_weight=weights)
print(kmeans.inertia_) #Outputs 0.5
vecs = [[0], [0], [1], [1]]
weights = [1 , 1, 1, 1]
kmeans = KMeans(n_clusters=1)
kmeans.fit(vecs, sample_weight=weights)
print(kmeans.inertia_) #Outputs 1.0
</code></pre></div>
<p dir="auto">Suggested fix:<br>
Explain the correct definition of the inertia to <a href="https://scikit-learn.org/stable/modules/clustering.html#k-means" rel="nofollow">this site</a> and <a href="https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html#sklearn.cluster.KMeans" rel="nofollow">this site</a> . I would suggest adding the weights to the equation on <a href="https://scikit-learn.org/stable/modules/clustering.html#k-means" rel="nofollow">this site</a> .</p> | 0 |
<p dir="auto">I've upgraded to matplotlib 1.4.0 and am getting invalid EPS files (according to Preview) when I save figures that use</p>
<p dir="auto">basemap (1.0.7). The same figure in PNG or PDF format works fine. I also saved a bar chart in EPS that worked.</p>
<p dir="auto">I have verified that this happens in both OS X Mavericks and Mountain Lion. It doesn't matter whether I install using pip or homebrew. If I downgrade to matplotlib 1.3.1 it works fine.</p>
<p dir="auto">Below is the code I was trying:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.basemap import Basemap
plt.figure()
m = Basemap(projection='npstere',lon_0=-270.,boundinglat=30.,round=True)
m.drawcoastlines(linewidth=1)
m.drawmapboundary(linewidth=1)
m.fillcontinents(color='silver')
m.drawmeridians(np.arange(-360,1,60))
m.drawparallels(np.arange(30,90,30))
plt.savefig('test.eps')
plt.savefig('test.pdf')
plt.savefig('test.png')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>
<span class="pl-s1">matplotlib</span>.<span class="pl-en">use</span>(<span class="pl-s">'Agg'</span>)
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</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-k">from</span> <span class="pl-s1">mpl_toolkits</span>.<span class="pl-s1">basemap</span> <span class="pl-k">import</span> <span class="pl-v">Basemap</span>
<span class="pl-s1">plt</span>.<span class="pl-en">figure</span>()
<span class="pl-s1">m</span> <span class="pl-c1">=</span> <span class="pl-v">Basemap</span>(<span class="pl-s1">projection</span><span class="pl-c1">=</span><span class="pl-s">'npstere'</span>,<span class="pl-s1">lon_0</span><span class="pl-c1">=</span><span class="pl-c1">-</span><span class="pl-c1">270.</span>,<span class="pl-s1">boundinglat</span><span class="pl-c1">=</span><span class="pl-c1">30.</span>,<span class="pl-s1">round</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-s1">m</span>.<span class="pl-en">drawcoastlines</span>(<span class="pl-s1">linewidth</span><span class="pl-c1">=</span><span class="pl-c1">1</span>)
<span class="pl-s1">m</span>.<span class="pl-en">drawmapboundary</span>(<span class="pl-s1">linewidth</span><span class="pl-c1">=</span><span class="pl-c1">1</span>)
<span class="pl-s1">m</span>.<span class="pl-en">fillcontinents</span>(<span class="pl-s1">color</span><span class="pl-c1">=</span><span class="pl-s">'silver'</span>)
<span class="pl-s1">m</span>.<span class="pl-en">drawmeridians</span>(<span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">-</span><span class="pl-c1">360</span>,<span class="pl-c1">1</span>,<span class="pl-c1">60</span>))
<span class="pl-s1">m</span>.<span class="pl-en">drawparallels</span>(<span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">30</span>,<span class="pl-c1">90</span>,<span class="pl-c1">30</span>))
<span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'test.eps'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'test.pdf'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'test.png'</span>)</pre></div>
<p dir="auto">[TAC edited for formatting]</p> | <p dir="auto">the following script works fine on python 2.7.8, however it produces a non valid eps file on python 3.4.1.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np
import matplotlib
from matplotlib import pyplot as plt
if __name__ == "__main__":
print ("Using matplotlib v%s" %matplotlib.__version__)
x = np.linspace(0, 10)
y = np.sin(x)
plt.figure()
plt.plot(x, y)
plt.savefig("out.eps", format='eps')
plt.show()"><pre class="notranslate"><code class="notranslate">import numpy as np
import matplotlib
from matplotlib import pyplot as plt
if __name__ == "__main__":
print ("Using matplotlib v%s" %matplotlib.__version__)
x = np.linspace(0, 10)
y = np.sin(x)
plt.figure()
plt.plot(x, y)
plt.savefig("out.eps", format='eps')
plt.show()
</code></pre></div>
<p dir="auto">The two attachements following are the two outputs generated by python2 and python3 respectively (I changed the file extension to png to be able to upload them, but they are indeed eps files).<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1103106/4217290/bfd6d684-38e5-11e4-9f4b-d6a64c6065cb.png"><img src="https://cloud.githubusercontent.com/assets/1103106/4217290/bfd6d684-38e5-11e4-9f4b-d6a64c6065cb.png" alt="out_python2" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1103106/4217291/bfd77aee-38e5-11e4-9c7d-9e817a3cb857.png"><img src="https://cloud.githubusercontent.com/assets/1103106/4217291/bfd77aee-38e5-11e4-9c7d-9e817a3cb857.png" alt="out_python3" style="max-width: 100%;"></a></p>
<p dir="auto">With a diff of the two files, and some manual editing, I found that the line responsible for the malfunctioning is the following</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="377c377
< /DejaVuSans findfont
---
> /b'DejaVuSans' findfont"><pre class="notranslate"><code class="notranslate">377c377
< /DejaVuSans findfont
---
> /b'DejaVuSans' findfont
</code></pre></div> | 1 |
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6461412/13253842/82ed2eac-da3e-11e5-8082-0f3d9003781e.png"><img src="https://cloud.githubusercontent.com/assets/6461412/13253842/82ed2eac-da3e-11e5-8082-0f3d9003781e.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Should the sections have different titles, or would you prefer that they are merged? If you can't define them at a single place we can also add code that does the merging. (assign to me then)</p> | <ul dir="auto">
<li>VSCode Version: 1.1.0</li>
<li>OS Version: Windows 8.1
<ul dir="auto">
<li>C# extension used in some screen shots below: <a href="https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.0.5-rc2"><code class="notranslate">v1.0.5-rc2</code></a></li>
</ul>
</li>
</ul>
<h5 dir="auto">Steps to Reproduce:</h5>
<ol dir="auto">
<li>Show Errors and Warnings in a project with a few of each.</li>
</ol>
<p dir="auto">or</p>
<ol dir="auto">
<li>Stop at a breakpoint in a project using long-named classes or with a deeply-nested property hierarchy.</li>
</ol>
<h5 dir="auto">Notes</h5>
<p dir="auto">Highlighting on hover only goes so far in a few more places than <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="149910067" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/5580" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/5580/hovercard" href="https://github.com/microsoft/vscode/issues/5580">#5580</a> covers...</p>
<h6 dir="auto">Build messages</h6>
<p dir="auto">Note these messages can only be seen in full affter opening the offending file.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6431421/15157544/f99d0ce0-16a0-11e6-8edc-19a2742ea2c6.png"><img src="https://cloud.githubusercontent.com/assets/6431421/15157544/f99d0ce0-16a0-11e6-8edc-19a2742ea2c6.png" alt="unwrappederrors" style="max-width: 100%;"></a></p>
<h6 dir="auto">Call stack at breakpoint</h6>
<p dir="auto">This particular view might be improved if the stack showed <code class="notranslate">{method}, {namespace-qualified class}</code> or <code class="notranslate">{class.method}, {namespace}</code>.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6431421/15157553/0354c8d6-16a1-11e6-93e5-9da3a69f4365.png"><img src="https://cloud.githubusercontent.com/assets/6431421/15157553/0354c8d6-16a1-11e6-93e5-9da3a69f4365.png" alt="unwrappedcallstack" style="max-width: 100%;"></a></p>
<h6 dir="auto">Deeply nested variables</h6>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6431421/15157557/06ce53ec-16a1-11e6-9ad2-d5f8bd6c529a.png"><img src="https://cloud.githubusercontent.com/assets/6431421/15157557/06ce53ec-16a1-11e6-9ad2-d5f8bd6c529a.png" alt="unwrappedvariables" style="max-width: 100%;"></a></p> | 0 |
<p dir="auto">Not sure whether this is actually a <code class="notranslate">requests</code> bug, but trying here first as it's here it manifests.</p>
<p dir="auto">I'm using a http proxy for https traffic, and it works fine for normal GET, POST and PUT requests using <code class="notranslate">requests</code>. However, if enabled chunked uploads, it fails with <code class="notranslate">requests.exceptions.ConnectionError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)</code></p>
<p dir="auto">From googling it appears to be trying to access the http proxy using https. I'm fully aware of the normal "problem" where people confuse the protocols and use "https://" for their http proxy, but as can be seen in the example below this is not the problem in this case.</p>
<p dir="auto">I've been digging into <code class="notranslate">adapters.py</code> and the <code class="notranslate">low_conn</code> connection it uses <em>appears</em> to have the correct proxy set (with "http" as protocol), but this is outside my expertise.</p>
<h2 dir="auto">Expected Result</h2>
<p dir="auto">Request to go through proxy like for non-chunked uploads without errors.</p>
<h2 dir="auto">Actual Result</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 521, in send
low_conn.endheaders()
File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1011, in _send_output
self.send(msg)
File "/usr/lib/python3.8/http/client.py", line 951, in send
self.connect()
File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 414, in connect
self.sock = ssl_wrap_socket(
File "/usr/local/lib/python3.8/dist-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(
File "/usr/local/lib/python3.8/dist-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 521, in send
low_conn.endheaders()
File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1011, in _send_output
self.send(msg)
File "/usr/lib/python3.8/http/client.py", line 951, in send
self.connect()
File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 414, in connect
self.sock = ssl_wrap_socket(
File "/usr/local/lib/python3.8/dist-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(
File "/usr/local/lib/python3.8/dist-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)
</code></pre></div>
<h2 dir="auto">Reproduction Steps</h2>
<p dir="auto">Run script below with and without proxy. Without proxy it works fine, with http proxy it gives above error.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import requests
with open('test', 'w') as f:
f.write('test')
with open('test', 'rb') as f:
resp = requests.put('https://www.google.com', data=f)
assert resp.status_code == 405
def x():
yield "test".encode('utf-8')
resp = requests.put('https://www.google.com', data=x())
assert resp.status_code == 405"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">requests</span>
<span class="pl-k">with</span> <span class="pl-en">open</span>(<span class="pl-s">'test'</span>, <span class="pl-s">'w'</span>) <span class="pl-k">as</span> <span class="pl-s1">f</span>:
<span class="pl-s1">f</span>.<span class="pl-en">write</span>(<span class="pl-s">'test'</span>)
<span class="pl-k">with</span> <span class="pl-en">open</span>(<span class="pl-s">'test'</span>, <span class="pl-s">'rb'</span>) <span class="pl-k">as</span> <span class="pl-s1">f</span>:
<span class="pl-s1">resp</span> <span class="pl-c1">=</span> <span class="pl-s1">requests</span>.<span class="pl-en">put</span>(<span class="pl-s">'https://www.google.com'</span>, <span class="pl-s1">data</span><span class="pl-c1">=</span><span class="pl-s1">f</span>)
<span class="pl-k">assert</span> <span class="pl-s1">resp</span>.<span class="pl-s1">status_code</span> <span class="pl-c1">==</span> <span class="pl-c1">405</span>
<span class="pl-k">def</span> <span class="pl-en">x</span>():
<span class="pl-k">yield</span> <span class="pl-s">"test"</span>.<span class="pl-en">encode</span>(<span class="pl-s">'utf-8'</span>)
<span class="pl-s1">resp</span> <span class="pl-c1">=</span> <span class="pl-s1">requests</span>.<span class="pl-en">put</span>(<span class="pl-s">'https://www.google.com'</span>, <span class="pl-s1">data</span><span class="pl-c1">=</span><span class="pl-en">x</span>())
<span class="pl-k">assert</span> <span class="pl-s1">resp</span>.<span class="pl-s1">status_code</span> <span class="pl-c1">==</span> <span class="pl-c1">405</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": "3.0.1"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.4"
},
"implementation": {
"name": "CPython",
"version": "3.8.10"
},
"platform": {
"release": "4.18.0-425.10.1.el8_7.x86_64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.28.2"
},
"system_ssl": {
"version": "1010106f"
},
"urllib3": {
"version": "1.26.14"
},
"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>3.0.1<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.4<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.8.10<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>4.18.0-425.10.1.el8_7.x86_64<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.2<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.14<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> | <p dir="auto">I am using the chunked request body feature (<code class="notranslate">data=generator</code>). When defining a HTTP proxy and sending a request to a HTTPS URL, <code class="notranslate">requests</code> is trying to perform a TLS handshake with the (HTTP) proxy server, instead of sending a CONNECT request and performing the handshake with the target server through the tunnel. This behaviour prevents the request from completing successfully.</p>
<h2 dir="auto">Expected Result</h2>
<p dir="auto"><code class="notranslate">requests</code> should send a CONNECT request to the proxy and negotiate TLS with the target server through the tunnel.</p>
<h2 dir="auto">Actual Result</h2>
<p dir="auto"><code class="notranslate">requests</code> tries to negotiate TLS directly with the HTTP proxy server, and fails to do so.</p>
<h2 dir="auto">Reproduction Steps</h2>
<p dir="auto">Run an HTTP proxy on <code class="notranslate">127.0.0.1:8080</code> and execute the following code:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" import requests
def body_generator():
yield "test"
return
requests.post("https://www.google.com/",
proxies={"https": "http://127.0.0.1:8080/"},
data=body_generator(),
)"><pre class="notranslate"> <span class="pl-k">import</span> <span class="pl-s1">requests</span>
<span class="pl-k">def</span> <span class="pl-en">body_generator</span>():
<span class="pl-k">yield</span> <span class="pl-s">"test"</span>
<span class="pl-k">return</span>
<span class="pl-s1">requests</span>.<span class="pl-en">post</span>(<span class="pl-s">"https://www.google.com/"</span>,
<span class="pl-s1">proxies</span><span class="pl-c1">=</span>{<span class="pl-s">"https"</span>: <span class="pl-s">"http://127.0.0.1:8080/"</span>},
<span class="pl-s1">data</span><span class="pl-c1">=</span><span class="pl-en">body_generator</span>(),
)</pre></div>
<h2 dir="auto">More info</h2>
<p dir="auto">The chunked encoding generator feature is implemented in <code class="notranslate">requests/adapters.py</code>:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="try:
if not chunked:
resp = conn.urlopen(
...
)
# Send the request.
else:
if hasattr(conn, "proxy_pool"):
conn = conn.proxy_pool
low_conn = conn._get_conn(timeout=DEFAULT_POOL_TIMEOUT)
try:
... Send request with chunked body ..."><pre class="notranslate"><span class="pl-k">try</span>:
<span class="pl-k">if</span> <span class="pl-c1">not</span> <span class="pl-s1">chunked</span>:
<span class="pl-s1">resp</span> <span class="pl-c1">=</span> <span class="pl-s1">conn</span>.<span class="pl-en">urlopen</span>(
...
)
<span class="pl-c"># Send the request.</span>
<span class="pl-k">else</span>:
<span class="pl-k">if</span> <span class="pl-en">hasattr</span>(<span class="pl-s1">conn</span>, <span class="pl-s">"proxy_pool"</span>):
<span class="pl-s1">conn</span> <span class="pl-c1">=</span> <span class="pl-s1">conn</span>.<span class="pl-s1">proxy_pool</span>
<span class="pl-s1">low_conn</span> <span class="pl-c1">=</span> <span class="pl-s1">conn</span>.<span class="pl-en">_get_conn</span>(<span class="pl-s1">timeout</span><span class="pl-c1">=</span><span class="pl-v">DEFAULT_POOL_TIMEOUT</span>)
<span class="pl-k">try</span>:
... <span class="pl-v">Send</span> <span class="pl-s1">request</span> <span class="pl-k">with</span> <span class="pl-s1">chunked</span> <span class="pl-s1">body</span> ...</pre></div>
<p dir="auto">In the case of chunked encoding, instead of using <code class="notranslate">conn.urlopen</code> to send the request, it uses <code class="notranslate">conn._get_conn</code> and sends the request manually.<br>
It seems like, for some reason, <code class="notranslate">conn._get_conn</code> is not handling the proxy correctly.</p> | 1 |
<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>yes/no</td>
</tr>
<tr>
<td>RFC?</td>
<td>yes/no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.4.7</td>
</tr>
</tbody>
</table>
<p dir="auto">Hello,</p>
<p dir="auto">Updating one of our project from Sf 3.4.4 to 3.4.7 i see an error at cache:clear command or any other cli command from the console.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="./app/console cache:clear --no-warmup --env=local (same for dev)
In Container.php line 297:
Circular reference detected for service "routing.loader", path: "routing.loader"."><pre class="notranslate"><code class="notranslate">./app/console cache:clear --no-warmup --env=local (same for dev)
In Container.php line 297:
Circular reference detected for service "routing.loader", path: "routing.loader".
</code></pre></div>
<p dir="auto">Try to check our routing import but did not found any duplicate... anyway it is only appearing when updating to 3.4.7 .</p>
<p dir="auto">Did something changed related to this subject? do we need to take care of something in special in our configs?</p>
<p dir="auto">Thx</p> | <p dir="auto">Hey guys!</p>
<p dir="auto">Currently, there's no standard way of retrieving the absolute URL to an asset. This would be useful when generating asset paths in a template for an email. Would be cool a function like:</p>
<div class="highlight highlight-text-html-twig notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{{ asset_url('images/foo.jpg') }}"><pre class="notranslate">{{ asset_url(<span class="pl-s"><span class="pl-pds">'</span>images/foo.jpg<span class="pl-pds">'</span></span>) }}</pre></div>
<p dir="auto">The current solution is not pratical and breaks when using CDN.</p>
<p dir="auto">Thanks,<br>
Marcos</p> | 0 |
<p dir="auto">Since <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="541937783" data-permission-text="Title is private" data-url="https://github.com/DefinitelyTyped/DefinitelyTyped/issues/41225" data-hovercard-type="pull_request" data-hovercard-url="/DefinitelyTyped/DefinitelyTyped/pull/41225/hovercard" href="https://github.com/DefinitelyTyped/DefinitelyTyped/pull/41225">#41225</a> I'm no longer able to augment the static side of <code class="notranslate">class Module</code>. Before it was possible as indicated there: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="535329102" data-permission-text="Title is private" data-url="https://github.com/DefinitelyTyped/DefinitelyTyped/issues/40927" data-hovercard-type="pull_request" data-hovercard-url="/DefinitelyTyped/DefinitelyTyped/pull/40927/hovercard" href="https://github.com/DefinitelyTyped/DefinitelyTyped/pull/40927">#40927</a> (comment)</p>
<p dir="auto">I get `Duplicate identifier 'Module' as error. Any hints how to tell typescript to merge the declarations?</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/node</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.
<ul dir="auto">
<li>Authors: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/SimonSchick/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/SimonSchick">@SimonSchick</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sandersn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sandersn">@sandersn</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/andrewbranch/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/andrewbranch">@andrewbranch</a></li>
</ul>
</li>
</ul> | <p dir="auto">i noticed that i get compile errors when i have any of above references. Do i miss something?</p> | 0 |
<p dir="auto">Title says it all :-)</p> | <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/22350/11778683/51fc7cfa-a256-11e5-8026-66d27009b80f.png"><img src="https://cloud.githubusercontent.com/assets/22350/11778683/51fc7cfa-a256-11e5-8026-66d27009b80f.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/aeschli/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/aeschli">@aeschli</a></p> | 1 |
<p dir="auto"><strong>Describe the bug</strong></p>
<p dir="auto">ShapePath makes holes in wrong shape plane if shapes added in specific order.</p>
<p dir="auto"><strong>To Reproduce</strong></p>
<p dir="auto">Steps to reproduce the behavior:</p>
<p dir="auto">Create ShapePath as described below</p>
<p dir="auto"><em><strong>Code</strong></em></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const shape = new THREE.ShapePath();
shape.moveTo(0, 0);
shape.lineTo(0, 9);
shape.lineTo(8, 9);
shape.lineTo(8, 0);
shape.currentPath.closePath();
shape.moveTo(1, 1);
shape.lineTo(7, 1);
shape.lineTo(7, 5);
shape.lineTo(1, 5);
shape.currentPath.closePath();
shape.moveTo(3, 2);
shape.lineTo(3, 4);
shape.lineTo(5, 4);
shape.lineTo(5, 2);
shape.currentPath.closePath();
shape.moveTo(4, 3);
shape.lineTo(5, 3);
shape.lineTo(5, 4);
shape.lineTo(4, 4);
shape.currentPath.closePath();
shape.moveTo(1, 6);
shape.lineTo(7, 6);
shape.lineTo(7, 8);
shape.lineTo(1, 8);
shape.currentPath.closePath();
const shapes = shape.toShapes();
const geometry = new THREE.ExtrudeBufferGeometry(shapes, {
depth: 1,
bevelEnabled: false,
});
const material = new THREE.MeshPhongMaterial({ color: 0xb0b0b0});
const mesh = new THREE.Mesh(geometry, material);
scene.add( mesh );"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">shape</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">ShapePath</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">moveTo</span><span class="pl-kos">(</span><span class="pl-c1">0</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-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">9</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">8</span><span class="pl-kos">,</span> <span class="pl-c1">9</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">8</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-s1">shape</span><span class="pl-kos">.</span><span class="pl-c1">currentPath</span><span class="pl-kos">.</span><span class="pl-en">closePath</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">moveTo</span><span class="pl-kos">(</span><span class="pl-c1">1</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-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">7</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-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">7</span><span class="pl-kos">,</span> <span class="pl-c1">5</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">5</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-c1">currentPath</span><span class="pl-kos">.</span><span class="pl-en">closePath</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">moveTo</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">4</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">4</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-c1">currentPath</span><span class="pl-kos">.</span><span class="pl-en">closePath</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">moveTo</span><span class="pl-kos">(</span><span class="pl-c1">4</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">4</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">4</span><span class="pl-kos">,</span> <span class="pl-c1">4</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-c1">currentPath</span><span class="pl-kos">.</span><span class="pl-en">closePath</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">moveTo</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">6</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">7</span><span class="pl-kos">,</span> <span class="pl-c1">6</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">7</span><span class="pl-kos">,</span> <span class="pl-c1">8</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">lineTo</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">8</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-c1">currentPath</span><span class="pl-kos">.</span><span class="pl-en">closePath</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">shapes</span> <span class="pl-c1">=</span> <span class="pl-s1">shape</span><span class="pl-kos">.</span><span class="pl-en">toShapes</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">geometry</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">ExtrudeBufferGeometry</span><span class="pl-kos">(</span><span class="pl-s1">shapes</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
<span class="pl-c1">depth</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span>
<span class="pl-c1">bevelEnabled</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-k">const</span> <span class="pl-s1">material</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">MeshPhongMaterial</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">color</span>: <span class="pl-c1">0xb0b0b0</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">mesh</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">Mesh</span><span class="pl-kos">(</span><span class="pl-s1">geometry</span><span class="pl-kos">,</span> <span class="pl-s1">material</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">scene</span><span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span> <span class="pl-s1">mesh</span> <span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><em><strong>Live example</strong></em></p>
<ul dir="auto">
<li><a href="https://jsfiddle.net/4rfsqp75/" rel="nofollow">jsfiddle-latest-release</a></li>
</ul>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">Hole should be in correct shape plane</p>
<p dir="auto"><strong>Screenshots</strong></p>
<p dir="auto">Shape adding order:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/13413484/101473792-f5456780-3952-11eb-898a-91ac20984217.png"><img src="https://user-images.githubusercontent.com/13413484/101473792-f5456780-3952-11eb-898a-91ac20984217.png" alt="1" style="max-width: 100%;"></a><br>
Expected result:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/13413484/101473795-f5ddfe00-3952-11eb-8fa5-024329efc5e8.png"><img src="https://user-images.githubusercontent.com/13413484/101473795-f5ddfe00-3952-11eb-8fa5-024329efc5e8.png" alt="2" style="max-width: 100%;"></a><br>
Actual result:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/13413484/101473797-f6769480-3952-11eb-856a-abe568fe9180.png"><img src="https://user-images.githubusercontent.com/13413484/101473797-f6769480-3952-11eb-856a-abe568fe9180.png" alt="3" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Platform:</strong></p>
<ul dir="auto">
<li>Device: [Desktop]</li>
<li>OS: [Windows]</li>
<li>Browser: [Chrome]</li>
<li>Three.js version: [latest release]</li>
</ul> | <h5 dir="auto">Description of the problem</h5>
<p dir="auto">When creating a polygon with constructPathShape.toShapes the order of the constructpathshapes commands plays a role which shouldn't be the case. (I think so)<br>
I am adding a hole than the outer vertice then again a hole.<br>
The last hole is not recognized.<br>
<a href="https://jsfiddle.net/0g9bdar5/2/" rel="nofollow">https://jsfiddle.net/0g9bdar5/2/</a></p>
<p dir="auto">The only thing which was changed is the order of the constructpathshape commands.<br>
If I add the two holes at the beginning the polygon is rendered correctly.<br>
<a href="https://jsfiddle.net/0g9bdar5/3/" rel="nofollow">https://jsfiddle.net/0g9bdar5/3/</a></p>
<h5 dir="auto">Three.js version</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> latest</li>
</ul>
<h5 dir="auto">Browser</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Chrome</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Firefox</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Internet Explorer</li>
</ul>
<h5 dir="auto">OS</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Windows</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> macOS</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Linux</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Android</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> iOS</li>
</ul>
<h5 dir="auto">Hardware Requirements (graphics card, VR Device, ...)</h5> | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.