text1
stringlengths
0
536k
text2
stringlengths
0
536k
label
int64
0
1
<p dir="auto">If you use setSource on a SearchRequestBuilder and then call to string the SearchRequest will appear to be cleared.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="SearchRequestBuilder srb = client().prepareSearch().setSource(&quot;{\&quot;query\&quot;:\&quot;match\&quot;:{\&quot;foo\&quot;:\&quot;bar\&quot;}}&quot;); srb.execute().get();"><pre class="notranslate"><code class="notranslate">SearchRequestBuilder srb = client().prepareSearch().setSource("{\"query\":\"match\":{\"foo\":\"bar\"}}"); srb.execute().get(); </code></pre></div> <p dir="auto">Will execute the correct search, however</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="SearchRequestBuilder srb = client().prepareSearch().setSource(&quot;{\&quot;query\&quot;:\&quot;match\&quot;:{\&quot;foo\&quot;:\&quot;bar\&quot;}}&quot;); logger.debug(&quot;About to execute [{}]&quot;,srb.toString()); srb.execute().get();"><pre class="notranslate"><code class="notranslate">SearchRequestBuilder srb = client().prepareSearch().setSource("{\"query\":\"match\":{\"foo\":\"bar\"}}"); logger.debug("About to execute [{}]",srb.toString()); srb.execute().get(); </code></pre></div> <p dir="auto">Will execute an empty search.</p> <p dir="auto">The problem is that <code class="notranslate">toString()</code> calls <code class="notranslate">internalBuilder()</code> which calls <code class="notranslate">sourceBuilder()</code></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" private SearchSourceBuilder sourceBuilder() { if (sourceBuilder == null) { sourceBuilder = new SearchSourceBuilder(); } return sourceBuilder; }"><pre class="notranslate"><code class="notranslate"> private SearchSourceBuilder sourceBuilder() { if (sourceBuilder == null) { sourceBuilder = new SearchSourceBuilder(); } return sourceBuilder; } </code></pre></div> <p dir="auto">Then when the <code class="notranslate">SearchRequestBuilder.execute</code> is called the request that was constructed via <code class="notranslate">setSource</code> is replaced by an empty sourceBuilder.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" @Override protected void doExecute(ActionListener&lt;SearchResponse&gt; listener) { if (sourceBuilder != null) { request.source(sourceBuilder()); } client.search(request, listener); }"><pre class="notranslate"><code class="notranslate"> @Override protected void doExecute(ActionListener&lt;SearchResponse&gt; listener) { if (sourceBuilder != null) { request.source(sourceBuilder()); } client.search(request, listener); } </code></pre></div>
<p dir="auto">Using the Java API, If one sets the content of a search request through <code class="notranslate">SearchRequestBuilder#setSource</code> methods and then calls <code class="notranslate">toString</code> to see the result, not only the content of the request is not returned as it wasn't set through <code class="notranslate">sourceBuilder()</code>, the content of the request gets also reset due to the <code class="notranslate">internalBuilder()</code> call in <code class="notranslate">toString</code>.</p> <p dir="auto">Here is a small failing test that demontrates it:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="SearchRequestBuilder searchRequestBuilder = new SearchRequestBuilder(client()).setSource(&quot;{\n&quot; + &quot; \&quot;query\&quot; : {\n&quot; + &quot; \&quot;match\&quot; : {\n&quot; + &quot; \&quot;field\&quot; : {\n&quot; + &quot; \&quot;query\&quot; : \&quot;value\&quot;&quot; + &quot; }\n&quot; + &quot; }\n&quot; + &quot; }\n&quot; + &quot; }&quot;); String preToString = searchRequestBuilder.request().source().toUtf8(); searchRequestBuilder.toString(); String postToString = searchRequestBuilder.request().source().toUtf8(); assertThat(preToString, equalTo(postToString));"><pre class="notranslate"><code class="notranslate">SearchRequestBuilder searchRequestBuilder = new SearchRequestBuilder(client()).setSource("{\n" + " \"query\" : {\n" + " \"match\" : {\n" + " \"field\" : {\n" + " \"query\" : \"value\"" + " }\n" + " }\n" + " }\n" + " }"); String preToString = searchRequestBuilder.request().source().toUtf8(); searchRequestBuilder.toString(); String postToString = searchRequestBuilder.request().source().toUtf8(); assertThat(preToString, equalTo(postToString)); </code></pre></div>
1
<p dir="auto">When mapping a object, TS can't retain the keys accessor.</p> <p dir="auto">Following example uses <a href="https://lodash.com/docs#mapValues" rel="nofollow">lodash _.mapValues</a>, which maps a object.</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var newUsers = _.mapValues({ 'fred': { 'user': 'fred', 'age': 40 }, 'pebbles': { 'user': 'pebbles', 'age': 1 } }, function(o) { return o.age; }); // -&gt; _.Dictionary&lt;number&gt; let ageFred = newUsers['fred']; // is number newUsers.fred // &lt;-- invalid because TypeScript can't retain the keys."><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">newUsers</span> <span class="pl-c1">=</span> <span class="pl-s1">_</span><span class="pl-kos">.</span><span class="pl-en">mapValues</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-s">'fred'</span>: <span class="pl-kos">{</span> <span class="pl-s">'user'</span>: <span class="pl-s">'fred'</span><span class="pl-kos">,</span> <span class="pl-s">'age'</span>: <span class="pl-c1">40</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'pebbles'</span>: <span class="pl-kos">{</span> <span class="pl-s">'user'</span>: <span class="pl-s">'pebbles'</span><span class="pl-kos">,</span> <span class="pl-s">'age'</span>: <span class="pl-c1">1</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">o</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-s1">o</span><span class="pl-kos">.</span><span class="pl-c1">age</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">// -&gt; _.Dictionary&lt;number&gt;</span> <span class="pl-k">let</span> <span class="pl-s1">ageFred</span> <span class="pl-c1">=</span> <span class="pl-s1">newUsers</span><span class="pl-kos">[</span><span class="pl-s">'fred'</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">// is number</span> <span class="pl-s1">newUsers</span><span class="pl-kos">.</span><span class="pl-c1">fred</span> <span class="pl-c">// &lt;-- invalid because TypeScript can't retain the keys.</span></pre></div> <p dir="auto">I can't think a way to type _.mapValues so it would retain the keys. Retaining keys requires new kind of typing capabilities for the TypeScript.</p> <p dir="auto">I find myself needing to retain keys in surprising many places, e.g. when uncurrying a object full of functions.</p>
<h2 dir="auto">Motivations</h2> <p dir="auto">A lot of JavaScript library/framework/pattern involve computation based on the property name of an object. For example <a href="http://backbonejs.org/" rel="nofollow">Backbone</a> model, functional transformation <code class="notranslate">pluck</code>, <a href="https://github.com/facebook/immutable-js">ImmutableJS</a> are all based on such mechanism.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//backbone var Contact = Backbone.Model.extend({}) var contact = new Contact(); contact.get('name'); contact.set('age', 21); // ImmutableJS var map = Immutable.Map({ name: 'François', age: 20 }); map = map.set('age', 21); map.get('age'); // 21 //pluck var arr = [{ name: 'François' }, { name: 'Fabien' }]; _.pluck(arr, 'name') // ['François', 'Fabien'];"><pre class="notranslate"><span class="pl-c">//backbone</span> <span class="pl-k">var</span> <span class="pl-v">Contact</span> <span class="pl-c1">=</span> <span class="pl-v">Backbone</span><span class="pl-kos">.</span><span class="pl-c1">Model</span><span class="pl-kos">.</span><span class="pl-en">extend</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-k">var</span> <span class="pl-s1">contact</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Contact</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">contact</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'name'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">contact</span><span class="pl-kos">.</span><span class="pl-en">set</span><span class="pl-kos">(</span><span class="pl-s">'age'</span><span class="pl-kos">,</span> <span class="pl-c1">21</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// ImmutableJS</span> <span class="pl-k">var</span> <span class="pl-s1">map</span> <span class="pl-c1">=</span> <span class="pl-v">Immutable</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-c1">name</span>: <span class="pl-s">'François'</span><span class="pl-kos">,</span> <span class="pl-c1">age</span>: <span class="pl-c1">20</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">map</span> <span class="pl-c1">=</span> <span class="pl-s1">map</span><span class="pl-kos">.</span><span class="pl-en">set</span><span class="pl-kos">(</span><span class="pl-s">'age'</span><span class="pl-kos">,</span> <span class="pl-c1">21</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">map</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'age'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// 21</span> <span class="pl-c">//pluck</span> <span class="pl-k">var</span> <span class="pl-s1">arr</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'François'</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">'Fabien'</span> <span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-s1">_</span><span class="pl-kos">.</span><span class="pl-en">pluck</span><span class="pl-kos">(</span><span class="pl-s1">arr</span><span class="pl-kos">,</span> <span class="pl-s">'name'</span><span class="pl-kos">)</span> <span class="pl-c">// ['François', 'Fabien'];</span></pre></div> <p dir="auto">We can easily understand in those examples the relation between the api and the underlying type constraint.<br> In the case of the backbone model, it is just a kind of <em>proxy</em> for an object of type :</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface Contact { name: string; age: number; }"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">Contact</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span> <span class="pl-c1">age</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">For the case of <code class="notranslate">pluck</code>, it's a transformation</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="T[] =&gt; U[]"><pre class="notranslate"><code class="notranslate">T[] =&gt; U[] </code></pre></div> <p dir="auto">where U is the type of a property of T <code class="notranslate">prop</code>.</p> <p dir="auto">However we have no way to express such relation in TypeScript, and ends up with dynamic type.</p> <h2 dir="auto">Proposed solution</h2> <p dir="auto">The proposed solution is to introduce a new syntax for type <code class="notranslate">T[prop]</code> where <code class="notranslate">prop</code> is an argument of the function using such type as return value or type parameter.<br> With this new type syntax we could write the following definition :</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="declare module Backbone { class Model&lt;T&gt; { get(prop: string): T[prop]; set(prop: string, value: T[prop]): void; } } declare module ImmutableJS { class Map&lt;T&gt; { get(prop: string): T[prop]; set(prop: string, value: T[prop]): Map&lt;T&gt;; } } declare function pluck&lt;T&gt;(arr: T[], prop: string): Array&lt;T[prop]&gt; // or T[prop][] "><pre class="notranslate"><span class="pl-k">declare</span> module <span class="pl-smi">Backbone</span> <span class="pl-kos">{</span> <span class="pl-k">class</span> <span class="pl-smi">Model</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-c1">get</span><span class="pl-kos">(</span><span class="pl-s1">prop</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">T</span><span class="pl-kos">[</span><span class="pl-smi">prop</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c1">set</span><span class="pl-kos">(</span><span class="pl-s1">prop</span>: <span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-s1">value</span>: <span class="pl-smi">T</span><span class="pl-kos">[</span><span class="pl-smi">prop</span><span class="pl-kos">]</span><span class="pl-kos">)</span>: <span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-k">declare</span> module <span class="pl-smi">ImmutableJS</span> <span class="pl-kos">{</span> <span class="pl-k">class</span> <span class="pl-smi">Map</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-c1">get</span><span class="pl-kos">(</span><span class="pl-s1">prop</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">T</span><span class="pl-kos">[</span><span class="pl-smi">prop</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c1">set</span><span class="pl-kos">(</span><span class="pl-s1">prop</span>: <span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-s1">value</span>: <span class="pl-smi">T</span><span class="pl-kos">[</span><span class="pl-smi">prop</span><span class="pl-kos">]</span><span class="pl-kos">)</span>: <span class="pl-smi">Map</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">pluck</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">arr</span>: <span class="pl-smi">T</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">prop</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">Array</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">[</span><span class="pl-smi">prop</span><span class="pl-kos">]</span><span class="pl-kos">&gt;</span> <span class="pl-c">// or T[prop][] </span></pre></div> <p dir="auto">This way, when we use our Backbone model, TypeScript could correctly type-check the <code class="notranslate">get</code> and <code class="notranslate">set</code> call.</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface Contact { name: string; age: number; } var contact: Backbone.Model&lt;Contact&gt;; var age = contact.get('age'); contact.set('name', 3) /// error"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">Contact</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span> <span class="pl-c1">age</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">var</span> <span class="pl-s1">contact</span>: <span class="pl-smi">Backbone</span><span class="pl-kos">.</span><span class="pl-smi">Model</span><span class="pl-kos">&lt;</span><span class="pl-smi">Contact</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span> <span class="pl-k">var</span> <span class="pl-s1">age</span> <span class="pl-c1">=</span> <span class="pl-s1">contact</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">'age'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">contact</span><span class="pl-kos">.</span><span class="pl-en">set</span><span class="pl-kos">(</span><span class="pl-s">'name'</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">)</span> <span class="pl-c">/// error</span></pre></div> <h2 dir="auto">The <code class="notranslate">prop</code> constant</h2> <h3 dir="auto">Constraint</h3> <p dir="auto">Obviously the constant must be of a type that can be used as index type (<code class="notranslate">string</code>, <code class="notranslate">number</code>, <code class="notranslate">Symbol</code>).</p> <h3 dir="auto">Case of indexable</h3> <p dir="auto">Let's give a look at our <code class="notranslate">Map</code> definition:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="declare module ImmutableJS { class Map&lt;T&gt; { get(prop: string): T[string]; set(prop: string, value: T[string]): Map&lt;T&gt;; } }"><pre class="notranslate"><span class="pl-k">declare</span> module <span class="pl-smi">ImmutableJS</span> <span class="pl-kos">{</span> <span class="pl-k">class</span> <span class="pl-smi">Map</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-c1">get</span><span class="pl-kos">(</span><span class="pl-s1">prop</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">T</span><span class="pl-kos">[</span><span class="pl-smi">string</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c1">set</span><span class="pl-kos">(</span><span class="pl-s1">prop</span>: <span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-s1">value</span>: <span class="pl-smi">T</span><span class="pl-kos">[</span><span class="pl-smi">string</span><span class="pl-kos">]</span><span class="pl-kos">)</span>: <span class="pl-smi">Map</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">If <code class="notranslate">T</code> is indexable, our map inherit of this behavior:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var map = new ImmutableJS.Map&lt;{ [index: string]: number}&gt;;"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">map</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">ImmutableJS</span><span class="pl-kos">.</span><span class="pl-c1">Map</span><span class="pl-kos">&lt;</span><span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-s1">index</span>: <span class="pl-smi">string</span><span class="pl-kos">]</span>: <span class="pl-smi">number</span><span class="pl-kos">}</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span></pre></div> <p dir="auto">Now <code class="notranslate">get</code> has for type <code class="notranslate">get(prop: string): number</code>.</p> <h2 dir="auto">Interrogation</h2> <p dir="auto">Now There is some cases where I have pain to think of a <em>correct</em> behavior, let's start again with our <code class="notranslate">Map</code> definition.<br> If instead of passing <code class="notranslate">{ [index: string]: number }</code> as type parameter we would have given<br> <code class="notranslate">{ [index: number]: number }</code> should the compiler raise an error ?</p> <p dir="auto">if we use <code class="notranslate">pluck</code> with a dynamic expression for prop instead of a constant :</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var contactArray: Contact[] = [] function pluckContactArray(prop: string) { return _.pluck(myArray, prop); }"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">contactArray</span>: <span class="pl-smi">Contact</span><span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-k">function</span> <span class="pl-en">pluckContactArray</span><span class="pl-kos">(</span><span class="pl-s1">prop</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-s1">_</span><span class="pl-kos">.</span><span class="pl-en">pluck</span><span class="pl-kos">(</span><span class="pl-s1">myArray</span><span class="pl-kos">,</span> <span class="pl-s1">prop</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">or with a constant that is not a property of the type passed as parameter.<br> should the call to <code class="notranslate">pluck</code> raise an error since the compiler cannot infer the type <code class="notranslate">T[prop]</code>, shoud <code class="notranslate">T[prop]</code> be resolved to <code class="notranslate">{}</code> or <code class="notranslate">any</code>, if so should the compiler with <code class="notranslate">--noImplicitAny</code> raise an error ?</p>
1
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="% deno Deno 1.18.0 exit using ctrl+d or close() &gt; &quot;😂&quot;[0] Uncaught &quot;Unterminated string literal&quot;"><pre class="notranslate">% <span class="pl-s1">deno</span> <span class="pl-c1">Deno 1.18.0</span> <span class="pl-c1">exit using ctrl+d or close()</span> &gt; <span class="pl-s1"><span class="pl-s"><span class="pl-pds">"</span>😂<span class="pl-pds">"</span></span>[0]</span> <span class="pl-c1">Uncaught "Unterminated string literal"</span></pre></div> <p dir="auto">I suggest printing the escaped value, <code class="notranslate">"\uD83D"</code>, like Chromium.</p>
<p dir="auto">At the moment Deno.args is <code class="notranslate">string[]</code>, but doesn't work like an array:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt; Deno.args.pop() Uncaught TypeError: Cannot assign to read only property 'length' of object '[object Array]' at Array.pop (&lt;anonymous&gt;) at &lt;anonymous&gt;:2:11 &gt; Deno.args[0] = 'x' Uncaught TypeError: Cannot add property 0, object is not extensible at &lt;anonymous&gt;:2:14"><pre class="notranslate"><code class="notranslate">&gt; Deno.args.pop() Uncaught TypeError: Cannot assign to read only property 'length' of object '[object Array]' at Array.pop (&lt;anonymous&gt;) at &lt;anonymous&gt;:2:11 &gt; Deno.args[0] = 'x' Uncaught TypeError: Cannot add property 0, object is not extensible at &lt;anonymous&gt;:2:14 </code></pre></div>
0
<h3 dir="auto">Apache Airflow version</h3> <p dir="auto">2.1.2</p> <h3 dir="auto">Operating System</h3> <p dir="auto">Official docker image</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">Official Apache Airflow Helm Chart</p> <h3 dir="auto">Deployment details</h3> <p dir="auto">Originally had airflow 2.0.2 installed via 3rd party helm chart (running external postgres db). I uninstalled it and installed airflow 2.1.2 using the official chart. Pods are alll started up except the schedular pod is crashing with "ValueError: unsupported pickle protocol: 5"</p> <h3 dir="auto">What happened</h3> <p dir="auto">I get a "ValueError: unsupported pickle protocol: 5". I went into the database and did some cleanup but still getting error. Not sure if there are other tables/colums that also need to be cleaned up.</p> <p dir="auto">Cleanup Done:</p> <p dir="auto">UPDATE public.dag_run SET conf= NULL;<br> DELETE FROM public.dag_pickle;</p> <p dir="auto">Logs:</p> <hr> <p dir="auto">____ |<strong>( )</strong>_______ <strong>/</strong> /________ __<br> ____ /| |_ /__ <em><em><em>/</em> /</em> __ /</em> __ _ | /| / /<br> ___ ___ | / _ / _ <strong>/ _ / / /<em>/ /</em> |/ |/ /<br> <em>/</em>/ |<em>/</em>/ /<em>/ /</em>/ /<em>/ _</em></strong>/____/|__/<br> [2021-08-31 16:20:29,139] {scheduler_job.py:1266} INFO - Starting the scheduler<br> [2021-08-31 16:20:29,139] {scheduler_job.py:1271} INFO - Processing each file at most -1 times<br> [2021-08-31 16:20:29,523] {dag_processing.py:254} INFO - Launched DagFileProcessorManager with pid: 19<br> [2021-08-31 16:20:29,528] {scheduler_job.py:1835} INFO - Resetting orphaned tasks for active dag runs<br> [2021-08-31 16:20:29,539] {settings.py:51} INFO - Configured default timezone Timezone('UTC')<br> [2021-08-31 16:20:29,628] {scheduler_job.py:1315} ERROR - Exception when executing SchedulerJob._run_scheduler_loop<br> Traceback (most recent call last):<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/jobs/scheduler_job.py", line 1299, in _execute<br> self._run_scheduler_loop()<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/jobs/scheduler_job.py", line 1392, in _run_scheduler_loop<br> num_queued_tis = self._do_scheduling(session)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/jobs/scheduler_job.py", line 1531, in _do_scheduling<br> self._schedule_dag_run(dag_run, active_runs_by_dag_id.get(dag_run.dag_id, set()), session)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/jobs/scheduler_job.py", line 1759, in _schedule_dag_run<br> self._verify_integrity_if_dag_changed(dag_run=dag_run, session=session)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/utils/session.py", line 67, in wrapper<br> return func(*args, **kwargs)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/jobs/scheduler_job.py", line 1785, in <em>verify_integrity_if_dag_changed<br> dag_run.verify_integrity(session=session)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/utils/session.py", line 67, in wrapper<br> return func(*args, **kwargs)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/models/dagrun.py", line 638, in verify_integrity<br> tis = self.get_task_instances(session=session)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/utils/session.py", line 67, in wrapper<br> return func(*args, **kwargs)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/models/dagrun.py", line 328, in get_task_instances<br> return tis.all()<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3373, in all<br> return list(self)<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 100, in instances<br> cursor.close()<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 70, in <strong>exit</strong><br> with_traceback=exc_tb,<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise</em><br> raise exception<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 80, in instances<br> rows = [proc(row) for row in fetch]<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 80, in <br> rows = [proc(row) for row in fetch]<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 588, in _instance<br> populators,<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 725, in <em>populate_full<br> dict</em>[key] = getter(row)<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/sql/sqltypes.py", line 1723, in process<br> return loads(value)<br> File "/home/airflow/.local/lib/python3.6/site-packages/dill/_dill.py", line 275, in loads<br> return load(file, ignore, **kwds)<br> File "/home/airflow/.local/lib/python3.6/site-packages/dill/_dill.py", line 270, in load<br> return Unpickler(file, ignore=ignore, **kwds).load()<br> File "/home/airflow/.local/lib/python3.6/site-packages/dill/_dill.py", line 472, in load<br> obj = StockUnpickler.load(self)<br> ValueError: unsupported pickle protocol: 5<br> [2021-08-31 16:20:30,634] {process_utils.py:100} INFO - Sending Signals.SIGTERM to GPID 19<br> [2021-08-31 16:20:30,970] {process_utils.py:66} INFO - Process psutil.Process(pid=19, status='terminated', exitcode=0, started='16:20:28') (19) terminated with exit code 0<br> [2021-08-31 16:20:30,970] {scheduler_job.py:1326} INFO - Exited execute loop<br> Traceback (most recent call last):<br> File "/home/airflow/.local/bin/airflow", line 8, in <br> sys.exit(main())<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/<strong>main</strong>.py", line 40, in main<br> args.func(args)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/cli/cli_parser.py", line 48, in command<br> return func(*args, **kwargs)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/utils/cli.py", line 91, in wrapper<br> return f(*args, **kwargs)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/cli/commands/scheduler_command.py", line 64, in scheduler<br> job.run()<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/jobs/base_job.py", line 245, in run<br> self._execute()<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/jobs/scheduler_job.py", line 1299, in _execute<br> self._run_scheduler_loop()<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/jobs/scheduler_job.py", line 1392, in _run_scheduler_loop<br> num_queued_tis = self._do_scheduling(session)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/jobs/scheduler_job.py", line 1531, in _do_scheduling<br> self._schedule_dag_run(dag_run, active_runs_by_dag_id.get(dag_run.dag_id, set()), session)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/jobs/scheduler_job.py", line 1759, in _schedule_dag_run<br> self._verify_integrity_if_dag_changed(dag_run=dag_run, session=session)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/utils/session.py", line 67, in wrapper<br> return func(*args, **kwargs)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/jobs/scheduler_job.py", line 1785, in <em>verify_integrity_if_dag_changed<br> dag_run.verify_integrity(session=session)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/utils/session.py", line 67, in wrapper<br> return func(*args, **kwargs)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/models/dagrun.py", line 638, in verify_integrity<br> tis = self.get_task_instances(session=session)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/utils/session.py", line 67, in wrapper<br> return func(*args, **kwargs)<br> File "/home/airflow/.local/lib/python3.6/site-packages/airflow/models/dagrun.py", line 328, in get_task_instances<br> return tis.all()<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3373, in all<br> return list(self)<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 100, in instances<br> cursor.close()<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 70, in <strong>exit</strong><br> with_traceback=exc_tb,<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise</em><br> raise exception<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 80, in instances<br> rows = [proc(row) for row in fetch]<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 80, in <br> rows = [proc(row) for row in fetch]<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 588, in _instance<br> populators,<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 725, in <em>populate_full<br> dict</em>[key] = getter(row)<br> File "/home/airflow/.local/lib/python3.6/site-packages/sqlalchemy/sql/sqltypes.py", line 1723, in process<br> return loads(value)<br> File "/home/airflow/.local/lib/python3.6/site-packages/dill/_dill.py", line 275, in loads<br> return load(file, ignore, **kwds)<br> File "/home/airflow/.local/lib/python3.6/site-packages/dill/_dill.py", line 270, in load<br> return Unpickler(file, ignore=ignore, **kwds).load()<br> File "/home/airflow/.local/lib/python3.6/site-packages/dill/_dill.py", line 472, in load<br> obj = StockUnpickler.load(self)<br> ValueError: unsupported pickle protocol: 5</p> <h3 dir="auto">What you expected to happen</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">How to reproduce</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Anything else</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Are you willing to submit PR?</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li> </ul> <h3 dir="auto">Code of Conduct</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li> </ul>
<p dir="auto"><strong>Apache Airflow version</strong>: 1.7.1.2</p> <p dir="auto">Ticket was created 11/Jul/16 16:06</p> <p dir="auto"><strong>Kubernetes version (if you are using kubernetes)</strong> (use <code class="notranslate">kubectl version</code>):</p> <p dir="auto"><strong>Environment</strong>:</p> <ul dir="auto"> <li><strong>Cloud provider or hardware configuration</strong>:</li> <li><strong>OS</strong> (e.g. from /etc/os-release):</li> <li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>):</li> <li><strong>Install tools</strong>:</li> <li><strong>Others</strong>:<br> <strong>What happened</strong>:</li> </ul> <p dir="auto">Currently, there is an issue of tasks overlapping between DAG runs<br> This can cause tasks to compete for resources as well as duplicating or overwriting what the other task is doing.</p> <p dir="auto"><strong>What you expected to happen</strong>:</p> <p dir="auto">As a the Airflow administrator,<br> If a task from a previous DAG Run is still running when the next scheduled run triggers the same task, there should be a way prevent the tasks from overlapping.</p> <p dir="auto"><strong>How to reproduce it</strong>:</p> <ol dir="auto"> <li>Create a DAG with a short scheduled interval</li> <li>Create a task in that DAG to run longer than the interval<br> Result: Both tasks end up running that the same time.</li> </ol> <p dir="auto"><strong>Anything else we need to know</strong>:</p> <p dir="auto">Moved here from <a href="https://issues.apache.org/jira/browse/AIRFLOW-323" rel="nofollow">https://issues.apache.org/jira/browse/AIRFLOW-323</a></p>
0
<p dir="auto">We need something like ReplicationController that runs RestartOnFailure and RestartNever pods "to completion", collects results, etc</p>
<p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/" rel="nofollow">http://kubernetes.io/docs/troubleshooting/</a>.): No</p> <p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.):</p> <ul dir="auto"> <li><code class="notranslate">delete patch type with no merge key defined</code></li> <li><code class="notranslate">cannot apply deleted mountpath kubernetes</code></li> </ul> <hr> <p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one): BUG REPORT</p> <p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>):</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;4&quot;, GitVersion:&quot;v1.4.1&quot;, GitCommit:&quot;33cf7b9acbb2cb7c9c72a10d6636321fb180b159&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2016-10-10T18:19:49Z&quot;, GoVersion:&quot;go1.6.3&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;} Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;4&quot;, GitVersion:&quot;v1.4.4&quot;, GitCommit:&quot;3b417cc4ccd1b8f38ff9ec96bb50a81ca0ea9d56&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2016-10-21T02:42:39Z&quot;, GoVersion:&quot;go1.6.3&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}"><pre class="notranslate"><code class="notranslate">Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.1", GitCommit:"33cf7b9acbb2cb7c9c72a10d6636321fb180b159", GitTreeState:"clean", BuildDate:"2016-10-10T18:19:49Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.4", GitCommit:"3b417cc4ccd1b8f38ff9ec96bb50a81ca0ea9d56", GitTreeState:"clean", BuildDate:"2016-10-21T02:42:39Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"} </code></pre></div> <p dir="auto"><strong>Environment</strong>:</p> <ul dir="auto"> <li><strong>Cloud provider or hardware configuration</strong>: <code class="notranslate">AWS</code></li> <li><strong>OS</strong> (e.g. from /etc/os-release): <code class="notranslate">Arch Linux</code></li> <li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>): <code class="notranslate">Linux niagara 4.8.4-1-ARCH #1 SMP PREEMPT Sat Oct 22 18:26:57 CEST 2016 x86_64 GNU/Linux</code></li> <li><strong>Install tools</strong>: <code class="notranslate">?</code></li> <li><strong>Others</strong>: <code class="notranslate">?</code></li> </ul> <p dir="auto"><strong>What happened</strong>: After removing one of the pod container's <code class="notranslate">volumeMounts</code> from a deployment spec file and attempted to apply it using <code class="notranslate">kubectl apply -f test-deploy.yaml</code>, I got the following error message:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;test-deploy.yaml&quot;: delete patch type with no merge key defined"><pre class="notranslate"><code class="notranslate">"test-deploy.yaml": delete patch type with no merge key defined </code></pre></div> <p dir="auto"><strong>What you expected to happen</strong>: changes to take effect successfully</p> <p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):</p> <ol dir="auto"> <li>Create a deployment below:</li> </ol> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="apiVersion: extensions/v1beta1 kind: Deployment metadata: name: rm-mount-test spec: replicas: 1 template: metadata: labels: uid: abcdefght spec: containers: - name: debian image: debian args: - sleep - &quot;100000&quot; volumeMounts: - mountPath: /empty name: empty - mountPath: /empty2 name: empty2 volumes: - name: empty emptyDir: - name: empty2 emptyDir:"><pre class="notranslate"><code class="notranslate">apiVersion: extensions/v1beta1 kind: Deployment metadata: name: rm-mount-test spec: replicas: 1 template: metadata: labels: uid: abcdefght spec: containers: - name: debian image: debian args: - sleep - "100000" volumeMounts: - mountPath: /empty name: empty - mountPath: /empty2 name: empty2 volumes: - name: empty emptyDir: - name: empty2 emptyDir: </code></pre></div> <p dir="auto">Once successfully up, remove the lines below and use <code class="notranslate">kubectl apply</code> to update it:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" - mountPath: /empty2 name: empty2"><pre class="notranslate"><code class="notranslate"> - mountPath: /empty2 name: empty2 </code></pre></div> <p dir="auto"><strong>Anything else do we need to know</strong>:</p>
0
<p dir="auto">Is this a bug (note the different dtypes of the output)?</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: np.array([1, 2, 3], dtype=str) Out[1]: array(['1', '2', '3'], dtype='|S1') In [2]: np.array([1, 2, 3]).astype(str) Out[2]: array(['1', '2', '3'], dtype='|S24')"><pre class="notranslate"><code class="notranslate">In [1]: np.array([1, 2, 3], dtype=str) Out[1]: array(['1', '2', '3'], dtype='|S1') In [2]: np.array([1, 2, 3]).astype(str) Out[2]: array(['1', '2', '3'], dtype='|S24') </code></pre></div> <p dir="auto">This behavior is new to numpy 1.7.0 (and breaks some unit tests in one of my packages).</p>
<p dir="auto">I came across something that might be a bug in the numpy unique function. Here is an example.</p> <p dir="auto">In my case, a is a numpy array holding indices referring to pairwise equal elements in two other vectors (not shown). It could for instance be:</p> <p dir="auto">a=np.array([[1,2],[3,4],[1,2],[5,6,7]])</p> <p dir="auto">In this case, element 1 and 2 are pairwise equal in the two arrays not show. The same goes for element 3 and 4, and elements 5,6,7.</p> <p dir="auto">Since the [1,2] pair is occuring twice, I want to remove the duplicate entry. I use</p> <p dir="auto">In [18]: np.unique(a)<br> Out[18]: array([[1, 2], [3, 4], [5, 6, 7]], dtype=object)</p> <p dir="auto">However, what causes me trouble, is when there are only two pairwise identical elements:</p> <p dir="auto">In [19]: a=np.array([[1,2],[3,4],[1,2],[5,6]])<br> In [20]: np.unique(a)<br> Out[20]: array([1, 2, 3, 4, 5, 6])</p> <p dir="auto">Now, the output has a completely different meaning for my purpose.</p> <p dir="auto">Is the unique function supposed to work this way?</p>
0
<p dir="auto">*** THIS IS A DUPLICATE BUG REPORT ***</p> <p dir="auto">I am submitting it because the last one has had "please reopen" for a year but I don't think it's being picked up somehow.</p> <p dir="auto">*** ORIGINAL REPORT ***</p> <p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="135180860" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/14593" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/14593/hovercard" href="https://github.com/ansible/ansible/issues/14593">#14593</a></p> <p dir="auto">*** ACTUAL REPORT ***</p> <h5 dir="auto">Issue Type:</h5> <p dir="auto">Bug Report</p> <h5 dir="auto">COMPONENT NAME</h5> <p dir="auto">ec2 module</p> <h5 dir="auto">ANSIBLE VERSION</h5> <p dir="auto">ansible 2.1.0 (devel <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/6a62ad6c4b4dd8c2ed3402a1c08af13847574bb8/hovercard" href="https://github.com/ansible/ansible/commit/6a62ad6c4b4dd8c2ed3402a1c08af13847574bb8"><tt>6a62ad6</tt></a>) last updated 2016/02/01 13:04:11 (GMT -700)<br> lib/ansible/modules/core: (detached HEAD <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/93d02189f6dcfa0578a0fac0fb1f289369ac13a5/hovercard" href="https://github.com/ansible/ansible/commit/93d02189f6dcfa0578a0fac0fb1f289369ac13a5"><tt>93d0218</tt></a>) last updated 2016/02/01 13:04:24 (GMT -700)<br> lib/ansible/modules/extras: (detached HEAD <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/fff5ae6994fbe64d45323bc1d11f6103e211f524/hovercard" href="https://github.com/ansible/ansible/commit/fff5ae6994fbe64d45323bc1d11f6103e211f524"><tt>fff5ae6</tt></a>) last updated 2016/02/01 13:04:31 (GMT -700)<br> config file = /etc/ansible/ansible.cfg<br> configured module search path = Default w/o overrides</p> <h5 dir="auto">CONFIGURATION</h5> <p dir="auto">no significant changes,<br> scp_if_ssh=True</p> <h5 dir="auto">ENVIRONMENT</h5> <p dir="auto">N/A</p> <h5 dir="auto">SUMMARY</h5> <p dir="auto">After running the ec2 module and registering the ec2 variable, then looping over the ec2.results I am only able to access item.instances when creating a new instance. If it the instance is already created, ec2.results.instances returns as an empty set, and therefore the task breaks on that iteration. I instead have had to access the instance id by {{ item.tagged_instances.0.id }} which consistently holds the instance id wether the instances is being created or wether it already exists, but this isn't entirely reliable either as (I believe) it is only populated if the instance is tagged.</p> <p dir="auto">Additionally, the nesting of these variables is different than what is described in the documentation on <a href="http://docs.ansible.com/ansible/ec2_vol_module.html" rel="nofollow">http://docs.ansible.com/ansible/ec2_vol_module.html</a>, which states that you should be able to access the instances simply by ec2.instances. Did this change with 2.0?</p> <p dir="auto">Steps To Reproduce:</p> <p dir="auto">Here is my list I am iterating over:</p> <p dir="auto">server_environments:</p> <ul dir="auto"> <li>environment: production<br> servers: <ul dir="auto"> <li>{ type: bastion, name: j-bastion, private_ip: 10.1.1.250 }</li> <li>{ type: app, name: j-delete, private_ip: 10.1.1.106 }<br> Here is my playbook:</li> </ul> </li> </ul> <hr> <ul dir="auto"> <li>hosts: localhost<br> gather_facts: False<br> roles: <ul dir="auto"> <li>provision_ec2<br> Here is my provision_ec2 role:</li> </ul> </li> </ul> <hr> <ul dir="auto"> <li>name: Launch instances based on server list<br> ec2:<br> key_name: ansible_provisioning.txt<br> group_id: 'sg-81398ee4', 'sg-a6398ec3'<br> instance_type: t2.medium<br> image: ami-06116566<br> termination_protection: yes<br> wait: true<br> region: us-west-2<br> instance_tags:<br> Type: "{{ item.0.environment }}"<br> Name: "{{ item.1.name }}"<br> exact_count: 1<br> count_tag:<br> Name: "{{ item.1.name }}"<br> vpc_subnet_id: subnet-819f7gd2<br> assign_public_ip: yes<br> private_ip: "{{ item.1.private_ip }}"<br> register: ec2<br> with_subelements: <ul dir="auto"> <li>server_environments</li> <li>servers</li> </ul> </li> </ul> <h1 dir="auto">Use this to see what is contained in the ec2 variable</h1> <ul dir="auto"> <li> <p dir="auto">name: debug...<br> debug: var=ec2.results<br> This DID NOT work (shown as acceptable int the documentation)</p> </li> <li> <p dir="auto">name: Attach volumes to created instances<br> ec2_vol:<br> instance: "{{ item.id }}"<br> device_name: /dev/xvdb<br> volume_size: 200<br> volume_type: gp2<br> iops: 600<br> with_items: ec2.instances<br> register: ec2_vol<br> This DID work but is not reliable</p> </li> <li> <p dir="auto">name: Attach volumes to created instances<br> ec2_vol:<br> instance: "{{ item.tagged_instances.0.id }}"<br> device_name: /dev/xvdb<br> volume_size: 200<br> volume_type: gp2<br> iops: 600<br> with_items: ec2.results<br> register: ec2_vol<br> Here is a gist with my debug output which shows the abnormal nesting and the instance.id only being populated for the newly created instance</p> </li> </ul> <p dir="auto">Expected/Actual Results:</p> <p dir="auto">I expected there to be an ec2.instancesproperty, not an ec2.results property and I expected the ec2.results.instances property to contain ids for all instances in my server list, not just the newly created ones.</p> <p dir="auto">Please close this one, and reopen that one.</p>
<h5 dir="auto">Issue Type: Bug Report</h5> <h5 dir="auto">Ansible Version:</h5> <p dir="auto">ansible 1.6.6 linux (centos 6.5)<br> ansible 1.6.10 OpenBSD 5.5 (on OpenBSD tested also on ansible 1.6.6. Used newer ansible release to show it still happens)</p> <h5 dir="auto">Environment:</h5> <ul dir="auto"> <li>ansible is run local to the server in each instances</li> <li>host: Centos 6.5 and OpenBSD 5.5</li> </ul> <h5 dir="auto">Summary:</h5> <p dir="auto">An OpenBSD system not able to assign retrieved fact for ansible_interface.ipv4.address to variable.</p> <h5 dir="auto">Steps To Reproduce:</h5> <h4 dir="auto">create play (Centos 6.5)</h4> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" --- # test.yml - hosts: localhost connection: local remote_user: gregm # sudo: yes tasks: # name: address (frrebsd and openbsd replace with em0 ans nic) - debug: msg={{ ansible_eth0.ipv4.address }} - debug: msg={{ ansible_default_ipv4.address }} # EOF"><pre class="notranslate"><code class="notranslate"> --- # test.yml - hosts: localhost connection: local remote_user: gregm # sudo: yes tasks: # name: address (frrebsd and openbsd replace with em0 ans nic) - debug: msg={{ ansible_eth0.ipv4.address }} - debug: msg={{ ansible_default_ipv4.address }} # EOF </code></pre></div> <h4 dir="auto">create paly (OpenBSD 5.5)</h4> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" --- # test.yml - hosts: localhost connection: local remote_user: gregm # sudo: yes tasks: # name: address - debug: msg={{ ansible_alc0.ipv4.address }} - debug: msg={{ ansible_default_ipv4.address }}"><pre class="notranslate"><code class="notranslate"> --- # test.yml - hosts: localhost connection: local remote_user: gregm # sudo: yes tasks: # name: address - debug: msg={{ ansible_alc0.ipv4.address }} - debug: msg={{ ansible_default_ipv4.address }} </code></pre></div> <h5 dir="auto">Expected Results:</h5> <ul dir="auto"> <li>I would expect the same results on OpenBSD as the one on Centos 6.5. I tested it also with ansible 1.6.6 on OpenBSD and the same happened.</li> </ul> <h4 dir="auto">for reference, I include collected facts from the Centos 6.5 host:</h4> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" &quot;ansible_eth0&quot;: { &quot;active&quot;: true, &quot;device&quot;: &quot;eth0&quot;, &quot;ipv4&quot;: { &quot;address&quot;: &quot;192.168.0.44&quot;, &quot;netmask&quot;: &quot;255.255.255.0&quot;, &quot;network&quot;: &quot;192.168.0.0&quot; }, &quot;ipv6&quot;: [ { &quot;address&quot;: &quot;fe80::20c:29ff:fefd:f56c&quot;, &quot;prefix&quot;: &quot;64&quot;, &quot;scope&quot;: &quot;link&quot; } ], &quot;macaddress&quot;: &quot;00:0c:29:fd:f5:6c&quot;, &quot;module&quot;: &quot;e1000&quot;, &quot;mtu&quot;: 1500, &quot;promisc&quot;: false, &quot;type&quot;: &quot;ether&quot;"><pre class="notranslate"><code class="notranslate"> "ansible_eth0": { "active": true, "device": "eth0", "ipv4": { "address": "192.168.0.44", "netmask": "255.255.255.0", "network": "192.168.0.0" }, "ipv6": [ { "address": "fe80::20c:29ff:fefd:f56c", "prefix": "64", "scope": "link" } ], "macaddress": "00:0c:29:fd:f5:6c", "module": "e1000", "mtu": 1500, "promisc": false, "type": "ether" </code></pre></div> <h4 dir="auto">Centos 6.5 results:</h4> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [localhost] ************************************************************** GATHERING FACTS *************************************************************** ok: [localhost] TASK: [debug msg={{ansible_eth0.ipv4.address}}] ******************************* ok: [localhost] =&gt; { &quot;msg&quot;: &quot;192.168.0.44&quot; } TASK: [debug msg={{ansible_default_ipv4.address}}] **************************** ok: [localhost] =&gt; { &quot;msg&quot;: &quot;192.168.0.44&quot; } PLAY RECAP ******************************************************************** localhost : ok=3 changed=0 unreachable=0 failed=0"><pre class="notranslate"><code class="notranslate">PLAY [localhost] ************************************************************** GATHERING FACTS *************************************************************** ok: [localhost] TASK: [debug msg={{ansible_eth0.ipv4.address}}] ******************************* ok: [localhost] =&gt; { "msg": "192.168.0.44" } TASK: [debug msg={{ansible_default_ipv4.address}}] **************************** ok: [localhost] =&gt; { "msg": "192.168.0.44" } PLAY RECAP ******************************************************************** localhost : ok=3 changed=0 unreachable=0 failed=0 </code></pre></div> <h5 dir="auto">Actual Results:</h5> <h4 dir="auto">For referance, I included fact collected from the OpenBSD 5.5 host</h4> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="localhost | success &gt;&gt; { &quot;ansible_facts&quot;: { &quot;ansible_alc0&quot;: { &quot;device&quot;: &quot;alc0&quot;, &quot;flags&quot;: [ &quot;UP&quot;, &quot;BROADCAST&quot;, &quot;RUNNING&quot;, &quot;SIMPLEX&quot;, &quot;MULTICAST&quot; ], &quot;ipv4&quot;: [ { &quot;address&quot;: &quot;192.168.16.95&quot;, &quot;broadcast&quot;: &quot;192.168.16.255&quot;, &quot;netmask&quot;: &quot;255.255.255.0&quot;, &quot;network&quot;: &quot;192.168.16.0&quot; } ], &quot;ipv6&quot;: [ { &quot;address&quot;: &quot;fe80::224:1dff:fe56:e3f4%alc0&quot;, &quot;prefix&quot;: &quot;64&quot;, &quot;scope&quot;: &quot;0x1&quot; } ],"><pre class="notranslate"><code class="notranslate">localhost | success &gt;&gt; { "ansible_facts": { "ansible_alc0": { "device": "alc0", "flags": [ "UP", "BROADCAST", "RUNNING", "SIMPLEX", "MULTICAST" ], "ipv4": [ { "address": "192.168.16.95", "broadcast": "192.168.16.255", "netmask": "255.255.255.0", "network": "192.168.16.0" } ], "ipv6": [ { "address": "fe80::224:1dff:fe56:e3f4%alc0", "prefix": "64", "scope": "0x1" } ], </code></pre></div> <h4 dir="auto">OpenBSD 5.5 results</h4> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [localhost] ************************************************************** GATHERING FACTS *************************************************************** ok: [localhost] TASK: [debug msg={{ ansible_alc0.ipv4.address }}] ***************************** fatal: [localhost] =&gt; One or more undefined variables: 'list object' has no attribute 'address' FATAL: all hosts have already failed -- aborting PLAY RECAP ******************************************************************** to retry, use: --limit @/home/gregm/test.retry localhost : ok=1 changed=0 unreachable=1 failed=0"><pre class="notranslate"><code class="notranslate">PLAY [localhost] ************************************************************** GATHERING FACTS *************************************************************** ok: [localhost] TASK: [debug msg={{ ansible_alc0.ipv4.address }}] ***************************** fatal: [localhost] =&gt; One or more undefined variables: 'list object' has no attribute 'address' FATAL: all hosts have already failed -- aborting PLAY RECAP ******************************************************************** to retry, use: --limit @/home/gregm/test.retry localhost : ok=1 changed=0 unreachable=1 failed=0 </code></pre></div>
0
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=barryl" rel="nofollow">Barry Lagerweij</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-323?redirect=false" rel="nofollow">SPR-323</a></strong> and commented</p> <p dir="auto">EJB's that depend on other beans cannot use Dependency Injection. Instead, they must use code like</p> <p dir="auto">ProductDAO dao = super.getBeanFactory().getBean("ProductDAO");</p> <p dir="auto">It would be a huge improvement if EJB's could have something like:</p> <p dir="auto">ProductDAO getProductDAO () { return this.productDAO; }<br> void setProductDAO ( ProductDAO dao) { this.productDAO = dao; }</p> <p dir="auto">For this to work, it would be nice if Spring would support a marker interface (like BeanNameAware), so that Spring could determine a EJB's name, and inject dependant objects.</p> <p dir="auto">Spring already provides an AbstractStatelessSessionBean base-class. This class needs to be improved.</p> <p dir="auto">For example:</p> <p dir="auto">AbstractStatelessSessionBean<br> {<br> void ejbCreate()<br> {<br> if (this instanceof BeanNameAware)<br> {<br> String name = ((BeanNameAware)this).getName();<br> XXXUtils.injectDependencies(getBeanFactory(),name,this);<br> }<br> }<br> }</p> <hr> <p dir="auto"><strong>Affects:</strong> 1.1 final</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="398061009" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/6115" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/6115/hovercard" href="https://github.com/spring-projects/spring-framework/issues/6115">#6115</a> Allow declarative dependency injection for EJB components (<em><strong>"is duplicated by"</strong></em>)</li> </ul> <p dir="auto">3 votes, 2 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=bubbapuryear" rel="nofollow">Bubba Puryear</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-1432?redirect=false" rel="nofollow">SPR-1432</a></strong> and commented</p> <p dir="auto">The FreeMarkerConfigurer class cleverly adds a ClassTemplateLoader in it's postProcessConfiguration() callback. While it is certainly possible for developers to subclass this class and "do the same trick" to add their own ClassTemplateLoaders, this seems like overkill. Just having an option property on the class of TemplateLoader[] that gets added to the MultiTemplateLoader puts it all in configuration. I'll attach a small patch after I get this issue openned.</p> <p dir="auto">Our local need arises out of having several project that use Spring w/ FreeMarker and we'd like to share some common FreeMarker macros. Putting the ftl in a common jar seems like a reasonably way to distribute these macros, so we'd like an easy way to tell Spring to tell FreeMarker to look in a couple of places to find macro files.</p> <hr> <p dir="auto"><strong>Affects:</strong> 1.2.5</p> <p dir="auto"><strong>Attachments:</strong></p> <ul dir="auto"> <li><a href="https://jira.spring.io/secure/attachment/11239/freemarker.configurer.patch" rel="nofollow">freemarker.configurer.patch</a> (<em>1.83 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="398060517" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/6060" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/6060/hovercard" href="https://github.com/spring-projects/spring-framework/issues/6060">#6060</a> Make it possible to wire multiple template loaders with FreemarkerConfigurer (<em><strong>"duplicates"</strong></em>)</li> </ul>
0
<p dir="auto">Hi,<br> Please add RTL languages support for bootstrap by default.<br> Best Regard.</p>
<p dir="auto">I'm not speaking any RTL languages, but since I'm working on a project supporting RTL, I was wondering if <a href="http://getbootstrap.com/css/#forms-control-validation" rel="nofollow">form-groups</a> shouldn't align the icon inside a input to the left-side. Maybe a native speaker of an RTL can share their thoughts on this.</p>
1
<p dir="auto">Under firefox 7, the models js library sometimes doesn't clear backdrop properly when rapidly left mouse click on launch model button. I can reproduce it on the bootstrap demo site too.</p> <p dir="auto">I'm reporting issue first and will look into it tonight.</p>
<p dir="auto">this.$backdrop is sometimes undefined when calling a modal without a backdrop.</p> <p dir="auto">This throws an error, because the method this.$backdrop.remove() cannot be called.</p>
0
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=ceharris414" rel="nofollow">Carl Harris</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7911?redirect=false" rel="nofollow">SPR-7911</a></strong> and commented</p> <p dir="auto">Some REST web services return 204 No Content as the result for a GET in certain circumstances. With this status, the response has no entity body and thus no Content-Type header.</p> <p dir="auto">RestTemplate.getForEntity throws an exception when receiving such a response:</p> <p dir="auto">org.springframework.web.client.RestClientException: Cannot extract response: no Content-Type found</p> <p dir="auto">An improvement for RestTemplate.getForEntity would be to return a ResponseEntity instance with the statusCode property set as appropriate for 204 No Content, and null values for the body and contentType properties.</p> <p dir="auto">I considered trying to extend RestTemplate to make it behave in this manner. Unfortunately, the extensive use of private static classes in the implementation makes it difficult to override the behavior of getForEntity -- can't just replace the ResponseEntityResponseExtractor implementation without also replacing other unrelated collaborators (e.g. AcceptHeaderRequestCallback). It's possible to do it, it would just require a lot more code duplication than really seems warranted.</p> <p dir="auto">If you don't wish to change the behavior of RestTemplate.getForEntity, perhaps you might consider relaxing the access modifiers on these collaborator classes so that a subclass could make use of them?</p> <hr> <p dir="auto"><strong>Affects:</strong> 3.1 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="398110546" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12671" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12671/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12671">#12671</a> RestTemplate - support response mapping to entity with potentially empty response body. (<em><strong>"is duplicated by"</strong></em>)</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-projects/spring-framework/commit/c42671a78aa68f7ab8125311b2c9ce167b166c2c/hovercard" href="https://github.com/spring-projects/spring-framework/commit/c42671a78aa68f7ab8125311b2c9ce167b166c2c"><tt>c42671a</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/98870251f9fb27123353c549ae22fcf3679ebbd5/hovercard" href="https://github.com/spring-projects/spring-framework/commit/98870251f9fb27123353c549ae22fcf3679ebbd5"><tt>9887025</tt></a></p> <p dir="auto">1 votes, 1 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=yozh" rel="nofollow">Stepan Koltsov</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7979?redirect=false" rel="nofollow">SPR-7979</a></strong> and commented</p> <p dir="auto">Have simple configuration:</p> <p dir="auto">public abstract class Aaaaa { }</p> <p dir="auto">public class Bbbbb extends Aaaaa { }</p> <p dir="auto"><code class="notranslate">@Configuration</code><br> <code class="notranslate">@ComponentScan</code>(<br> basePackages="com.mycompany",<br> useDefaultFilters=false,<br> includeFilters={<br> <code class="notranslate">@ComponentScan</code>.Filter(type=FilterType.ASSIGNABLE_TYPE, value=Aaaaa.class)<br> }<br> )public class Conf {</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Autowired private Bbbbb bbbbb;"><pre class="notranslate"><code class="notranslate">@Autowired private Bbbbb bbbbb; </code></pre></div> <p dir="auto">}</p> <p dir="auto">when loaded with</p> <p dir="auto">new AnnotationConfigApplicationContext(Conf.class)</p> <p dir="auto">works fine, however, when loaded with XML config that references Conf.class:</p> <p dir="auto">&lt;beans&gt;<br> &lt;bean class="com.mycompany.Conf"/&gt;<br> &lt;/beans&gt;</p> <p dir="auto">new ClassPathXmlApplicationContext("classpath:com/mycompany/conf.xml");</p> <p dir="auto">it fails with exception: cannot autowire Conf.bbbbb field. Full stack trace: <a href="https://gist.github.com/835493">https://gist.github.com/835493</a> .</p> <hr> <p dir="auto"><strong>Affects:</strong> 3.1 M1</p> <p dir="auto"><strong>Attachments:</strong></p> <ul dir="auto"> <li><a href="https://jira.spring.io/secure/attachment/17998/mylyn-context.zip" rel="nofollow">mylyn-context.zip</a> (<em>236.68 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="398114714" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13361" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13361/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13361">#13361</a> <code class="notranslate">@ComponentScan</code>(includeFilters=<code class="notranslate">@Filter</code>(...)) fails when <code class="notranslate">@Import</code>'ed (<em><strong>"duplicates"</strong></em>)</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398116710" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13670" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13670/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13670">#13670</a> <code class="notranslate">@ComponentScan</code> with includeFilters on <code class="notranslate">@Import-ed</code> context does not work</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398117136" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13738" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13738/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13738">#13738</a> ClassPathBeanDefinitionScanner vs ClassPathBeanDefinitionScanner: difference in behavior when dealing with <code class="notranslate">@ComponentScan</code> excludeFilters</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-projects/spring-framework/commit/d9f7fdd120409fff4491561215e5b2dda74e2b02/hovercard" href="https://github.com/spring-projects/spring-framework/commit/d9f7fdd120409fff4491561215e5b2dda74e2b02"><tt>d9f7fdd</tt></a></p> <p dir="auto">1 votes, 0 watchers</p>
0
<p dir="auto">In other IDEs I used to simple copy a line break and paste it to the find text box. Then I could replace it with some other string.</p> <p dir="auto">I tried to do it with regex find using "\n" or "\r" and I had no luck either.</p> <p dir="auto">This is very helpful when creating db queries or csv files on the fly by replacing line breaks with strings like: '");' or whenever you detect some char (like &gt;) you can replace it with a breakline.</p> <p dir="auto">Thanks a lot!</p>
<p dir="auto">The Find dialog (Ctrl+F) does not allow multi-line finds using the <code class="notranslate">\n</code> character as it currently considers each line individually. See <a href="https://github.com/Microsoft/vscode/blob/master/src/vs/editor/common/model/textModel.ts"><code class="notranslate">TextModel._doFindMatches</code></a></p> <p dir="auto"><em>Created out of a discussion in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="117904229" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/278" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/278/hovercard" href="https://github.com/microsoft/vscode/issues/278">#278</a></em></p>
1
<p dir="auto"><strong>Migrated issue, originally created by Patrick Rusk</strong></p> <p dir="auto">(This problem was noted in comments in <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/zzzeek/sqlalchemy/commit/3fa38a1a2313b4644daa431d629394d6bb14497a/hovercard" href="https://github.com/zzzeek/sqlalchemy/commit/3fa38a1a2313b4644daa431d629394d6bb14497a">zzzeek/sqlalchemy@<tt>3fa38a1</tt></a> but not followed up on.)</p> <p dir="auto">The <code class="notranslate">sqlalchemy.orm.Query()</code> class takes an <code class="notranslate">entities</code> parameter defined to be "a sequence of entities and/or SQL expressions", but it used to actual accept a single SQL expression as well. Now, some such expressions cause a "TypeError: Boolean value of this clause is not defined" exception to be raised.</p> <p dir="auto">The offending line is <a href="https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/orm/query.py#L150">https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/orm/query.py#L150</a></p> <p dir="auto">As noted in the comments, changing it to <code class="notranslate">if entities is not None:</code> would probably fix the issue.</p> <p dir="auto">Test case:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer import sqlalchemy.sql class User(declarative_base()): __tablename__ = 'users' id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True) select = sqlalchemy.sql.func.max(User.id).label('max') query = sqlalchemy.orm.Query(select)"><pre class="notranslate"><code class="notranslate">from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer import sqlalchemy.sql class User(declarative_base()): __tablename__ = 'users' id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True) select = sqlalchemy.sql.func.max(User.id).label('max') query = sqlalchemy.orm.Query(select) </code></pre></div> <p dir="auto">...works under 1.2.7, but generates this stack trace under 1.2.8...</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="--------------------------------------------------------------------------- TypeError Traceback (most recent call last) &lt;ipython-input-1-cf50a8343d19&gt; in &lt;module&gt;() 8 9 select = sqlalchemy.sql.func.max(User.id).label('max') ---&gt; 10 query = sqlalchemy.orm.Query(select) /Users/patrick/.virtualenvs/shackleton/lib/python2.7/site-packages/sqlalchemy/orm/query.pyc in __init__(self, entities, session) 140 self.session = session 141 self._polymorphic_adapters = {} --&gt; 142 self._set_entities(entities) 143 144 def _set_entities(self, entities, entity_wrapper=None): /Users/patrick/.virtualenvs/shackleton/lib/python2.7/site-packages/sqlalchemy/orm/query.pyc in _set_entities(self, entities, entity_wrapper) 148 self._primary_entity = None 149 self._has_mapper_entities = False --&gt; 150 if entities: 151 for ent in util.to_list(entities): 152 entity_wrapper(self, ent) /Users/patrick/.virtualenvs/shackleton/lib/python2.7/site-packages/sqlalchemy/sql/elements.pyc in __bool__(self) 485 486 def __bool__(self): --&gt; 487 raise TypeError(&quot;Boolean value of this clause is not defined&quot;) 488 489 __nonzero__ = __bool__ TypeError: Boolean value of this clause is not defined"><pre class="notranslate"><code class="notranslate">--------------------------------------------------------------------------- TypeError Traceback (most recent call last) &lt;ipython-input-1-cf50a8343d19&gt; in &lt;module&gt;() 8 9 select = sqlalchemy.sql.func.max(User.id).label('max') ---&gt; 10 query = sqlalchemy.orm.Query(select) /Users/patrick/.virtualenvs/shackleton/lib/python2.7/site-packages/sqlalchemy/orm/query.pyc in __init__(self, entities, session) 140 self.session = session 141 self._polymorphic_adapters = {} --&gt; 142 self._set_entities(entities) 143 144 def _set_entities(self, entities, entity_wrapper=None): /Users/patrick/.virtualenvs/shackleton/lib/python2.7/site-packages/sqlalchemy/orm/query.pyc in _set_entities(self, entities, entity_wrapper) 148 self._primary_entity = None 149 self._has_mapper_entities = False --&gt; 150 if entities: 151 for ent in util.to_list(entities): 152 entity_wrapper(self, ent) /Users/patrick/.virtualenvs/shackleton/lib/python2.7/site-packages/sqlalchemy/sql/elements.pyc in __bool__(self) 485 486 def __bool__(self): --&gt; 487 raise TypeError("Boolean value of this clause is not defined") 488 489 __nonzero__ = __bool__ TypeError: Boolean value of this clause is not defined </code></pre></div> <p dir="auto">Anyone experiencing this can easily fix their issue by throwing [] around their expression, but it is a breaking change (of an undocumented feature).</p> <p dir="auto">(Please forgive the nonsensical test case above. I've never used SQLAlchemy. Just diagnosing a bug in someone else's code.)</p>
<p dir="auto"><strong>Migrated issue, originally created by Charles-Axel Dein (<a href="https://github.com/charlax">@charlax</a>)</strong></p> <p dir="auto">I'm upgrading a codebase to sqlalchemy 1.0.0beta5 from 0.9.9.</p> <p dir="auto">It seems that version 1 removed the ability to be forgiving about mentioning a join twice:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="session.query(Toaster).join(Toast).join(Toast).all()"><pre class="notranslate"><code class="notranslate">session.query(Toaster).join(Toast).join(Toast).all() </code></pre></div> <p dir="auto">This will raise with postgres: <code class="notranslate">ProgrammingError: (psycopg2.ProgrammingError) table name "toasts" specified more than once</code></p> <p dir="auto">The same query run with sqla 0.9.9 runs fine, because I guess it removes the duplicate join.</p> <p dir="auto">I'm not sure that can be considered a regression given that joins should not be mentioned more than once, but it's definitely a different behavior from 0.9.9</p>
0
<ul dir="auto"> <li>VSCode Version: 0.10.11</li> <li>OS Version: Windows 10</li> </ul> <p dir="auto">How can I setting open file in new tab when I select it from folder/file tree just like sublime text?(not replaced opened tab.)<br> I can't find where to config this.<br> Could anybody help me please?<br> Thx!</p>
<p dir="auto">I <em>really</em> miss proper tabs for open files (like VS proper), and the ability to rip a tab out into its own window.</p>
1
<p dir="auto">When trying to upload the wheels to pypi, I get this error:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ twine upload --verbose dist/* Uploading distributions to https://upload.pypi.org/legacy/ Uploading scikit_learn-0.22rc1-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10.1M/10.1M [00:10&lt;00:00, 979kB/s] Content received from server: &lt;html&gt; &lt;head&gt; &lt;title&gt;400 The description failed to render in the default format of reStructuredText. See https://pypi.org/help/#description-content-type for more information.&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;400 The description failed to render in the default format of reStructuredText. See https://pypi.org/help/#description-content-type for more information.&lt;/h1&gt; The server could not comply with the request since it is either malformed or otherwise incorrect.&lt;br/&gt;&lt;br/&gt; The description failed to render in the default format of reStructuredText. See https://pypi.org/help/#description-content-type for more information. &lt;/body&gt; &lt;/html&gt; HTTPError: 400 Client Error: The description failed to render in the default format of reStructuredText. See https://pypi.org/help/#description-content-type for more information. for url: https://upload.pypi.org/legacy/"><pre class="notranslate"><code class="notranslate">$ twine upload --verbose dist/* Uploading distributions to https://upload.pypi.org/legacy/ Uploading scikit_learn-0.22rc1-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10.1M/10.1M [00:10&lt;00:00, 979kB/s] Content received from server: &lt;html&gt; &lt;head&gt; &lt;title&gt;400 The description failed to render in the default format of reStructuredText. See https://pypi.org/help/#description-content-type for more information.&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;400 The description failed to render in the default format of reStructuredText. See https://pypi.org/help/#description-content-type for more information.&lt;/h1&gt; The server could not comply with the request since it is either malformed or otherwise incorrect.&lt;br/&gt;&lt;br/&gt; The description failed to render in the default format of reStructuredText. See https://pypi.org/help/#description-content-type for more information. &lt;/body&gt; &lt;/html&gt; HTTPError: 400 Client Error: The description failed to render in the default format of reStructuredText. See https://pypi.org/help/#description-content-type for more information. for url: https://upload.pypi.org/legacy/ </code></pre></div> <p dir="auto">checking with <code class="notranslate">python3 setup.py check -r -s</code>, the only issue I see is:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python3 setup.py check -r -s Partial import of sklearn during the build process. /usr/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'project_urls' warnings.warn(msg) /usr/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'python_requires' warnings.warn(msg) /usr/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC compile options: '-c' gcc: test_program.c gcc -pthread objects/test_program.o -o test_program C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC compile options: '-c' extra options: '-fopenmp' gcc: test_program.c gcc -pthread objects/test_program.o -o test_program -fopenmp /usr/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'project_urls' warnings.warn(msg) /usr/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'python_requires' warnings.warn(msg) /usr/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) running check warning: check: Duplicate explicit target name: &quot;about us&quot;. error: Please correct your package."><pre class="notranslate"><code class="notranslate">$ python3 setup.py check -r -s Partial import of sklearn during the build process. /usr/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'project_urls' warnings.warn(msg) /usr/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'python_requires' warnings.warn(msg) /usr/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC compile options: '-c' gcc: test_program.c gcc -pthread objects/test_program.o -o test_program C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC compile options: '-c' extra options: '-fopenmp' gcc: test_program.c gcc -pthread objects/test_program.o -o test_program -fopenmp /usr/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'project_urls' warnings.warn(msg) /usr/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'python_requires' warnings.warn(msg) /usr/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) running check warning: check: Duplicate explicit target name: "about us". error: Please correct your package. </code></pre></div> <p dir="auto">It seems we can't have two <code class="notranslate">about us</code> links in the README? It doesn't make much sense to me, and I'm not sure if that's really the issue.</p> <p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jnothman/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jnothman">@jnothman</a> have you ever had such an issue?</p>
<p dir="auto">I found a mistake in the <code class="notranslate">plot_oneclass.py</code> example for the one-class SVM.</p> <p dir="auto">The code generates 20 test samples <code class="notranslate">X = 0.3 * np.random.randn(20, 2)</code> and then generates two copies shifted over <code class="notranslate">X_test = np.r_[X + 2, X - 2]</code>.</p> <p dir="auto">This results in a total of 40 test samples, however in the plotting section of the file, it says:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pl.xlabel( &quot;error train: %d/200 ; errors novel regular: %d/20 ; &quot; &quot;errors novel abnormal: %d/20&quot; % (n_error_train, n_error_test, n_error_outliers)) pl.show()"><pre class="notranslate"><code class="notranslate">pl.xlabel( "error train: %d/200 ; errors novel regular: %d/20 ; " "errors novel abnormal: %d/20" % (n_error_train, n_error_test, n_error_outliers)) pl.show() </code></pre></div> <p dir="auto">Where the <code class="notranslate">errors novel regular: %d/20</code> should actually be <code class="notranslate">errors novel regular: %d/40</code> to take into account the duplicated number of samples.</p> <p dir="auto">Otherwise you can plot something and have 37/20 be errors, which doesn't make sense.</p>
0
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li> </ul> <h3 dir="auto">Environment</h3> <ul dir="auto"> <li>Dubbo version: xxx</li> <li>Operating System version: xxx</li> <li>Java version: xxx</li> </ul> <h3 dir="auto">Steps to reproduce this issue</h3> <ol dir="auto"> <li>xxx</li> <li>xxx</li> <li>xxx</li> </ol> <p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p> <h3 dir="auto">Expected Result</h3> <p dir="auto">What do you expected from the above steps?</p> <h3 dir="auto">Actual Result</h3> <p dir="auto">What actually happens?</p> <p dir="auto">If there is an exception, please attach the exception trace:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here! </code></pre></div> <p dir="auto">Dubbo USES redis as the registry times error below:</p> <p dir="auto">Exception in thread "main" java.lang.IllegalStateException: No such extension org.apache.dubbo.registry.RegistryFactory by name dubbo<br> at org.apache.dubbo.common.extension.ExtensionLoader.findException(ExtensionLoader.java:499)<br> at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:506)<br> at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:325)<br> at org.apache.dubbo.registry.RegistryFactory$Adaptive.getRegistry(RegistryFactory$Adaptive.java)<br> at org.apache.dubbo.registry.integration.RegistryProtocol.getRegistry(RegistryProtocol.java:204)<br> at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:138)<br> at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:55)<br> at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:98)<br> at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java)<br> at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:512)<br> at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:357)<br> at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:316)<br> at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:215)<br> at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:114)<br> at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:49)<br> at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)<br> at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)<br> at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)<br> at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)<br> at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)<br> at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)<br> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)<br> at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)<br> at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93)<br> at org.apache.dubbo.demo.provider.Provider.main(Provider.java:29)<br> [02/11/18 06:53:02:002 CST] main WARN extension.ExtensionLoader: [DUBBO] Failed to find extension named redis for type org.apache.dubbo.registry.RegistryFactory, will use default extension dubbo instead., dubbo version: , current host: 192.168.0.142<br> java.lang.IllegalStateException: No such extension org.apache.dubbo.registry.RegistryFactory by name redis<br> at org.apache.dubbo.common.extension.ExtensionLoader.findException(ExtensionLoader.java:499)<br> at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:506)<br> at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:325)<br> at org.apache.dubbo.registry.RegistryFactory$Adaptive.getRegistry(RegistryFactory$Adaptive.java)<br> at org.apache.dubbo.registry.integration.RegistryProtocol.getRegistry(RegistryProtocol.java:204)<br> at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:138)<br> at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:55)<br> at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:98)<br> at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java)<br> at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:512)<br> at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:357)<br> at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:316)<br> at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:215)<br> at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:114)<br> at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:49)<br> at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)<br> at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)<br> at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)<br> at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)<br> at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)<br> at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)<br> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)<br> at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)<br> at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93)<br> at org.apache.dubbo.demo.provider.Provider.main(Provider.java:29)</p> <p dir="auto">I don't understand the core reason for this error. So I can't find the reason,and I hope to get the answer . Thanks.</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/wiki/FAQ">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.5.3</li> <li>Operating System version: xxx</li> <li>Java version: 1.7</li> </ul> <p dir="auto">Dubbo admin同步zookeeper服务延迟比较长,请问这是什么原因???困扰了好久</p>
0
<h2 dir="auto">Environment info</h2> <ul dir="auto"> <li><code class="notranslate">transformers</code> version: master (4.4.0dev0)</li> <li>Platform: Google colab</li> <li>Python version: 3.7</li> <li>PyTorch version (GPU?): None</li> <li>Tensorflow version (GPU?): 2.4</li> <li>Using GPU in script?: Yes</li> <li>Using distributed or parallel set-up in script?: No</li> </ul> <h3 dir="auto">Who can help</h3> <p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jplu/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jplu">@jplu</a></p> <h2 dir="auto">Information</h2> <p dir="auto">Model I am using (Bert, XLNet ...): None</p> <p dir="auto">The problem arises when using:</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> the official example scripts: (give details below)</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> my own modified scripts: (give details below)</li> </ul> <p dir="auto">The tasks I am working on is:</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> an official GLUE/SQUaD task: (give the name)</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> my own task or dataset: (give details below)</li> </ul> <h2 dir="auto">To reproduce</h2> <p dir="auto">Steps to reproduce the behavior:</p> <p dir="auto">This might be somewhat of a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="787301182" data-permission-text="Title is private" data-url="https://github.com/huggingface/transformers/issues/9629" data-hovercard-type="issue" data-hovercard-url="/huggingface/transformers/issues/9629/hovercard" href="https://github.com/huggingface/transformers/issues/9629">#9629</a> but in a different use case</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dataset = tf.data.TextLineDataset(&quot;/content/train.txt&quot;) tokenizer = transformers.DistilBertTokenizerFast.from_pretrained(&quot;/content/Tokenizer&quot;, do_lower_case=False) def tokenize(sentence): sentence = sentence.numpy().decode('utf-8') a = tokenizer.encode_plus(sentence, padding=&quot;max_length&quot;, max_length=256, truncation=True, return_tensors=&quot;tf&quot;) return tf.constant(a.input_ids), tf.constant(a.attention_mask), tf.constant(a.input_ids) def get_tokenized(sentence): a = tf.py_function(tokenize, inp=[sentence], Tout=[tf.int32, tf.int32, tf.int32]) return {&quot;input_ids&quot;: a[0], &quot;attention_mask&quot;: a[1]}, a[2] dataset = dataset.map(get_tokenized, num_parallel_calls=tf.data.AUTOTUNE) # dataset = dataset.apply(tf.data.experimental.assert_cardinality(8000)) print(next(iter(dataset)))"><pre class="notranslate"><code class="notranslate">dataset = tf.data.TextLineDataset("/content/train.txt") tokenizer = transformers.DistilBertTokenizerFast.from_pretrained("/content/Tokenizer", do_lower_case=False) def tokenize(sentence): sentence = sentence.numpy().decode('utf-8') a = tokenizer.encode_plus(sentence, padding="max_length", max_length=256, truncation=True, return_tensors="tf") return tf.constant(a.input_ids), tf.constant(a.attention_mask), tf.constant(a.input_ids) def get_tokenized(sentence): a = tf.py_function(tokenize, inp=[sentence], Tout=[tf.int32, tf.int32, tf.int32]) return {"input_ids": a[0], "attention_mask": a[1]}, a[2] dataset = dataset.map(get_tokenized, num_parallel_calls=tf.data.AUTOTUNE) # dataset = dataset.apply(tf.data.experimental.assert_cardinality(8000)) print(next(iter(dataset))) </code></pre></div> <p dir="auto">Error</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="UnknownError: RuntimeError: Already borrowed Traceback (most recent call last): File &quot;/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/script_ops.py&quot;, line 247, in __call__ return func(device, token, args) File &quot;/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/script_ops.py&quot;, line 135, in __call__ ret = self._func(*args) File &quot;/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py&quot;, line 620, in wrapper return func(*args, **kwargs) File &quot;&lt;ipython-input-34-2e27f300f71b&gt;&quot;, line 9, in tokenize a = tokenizer.encode_plus(sentence, padding=&quot;max_length&quot;, max_length=256, truncation=True, return_tensors=&quot;tf&quot;) File &quot;/usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_base.py&quot;, line 2438, in encode_plus **kwargs, File &quot;/usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_fast.py&quot;, line 472, in _encode_plus **kwargs, File &quot;/usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_fast.py&quot;, line 379, in _batch_encode_plus pad_to_multiple_of=pad_to_multiple_of, File &quot;/usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_fast.py&quot;, line 330, in set_truncation_and_padding self._tokenizer.enable_truncation(max_length, stride=stride, strategy=truncation_strategy.value) RuntimeError: Already borrowed [[{{node EagerPyFunc}}]]"><pre class="notranslate"><code class="notranslate">UnknownError: RuntimeError: Already borrowed Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/script_ops.py", line 247, in __call__ return func(device, token, args) File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/script_ops.py", line 135, in __call__ ret = self._func(*args) File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py", line 620, in wrapper return func(*args, **kwargs) File "&lt;ipython-input-34-2e27f300f71b&gt;", line 9, in tokenize a = tokenizer.encode_plus(sentence, padding="max_length", max_length=256, truncation=True, return_tensors="tf") File "/usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_base.py", line 2438, in encode_plus **kwargs, File "/usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_fast.py", line 472, in _encode_plus **kwargs, File "/usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_fast.py", line 379, in _batch_encode_plus pad_to_multiple_of=pad_to_multiple_of, File "/usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_fast.py", line 330, in set_truncation_and_padding self._tokenizer.enable_truncation(max_length, stride=stride, strategy=truncation_strategy.value) RuntimeError: Already borrowed [[{{node EagerPyFunc}}]] </code></pre></div> <p dir="auto">The important thing that I should probably mention here is that if I change my code to load the same using the tokenizers library, the code executes without any issues. I have also tried using the slow implementation and the error still persists. Any help regarding this would be great!</p> <h2 dir="auto">Expected behavior</h2> <p dir="auto">Tokenization should happen on the fly without errors as it does with the Tokenizer from the tokenizers library.</p>
<h3 dir="auto">Feature request</h3> <p dir="auto">Our request a simpler and more convenient inference process for a speech recognition model based on MMS just like wav2vec 2.0 in Transformers.</p> <h3 dir="auto">Motivation</h3> <p dir="auto">We aim to encapsulate the various subroutines called by Facebook’s official model into a direct speech recognition model that is as easy to use as other transformer-based models like wav2vec 2.0. But we also know that the Hugging face team has been among the industry leaders in this area of work.</p> <h3 dir="auto">Your contribution</h3> <p dir="auto">We recognize that it may not be feasible for us to directly assist the Hugging Face technical team in this task. We believe that such an effort would be forward-looking given the popularity of MMS in current speech recognition research. The resulting model would be ideal for quickly transcribing our meeting notes.</p>
0
<p dir="auto">We are currently using Jest for running playwright test cases. So this code is working perfectly fine for us:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { runCLI } from &quot;jest&quot;; const { results } = await runCLI( { $0: &quot;&quot;, config: jestConfigPath, ...options, _: testNamePatterns, }, [integrationTestsPackagePath] ); "><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">runCLI</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"jest"</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-kos">{</span> results <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-en">runCLI</span><span class="pl-kos">(</span> <span class="pl-kos">{</span> <span class="pl-c1">$0</span>: <span class="pl-s">""</span><span class="pl-kos">,</span> <span class="pl-c1">config</span>: <span class="pl-s1">jestConfigPath</span><span class="pl-kos">,</span> ...<span class="pl-s1">options</span><span class="pl-kos">,</span> <span class="pl-c1">_</span>: <span class="pl-s1">testNamePatterns</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">integrationTestsPackagePath</span><span class="pl-kos">]</span> <span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">We are getting test results and we can decide the next steps for test run.<br> We would like to switch to playwright-test-runner.<br> We would like to create playwright.config.ts on runtime and then run playwright tests cases using similar command above for playwright test runner.</p> <p dir="auto">What we want is to somehow expose this line of code (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="533619789" data-permission-text="Title is private" data-url="https://github.com/microsoft/playwright/issues/154" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/playwright/pull/154/hovercard" href="https://github.com/microsoft/playwright/pull/154">#154</a>):</p> <p dir="auto">const result = await runner.run(!!opts.list, filePatternFilters, opts.project || undefined);</p> <p dir="auto"></p><div class="Box Box--condensed my-2"> <div class="Box-header f6"> <p class="mb-0 text-bold"> <a href="https://github.com/microsoft/playwright/blob/eafba43e15bcca8d10da30bc7c53d4092bb2374a/src/test/cli.ts#L154">playwright/src/test/cli.ts</a> </p> <p class="mb-0 color-fg-muted"> Line 154 in <a data-pjax="true" class="commit-tease-sha" href="/microsoft/playwright/commit/eafba43e15bcca8d10da30bc7c53d4092bb2374a">eafba43</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="L154" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="154"></td> <td id="LC154" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">runTests</span><span class="pl-kos">(</span><span class="pl-s1">args</span>: <span class="pl-smi">string</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">opts</span>: <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-s1">key</span>: <span class="pl-smi">string</span><span class="pl-kos">]</span>: <span class="pl-smi">any</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td> </tr> </tbody></table> </div> </div> <p></p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/12835833/133660151-7372ed16-cb8f-4f12-9e78-4be0720fadac.png"><img src="https://user-images.githubusercontent.com/12835833/133660151-7372ed16-cb8f-4f12-9e78-4be0720fadac.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto">This function should be exposed so that we can consume it in our Typescript code to run playwright test cases using playwright test runner.</p>
<p dir="auto">We're currently using jest as a test runner for testing angular applications using playwright. In the angular ecosystem tools usually integrate with the <code class="notranslate">@angular/cli</code> by providing a builder, so our <code class="notranslate">@ngx-playwright/jest</code> package is actually what powers the <code class="notranslate">ng e2e</code> command in our repositories.</p> <p dir="auto">It would be great if we could write such an integration for the <code class="notranslate">@playwright/test</code> runner as well, but that'd require access to the runner APIs.<br> While it would be possible to execute the playwright CLI in a new process, this would make certain integrations harder or hacky. For instance passing configuration from the angular.json into the test runner would require turning those into CLI arguments and passing the base URL the angular app is hosted at into the runner would require a workaround using the child process's environment to pass this along.</p>
1
<p dir="auto">Hi all,</p> <p dir="auto">I seeing sometimes failed Kafka indexing tasks, the task log look quite empty (~180 lines) - ends with this -</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2018-02-05T03:32:28,045 INFO [main] io.druid.guice.JsonConfigurator - Loaded class[class io.druid.query.search.search.SearchQueryConfig] from props[druid.query.search.] as [io.druid.query.search.search.SearchQueryConfig@7c3e4b1a] 2018-02-05T03:32:28,048 INFO [main] io.druid.guice.JsonConfigurator - Loaded class[class io.druid.query.metadata.SegmentMetadataQueryConfig] from props[druid.query.segmentMetadata.] as [io.druid.query.metadata.SegmentMetadataQueryConfig@41a374be] 2018-02-05T03:32:28,052 INFO [main] io.druid.guice.JsonConfigurator - Loaded class[class io.druid.query.groupby.GroupByQueryConfig] from props[druid.query.groupBy.] as [io.druid.query.groupby.GroupByQueryConfig@5f96f6a2] 2018-02-05T03:32:28,071 INFO [main] io.druid.offheap.OffheapBufferGenerator - Allocating new intermediate processing buffer[0] of size[536,870,912] 2018-02-05T03:32:41,994 INFO [main] io.druid.offheap.OffheapBufferGenerator - Allocating new intermediate processing buffer[1] of size[536,870,912] 2018-02-05T03:32:56,979 INFO [main] io.druid.offheap.OffheapBufferGenerator - Allocating new result merging buffer[0] of size[536,870,912] 2018-02-05T03:33:12,481 INFO [main] io.druid.offheap.OffheapBufferGenerator - Allocating new result merging buffer[1] of size[536,870,912]"><pre class="notranslate"><code class="notranslate">2018-02-05T03:32:28,045 INFO [main] io.druid.guice.JsonConfigurator - Loaded class[class io.druid.query.search.search.SearchQueryConfig] from props[druid.query.search.] as [io.druid.query.search.search.SearchQueryConfig@7c3e4b1a] 2018-02-05T03:32:28,048 INFO [main] io.druid.guice.JsonConfigurator - Loaded class[class io.druid.query.metadata.SegmentMetadataQueryConfig] from props[druid.query.segmentMetadata.] as [io.druid.query.metadata.SegmentMetadataQueryConfig@41a374be] 2018-02-05T03:32:28,052 INFO [main] io.druid.guice.JsonConfigurator - Loaded class[class io.druid.query.groupby.GroupByQueryConfig] from props[druid.query.groupBy.] as [io.druid.query.groupby.GroupByQueryConfig@5f96f6a2] 2018-02-05T03:32:28,071 INFO [main] io.druid.offheap.OffheapBufferGenerator - Allocating new intermediate processing buffer[0] of size[536,870,912] 2018-02-05T03:32:41,994 INFO [main] io.druid.offheap.OffheapBufferGenerator - Allocating new intermediate processing buffer[1] of size[536,870,912] 2018-02-05T03:32:56,979 INFO [main] io.druid.offheap.OffheapBufferGenerator - Allocating new result merging buffer[0] of size[536,870,912] 2018-02-05T03:33:12,481 INFO [main] io.druid.offheap.OffheapBufferGenerator - Allocating new result merging buffer[1] of size[536,870,912] </code></pre></div> <p dir="auto">Looking at the middle manager, I see this exception -</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2018-02-05T03:32:20,956 INFO [WorkerTaskMonitor] io.druid.indexing.worker.WorkerTaskMonitor - Submitting runnable for task[index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa] 2018-02-05T03:32:20,960 INFO [WorkerTaskMonitor] io.druid.indexing.worker.WorkerTaskMonitor - Affirmative. Running task [index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa] 2018-02-05T03:32:20,963 INFO [forking-task-runner-3] io.druid.indexing.overlord.ForkingTaskRunner - Running command: java -cp /opt/kava/conf/druid/_common:/opt/kava/conf/druid/middleManager:lib/jetty-continuation-9.3.16.v20170120.jar:lib/druid-aws-common-0.10.0.jar:lib/java-xmlbuilder-1.1.jar:lib/... 2018-02-05T03:32:20,965 INFO [forking-task-runner-3] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa] location changed to [TaskLocation{host='ip-x-y-z-w.node.us-west-2.consul', port=8102}]. 2018-02-05T03:32:20,965 INFO [forking-task-runner-3] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa] status changed to [RUNNING]. 2018-02-05T03:32:20,965 INFO [forking-task-runner-3] io.druid.indexing.overlord.ForkingTaskRunner - Logging task index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa output to: var/druid/task/index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa/log 2018-02-05T03:32:20,965 INFO [WorkerTaskMonitor] io.druid.indexing.worker.WorkerTaskMonitor - Updating task [index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa] announcement with location [TaskLocation{host='ip-x-y-z-w.node.us-west-2.consul', port=8102}] 2018-02-05T03:33:14,778 INFO [HttpPostEmitter-1-0] com.metamx.http.client.pool.ChannelResourceFactory - Generating: http://json-push.service.us-west-2.consul:7000 2018-02-05T03:33:27,265 INFO [qtp81907268-47] io.druid.indexing.overlord.ForkingTaskRunner - Killing process for task: index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa 2018-02-05T03:33:27,286 INFO [qtp81907268-44] io.druid.indexing.overlord.ForkingTaskRunner - Killing process for task: index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa 2018-02-05T03:33:27,332 INFO [qtp81907268-57] io.druid.indexing.overlord.ForkingTaskRunner - Killing process for task: index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa 2018-02-05T03:33:27,466 INFO [forking-task-runner-3] io.druid.storage.s3.S3TaskLogs - Pushing task log var/druid/task/index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa/log to: druid/indexing-logs/index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa/log 2018-02-05T03:33:27,567 INFO [forking-task-runner-3] io.druid.indexing.overlord.ForkingTaskRunner - Exception caught during execution java.io.IOException: Stream closed at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:170) ~[?:1.8.0_131] at java.io.BufferedInputStream.read1(BufferedInputStream.java:291) ~[?:1.8.0_131] at java.io.BufferedInputStream.read(BufferedInputStream.java:345) ~[?:1.8.0_131] at java.io.FilterInputStream.read(FilterInputStream.java:107) ~[?:1.8.0_131] at com.google.common.io.ByteStreams.copy(ByteStreams.java:175) ~[guava-16.0.1.jar:?] at io.druid.indexing.overlord.ForkingTaskRunner$1.call(ForkingTaskRunner.java:438) [druid-indexing-service-0.10.0.jar:0.10.0] at io.druid.indexing.overlord.ForkingTaskRunner$1.call(ForkingTaskRunner.java:220) [druid-indexing-service-0.10.0.jar:0.10.0] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131] 2018-02-05T03:33:27,568 INFO [forking-task-runner-3] io.druid.indexing.overlord.ForkingTaskRunner - Removing task directory: var/druid/task/index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa 2018-02-05T03:33:27,572 INFO [WorkerTaskMonitor] io.druid.indexing.worker.WorkerTaskMonitor - Job's finished. Completed [index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa] with status [FAILED]"><pre class="notranslate"><code class="notranslate">2018-02-05T03:32:20,956 INFO [WorkerTaskMonitor] io.druid.indexing.worker.WorkerTaskMonitor - Submitting runnable for task[index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa] 2018-02-05T03:32:20,960 INFO [WorkerTaskMonitor] io.druid.indexing.worker.WorkerTaskMonitor - Affirmative. Running task [index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa] 2018-02-05T03:32:20,963 INFO [forking-task-runner-3] io.druid.indexing.overlord.ForkingTaskRunner - Running command: java -cp /opt/kava/conf/druid/_common:/opt/kava/conf/druid/middleManager:lib/jetty-continuation-9.3.16.v20170120.jar:lib/druid-aws-common-0.10.0.jar:lib/java-xmlbuilder-1.1.jar:lib/... 2018-02-05T03:32:20,965 INFO [forking-task-runner-3] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa] location changed to [TaskLocation{host='ip-x-y-z-w.node.us-west-2.consul', port=8102}]. 2018-02-05T03:32:20,965 INFO [forking-task-runner-3] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa] status changed to [RUNNING]. 2018-02-05T03:32:20,965 INFO [forking-task-runner-3] io.druid.indexing.overlord.ForkingTaskRunner - Logging task index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa output to: var/druid/task/index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa/log 2018-02-05T03:32:20,965 INFO [WorkerTaskMonitor] io.druid.indexing.worker.WorkerTaskMonitor - Updating task [index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa] announcement with location [TaskLocation{host='ip-x-y-z-w.node.us-west-2.consul', port=8102}] 2018-02-05T03:33:14,778 INFO [HttpPostEmitter-1-0] com.metamx.http.client.pool.ChannelResourceFactory - Generating: http://json-push.service.us-west-2.consul:7000 2018-02-05T03:33:27,265 INFO [qtp81907268-47] io.druid.indexing.overlord.ForkingTaskRunner - Killing process for task: index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa 2018-02-05T03:33:27,286 INFO [qtp81907268-44] io.druid.indexing.overlord.ForkingTaskRunner - Killing process for task: index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa 2018-02-05T03:33:27,332 INFO [qtp81907268-57] io.druid.indexing.overlord.ForkingTaskRunner - Killing process for task: index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa 2018-02-05T03:33:27,466 INFO [forking-task-runner-3] io.druid.storage.s3.S3TaskLogs - Pushing task log var/druid/task/index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa/log to: druid/indexing-logs/index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa/log 2018-02-05T03:33:27,567 INFO [forking-task-runner-3] io.druid.indexing.overlord.ForkingTaskRunner - Exception caught during execution java.io.IOException: Stream closed at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:170) ~[?:1.8.0_131] at java.io.BufferedInputStream.read1(BufferedInputStream.java:291) ~[?:1.8.0_131] at java.io.BufferedInputStream.read(BufferedInputStream.java:345) ~[?:1.8.0_131] at java.io.FilterInputStream.read(FilterInputStream.java:107) ~[?:1.8.0_131] at com.google.common.io.ByteStreams.copy(ByteStreams.java:175) ~[guava-16.0.1.jar:?] at io.druid.indexing.overlord.ForkingTaskRunner$1.call(ForkingTaskRunner.java:438) [druid-indexing-service-0.10.0.jar:0.10.0] at io.druid.indexing.overlord.ForkingTaskRunner$1.call(ForkingTaskRunner.java:220) [druid-indexing-service-0.10.0.jar:0.10.0] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131] 2018-02-05T03:33:27,568 INFO [forking-task-runner-3] io.druid.indexing.overlord.ForkingTaskRunner - Removing task directory: var/druid/task/index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa 2018-02-05T03:33:27,572 INFO [WorkerTaskMonitor] io.druid.indexing.worker.WorkerTaskMonitor - Job's finished. Completed [index_kafka_player-events-realtime_f99c5d8777e2890_igkdbboa] with status [FAILED] </code></pre></div> <p dir="auto">I saw this exception was reported in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="158126052" data-permission-text="Title is private" data-url="https://github.com/apache/druid/issues/3054" data-hovercard-type="issue" data-hovercard-url="/apache/druid/issues/3054/hovercard" href="https://github.com/apache/druid/issues/3054">#3054</a>, but this seems to be different, as here it's sporadic. I'm mainly concerned about whether I may be losing events when it happens. If the code just spawns another task that continues from the same position, then I guess it can be ignored...</p> <p dir="auto">Thanks!</p> <p dir="auto">Eran</p>
<p dir="auto"><strong>Steps to reproduce:</strong></p> <ol dir="auto"> <li>Create a <a href="http://druid.io/docs/0.9.1.1/development/extensions-core/kafka-ingestion.html" rel="nofollow">kafka indexer</a></li> <li>Create a <a href="http://druid.io/docs/0.9.1.1/development/extensions-core/kafka-extraction-namespace.html" rel="nofollow">kafka lookup</a></li> <li>Wait for a kafka index task to start</li> <li>Emulate a <code class="notranslate">/stop</code> request sent from supervisor to worker, e.g. via</li> </ol> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="http post localhost:8100/druid/worker/v1/chat/index_kafka_Example_c2f17f3de1b02c1_fmcaakbh/stop"><pre class="notranslate"><code class="notranslate">http post localhost:8100/druid/worker/v1/chat/index_kafka_Example_c2f17f3de1b02c1_fmcaakbh/stop </code></pre></div> <p dir="auto"><strong>Expected behavior:</strong><br> Worker successfully stops</p> <p dir="auto"><strong>Actual behavior:</strong><br> Worker process remains lingering until middle manager forcefully kills the process after timeout</p> <hr> <p dir="auto">The reason for this is that when <code class="notranslate">KafkaLookupExtractorFactory</code> invokes <code class="notranslate">consumerConnector.shutdown()</code> upon receiving the stop command, it interrupts the worker thread, and thus the shutdown does not complete properly:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2072) ~[?:1.7.0_101] at java.util.concurrent.ThreadPoolExecutor.awaitTermination(ThreadPoolExecutor.java:1468) ~[?:1.7.0_101] at kafka.utils.KafkaScheduler.shutdown(KafkaScheduler.scala:88) ~[kafka_2.10-0.8.2.1.jar:?] at kafka.consumer.ZookeeperConsumerConnector.liftedTree1$1(ZookeeperConsumerConnector.scala:195) [kafka_2.10-0.8.2.1.jar:?] at kafka.consumer.ZookeeperConsumerConnector.shutdown(ZookeeperConsumerConnector.scala:193) [kafka_2.10-0.8.2.1.jar:?] at kafka.javaapi.consumer.ZookeeperConsumerConnector.shutdown(ZookeeperConsumerConnector.scala:119) [kafka_2.10-0.8.2.1.jar:?] at io.druid.query.lookup.KafkaLookupExtractorFactory$2.run(KafkaLookupExtractorFactory.java:229) [druid-kafka-extraction-namespace-0.9.2-SNAPSHOT.jar:0.9.1.1] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [?:1.7.0_101] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_101] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_101] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_101] at java.lang.Thread.run(Thread.java:745) [?:1.7.0_101]"><pre class="notranslate"><code class="notranslate">java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2072) ~[?:1.7.0_101] at java.util.concurrent.ThreadPoolExecutor.awaitTermination(ThreadPoolExecutor.java:1468) ~[?:1.7.0_101] at kafka.utils.KafkaScheduler.shutdown(KafkaScheduler.scala:88) ~[kafka_2.10-0.8.2.1.jar:?] at kafka.consumer.ZookeeperConsumerConnector.liftedTree1$1(ZookeeperConsumerConnector.scala:195) [kafka_2.10-0.8.2.1.jar:?] at kafka.consumer.ZookeeperConsumerConnector.shutdown(ZookeeperConsumerConnector.scala:193) [kafka_2.10-0.8.2.1.jar:?] at kafka.javaapi.consumer.ZookeeperConsumerConnector.shutdown(ZookeeperConsumerConnector.scala:119) [kafka_2.10-0.8.2.1.jar:?] at io.druid.query.lookup.KafkaLookupExtractorFactory$2.run(KafkaLookupExtractorFactory.java:229) [druid-kafka-extraction-namespace-0.9.2-SNAPSHOT.jar:0.9.1.1] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [?:1.7.0_101] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_101] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_101] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_101] at java.lang.Thread.run(Thread.java:745) [?:1.7.0_101] </code></pre></div> <p dir="auto">This leaves a lingering <code class="notranslate">ConsumerFetcherThread</code> behind, and so the process does not terminate.</p>
0
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=mattinger" rel="nofollow">matthew inger</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-834?redirect=false" rel="nofollow">SPR-834</a></strong> and commented</p> <p dir="auto">The LocalSessionFactory bean currently has no way to set listeners on the SessionFactory (via the Configuration.setListener) method. This should as simple as accepting a map as a property of the LocalSessionFactoryBean, and when building the Configuration object, iterating through it, and calling Configuration.setListener on each iteration.</p> <hr> <p dir="auto"><strong>Affects:</strong> 1.2 RC1</p> <p dir="auto"><strong>Attachments:</strong></p> <ul dir="auto"> <li><a href="https://jira.spring.io/secure/attachment/10623/LocalSessionFactoryBean.patch" rel="nofollow">LocalSessionFactoryBean.patch</a> (<em>2.93 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="398055681" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/5519" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/5519/hovercard" href="https://github.com/spring-projects/spring-framework/issues/5519">#5519</a> Support For Event Listeners (<em><strong>"is duplicated by"</strong></em>)</li> </ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=cbeams" rel="nofollow">Chris Beams</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8114?redirect=false" rel="nofollow">SPR-8114</a></strong> and commented</p> <p dir="auto">When using Spring's <code class="notranslate">FactoryBean</code> types such as <code class="notranslate">LocalSessionFactoryBean</code> destruction of the actual bean (the Hibernate <code class="notranslate">Session</code> in the case of <code class="notranslate">LSFB</code>) is usually handled automatically by the <code class="notranslate">FactoryBean</code>.</p> <p dir="auto">However, when using Spring's new <code class="notranslate">*Builder</code> APIs within <code class="notranslate">@Bean</code> methods, no <code class="notranslate">FactoryBean</code>-like object is registered with the container. This means that it is up to the user to <em>remember</em> to configure the <code class="notranslate">destroy-method</code> attribute of the <code class="notranslate">@Bean</code> annotation, which is likely to be forgotten.</p> <p dir="auto">To remedy this situation, Spring should automatically detect common close/destruction method names and signatures and automatically invoke them at container shutdown time.</p> <p dir="auto">Obviously, Spring's <code class="notranslate">DisposableBean</code> is already supported in this way, as are methods annotated with <code class="notranslate">@PreDestroy</code>. When dealing with third-party types, however, the user is not at liberty to add these interfaces/annotations. In the case of Hibernate's <code class="notranslate">Session</code> interface, the method to be called is</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="public Connection close() throws HibernateException;"><pre class="notranslate"><code class="notranslate">public Connection close() throws HibernateException; </code></pre></div> <p dir="auto">As this method is not annotated in any way nor does it implement any standard interface with destruction semantics, we can only assume based on it's name that it is to be invoked.</p> <hr> <p dir="auto"><strong>Attachments:</strong></p> <ul dir="auto"> <li><a href="https://jira.spring.io/secure/attachment/18077/mylyn-context.zip" rel="nofollow">mylyn-context.zip</a> (<em>4.40 kB</em>)</li> <li><a href="https://jira.spring.io/secure/attachment/18076/mylyn-context.zip" rel="nofollow">mylyn-context.zip</a> (<em>4.40 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="398106515" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12076" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12076/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12076">#12076</a> Provide alternatives to using FactoryBean types within <code class="notranslate">@Bean</code> methods</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-projects/spring-framework/commit/5c27a042101b3ab5eaba12c440b194c88f53e685/hovercard" href="https://github.com/spring-projects/spring-framework/commit/5c27a042101b3ab5eaba12c440b194c88f53e685"><tt>5c27a04</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/1a8531b4013c945f72b7666b4de305529b68d481/hovercard" href="https://github.com/spring-projects/spring-framework/commit/1a8531b4013c945f72b7666b4de305529b68d481"><tt>1a8531b</tt></a></p>
0
<h1 dir="auto">Environment</h1> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: 19041.329 PowerToys version: v0.18.2 PowerToy module for which you are reporting the bug (if applicable): PowerToys Run"><pre class="notranslate"><code class="notranslate">Windows build number: 19041.329 PowerToys version: v0.18.2 PowerToy module for which you are reporting the bug (if applicable): PowerToys Run </code></pre></div> <h1 dir="auto">Steps to reproduce</h1> <ol dir="auto"> <li>Open PowerToys.</li> <li>Make sure <em>PowerToys Run</em> is enabled.</li> <li>Restart PowerToys.</li> <li>Look carefully at the screen. A glitch (probably the foreground of the search bar) will appear that will last less than half a second. You can see better on a white background.</li> </ol> <p dir="auto">Or,</p> <ol dir="auto"> <li>Open PowerToys.</li> <li>Disable <em>PowerToys Run</em>.</li> <li>Enable <em>PowerToys Run</em>.</li> <li>Wait for the glitch.</li> </ol> <h1 dir="auto">Expected behavior</h1> <p dir="auto">There shouldn't be any glitch when opening PowerToys. It might be annoying, and distracting, especially if you set PowerToys to launch at startup.</p> <h1 dir="auto">Actual behavior</h1> <p dir="auto">When PowerToys is launched, or <em>PowerToys Run</em> is enabled, a glitch that contains the parts of the search bar, appears, and then disappears in a fraction of a second. This gives an unpleasant user experience.</p> <h1 dir="auto">Screenshots</h1> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/16795283/85051433-2ad97700-b1a0-11ea-8afb-f93e37b9e6e9.png"><img src="https://user-images.githubusercontent.com/16795283/85051433-2ad97700-b1a0-11ea-8afb-f93e37b9e6e9.png" alt="image" style="max-width: 100%;"></a></p>
<h2 dir="auto">📝 Provide a description of the new feature</h2> <p dir="auto">I´m using a set of monitors physically at work(2x 35''), and a different setup of monitors at home (2x27").<br> I have different fanzyzones layout for the two, but when moving from one location to the other, I must rearrange all apps to the zones. Fanyzones will not automatically place the programs inside the zones, even though it loads the correct monitor setup.</p> <p dir="auto">Can FancyZones do this for me automatically? or have a option to force apps to move to their assigned zone.</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>
0
<p dir="auto">There is<br> Try looking at the lastLetterOfLastName variable declaration if you get stuck.</p> <p dir="auto">but should be</p> <p dir="auto">Try looking at the lastLetterOfFirstName variable declaration if you get stuck.</p>
<p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-use-bracket-notation-to-find-the-last-character-in-a-string" rel="nofollow">http://www.freecodecamp.com/challenges/waypoint-use-bracket-notation-to-find-the-last-character-in-a-string</a> has an issue. Please describe how to reproduce it, and include links to screenshots if possible.</p> <p dir="auto">Try looking at the lastLetterOfLastName variable declaration if you get stuck.</p> <p dir="auto">should bt</p> <p dir="auto">Try looking at the lastLetterOfFirstName variable declaration if you get stuck.</p>
1
<p dir="auto">I'm currently using <strong>babelify</strong> to transform my source code + global shimming <strong>babel-core/browser-polyfill.js</strong> through a vendor file.</p> <p dir="auto">I noticed redefinitions of _createClass [et al] and the docs mentioned to use <code class="notranslate">{ optional: 'runtime' }</code>, but this has the unfortunate side effect of also including <strong>regenerator/core-js</strong>, extending the dev build time.</p> <p dir="auto">It would be nice if I can define <code class="notranslate">{ optional: 'runtime.helpers' }</code> and have it include only the helpers.</p>
<p dir="auto">As far as I can tell the <code class="notranslate">runtime</code> transform is all-or-nothing, all I'm interested in is getting rid of the redundant helpers inlined into every module, but it seems I can't have that without also the "risk" of getting dependencies on the other runtimes (notably <code class="notranslate">core-js</code>).</p> <p dir="auto">Have I missed something or would it not make sense to have a separate transform for just this? They seem to have rather separate concerns from my perspective (avoid redundant helper code vs add dependencies for optional features).</p>
1
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=mschipperheyn" rel="nofollow">marc schipperheyn</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9538?redirect=false" rel="nofollow">SPR-9538</a></strong> and commented</p> <p dir="auto">When you Cache a Collection of elements, you are caching the entire collection as an entry.</p> <p dir="auto">The underlying elements can also be part of other <code class="notranslate">@Cacheable</code> entries, leading to duplicates and unnecessary memory consumption. Let's take the scenario of a Facebook Wall where a WallPost can be shared across hundreds of Walls with each Wall being a different collection of elements. Caching each collection would quickly become impossible or inefficient with high memory use and high numbers of cache refreshes.</p> <p dir="auto">If the item to be cached is a collection, it could be considered to cache each individual element separately and cache the collection as a collection of references to the individual entries.</p> <p dir="auto">EhCache supports this with the putAll method.</p> <p dir="auto">Ideally you should be able to configure this so that the following <code class="notranslate">@Cacheable</code> methods</p> <p dir="auto">mgr.getItem(Long id);<br> mgr.getItems();<br> mgr.getItems(Long userId);</p> <p dir="auto">all take their items from the same pool.</p> <p dir="auto">When a collection requests items that are not available in the pool, even more ideally, a dao request would be made for the missing items.</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="398176695" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/17326" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/17326/hovercard" href="https://github.com/spring-projects/spring-framework/issues/17326">#17326</a> Caching strategy (<em><strong>"duplicates"</strong></em>)</li> </ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=anthavio" rel="nofollow">Martin Vanek</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9000?redirect=false" rel="nofollow">SPR-9000</a></strong> and commented</p> <p dir="auto">In xml configuration I often use bean with parent="true" to set default values in parent context and multiple nonabstract beans in several child contexts with mandatory but always different dependency.<br> Because abstract bean concept is missing in <code class="notranslate">@Bean</code> code configuration this leads to lots of duplication</p> <p dir="auto">For example I have abstract LocalContainerEntityManagerFactoryBean bean in parent "platform" context preconfigured with jpaVendorAdapter and jpaPropertyMap, but dataSource is specified in child "dbmodel" context</p> <hr> <p dir="auto"><strong>Affects:</strong> 3.1 GA</p>
0
<p dir="auto">Continuing conversation started here: <a href="https://discuss.elastic.co/t/coerce-object-to-string/56748/3" rel="nofollow">https://discuss.elastic.co/t/coerce-object-to-string/56748/3</a></p> <p dir="auto"><strong>Description of the problem including expected versus actual behavior</strong>:</p> <p dir="auto">Would like to be able to treat an object field as String given the following mapping:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" &quot;properties&quot;: { &quot;severity&quot;: { &quot;index&quot;: &quot;not_analyzed&quot;, &quot;type&quot;: &quot;string&quot; }, &quot;metadata&quot;: { &quot;type&quot;: &quot;string&quot; &quot;coerce&quot;: true } }"><pre class="notranslate"><code class="notranslate"> "properties": { "severity": { "index": "not_analyzed", "type": "string" }, "metadata": { "type": "string" "coerce": true } } </code></pre></div> <p dir="auto">Indexing the following document:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ &quot;severity&quot;: &quot;ERROR&quot;, &quot;metadata&quot;: { &quot;someKey&quot;: &quot;someValue&quot;, &quot;someKey&quot;: { &quot;some nested key&quot;: &quot;some nested value&quot; } } }"><pre class="notranslate"><code class="notranslate">{ "severity": "ERROR", "metadata": { "someKey": "someValue", "someKey": { "some nested key": "some nested value" } } } </code></pre></div> <p dir="auto">should store the document under <code class="notranslate">metadata</code> as a searchable String.</p> <p dir="auto">Right now, it is not possible to coerce anything to a String.</p>
<p dir="auto"><strong>Describe the feature</strong>:<br> There are cases where complex objects need to be passed to tokenizers. I am writing a new feature that will allow a mapping to specify that a property of type string may coerce an object within that property to a string.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PUT /test { &quot;mappings&quot;: { &quot;test&quot;: { &quot;properties&quot;: { &quot;a&quot;: { &quot;type&quot;: &quot;string&quot;, &quot;coerce&quot;: true } } } } }"><pre class="notranslate"><code class="notranslate">PUT /test { "mappings": { "test": { "properties": { "a": { "type": "string", "coerce": true } } } } } </code></pre></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PUT /test/test/1 { &quot;a&quot;: { &quot;b&quot;:&quot;2&quot;, &quot;c&quot;:&quot;3&quot; } }"><pre class="notranslate"><code class="notranslate">PUT /test/test/1 { "a": { "b":"2", "c":"3" } } </code></pre></div> <p dir="auto">In this example, the tokenizer will be passed "{"b":"2","c":"3"}". It will be up to the tokenizer to decide how to treat that. The default tokenizer returns the tokens "b", "2", "c" and "3".</p> <p dir="auto">This situation occurs frequently in library data. Complex objects have been created and the values of some of the properties effect how the other properties are treated. A simple example occurs with book titles. There is a piece of data that specifies how many leading characters should be stripped from the title to use it as a sort key.</p> <p dir="auto">So far, the changes have been restricted to StringFieldMapper and TokenCountFieldMapper. I am making the changes in version 2.1.0 and expect to merge them into all subsequent versions.</p> <p dir="auto">I expect to be able to use the copy_to parameter, but don't know exactly how that will work yet.</p>
1
<p dir="auto">One limitation of the functional approach is discoverability: which functions can be applied to a given type? This is not necessary however: We (should) know all the functions which take an object of given type as first argument. This leads to the possibility of code completion:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="abstract type Animal end struct Cat &lt;: Animal end struct Fish &lt;: Animal end swims(Cat)=false swims(Fish)=true pussy=Cat() pussy.swims() # &lt;--- NEW syntax, same as swims(pussy), but discoverable via &lt;tab&gt;"><pre class="notranslate"><code class="notranslate">abstract type Animal end struct Cat &lt;: Animal end struct Fish &lt;: Animal end swims(Cat)=false swims(Fish)=true pussy=Cat() pussy.swims() # &lt;--- NEW syntax, same as swims(pussy), but discoverable via &lt;tab&gt; </code></pre></div> <p dir="auto">The important point is that it doesn't change the fundamentals of the language at all**, it's just syntactic sugar with the huge benefit of discoverability in the REPL. It might also hugely increase adoption.</p> <p dir="auto">Corollary: An inverse 'methods' function which lists all the methods for a given type (can be huge).</p> <p dir="auto">(** I've read <a href="https://discourse.julialang.org/t/psa-julia-is-not-at-that-stage-of-development-anymore/44872" rel="nofollow">https://discourse.julialang.org/t/psa-julia-is-not-at-that-stage-of-development-anymore/44872</a> )</p>
<p dir="auto">Since Julia is struct oriented, this could be a nice way make the language more ergonomic for methods<br> <a href="https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax" rel="nofollow">https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax</a></p> <p dir="auto">Assume</p> <div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="struct Blah ... end foo(b::Blah,i::Int32) ... end b = Blah(..)"><pre class="notranslate"><span class="pl-k">struct</span> Blah <span class="pl-k">...</span> <span class="pl-k">end</span> <span class="pl-c1">foo</span>(b<span class="pl-k">::</span><span class="pl-c1">Blah</span>,i<span class="pl-k">::</span><span class="pl-c1">Int32</span>) <span class="pl-k">...</span> <span class="pl-k">end</span> b <span class="pl-k">=</span> <span class="pl-c1">Blah</span>(<span class="pl-k">..</span>)</pre></div> <p dir="auto">In addition to this syntax</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="foo(b,123)"><pre class="notranslate"><code class="notranslate">foo(b,123) </code></pre></div> <p dir="auto">this would also be acceptable if a function signature existed with Blah as first parameter type</p> <div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="b.foo(123)"><pre class="notranslate">b<span class="pl-k">.</span><span class="pl-c1">foo</span>(<span class="pl-c1">123</span>)</pre></div> <p dir="auto">Edited: fixed function name to be idiomatic</p>
1
<p dir="auto">Recently, I've been developing fast permutation tests that can make use of numpy/scipy matrix operations.</p> <p dir="auto">So far, I have developed 3 permutation tests: a mean test, a t-test and a pearson correlation test.</p> <p dir="auto">To get an idea for the timings, I've benchmarked the mean test to a naive implementation on a 60x60 table and with 1000 permutations. Below are the timings</p> <p dir="auto">Naive time [s]: 1.91008838018<br> Numpy time [s]: 0.0174480279287</p> <p dir="auto">If you guys are down, I can start committing these algorithms into scipy. In the near future, I plan on implementing ANOVA tests such as an F-test and a Krustal-Wallis test.</p>
<p dir="auto">Apparently these two functions do exactly the same but there are no links between them in the documentation. Is there a reason to keep the two? If so, perhaps it's worth adding to the docs.</p> <p dir="auto"><a href="https://github.com/scipy/scipy/blob/master/scipy/linalg/decomp_lu.py#L17">https://github.com/scipy/scipy/blob/master/scipy/linalg/decomp_lu.py#L17</a></p>
0
<p dir="auto">I'm opening this to discuss possible options:</p> <p dir="auto">I've been scrutinizing ES indexing performance on the NYC taxi data set (1.2 B taxi rides, numerics heavy: <a href="http://www.nyc.gov/html/tlc/html/about/trip_record_data.shtml" rel="nofollow">http://www.nyc.gov/html/tlc/html/about/trip_record_data.shtml</a>).</p> <p dir="auto">These documents are small (24 fields, though a bit sparse with ~23% cells missing) and are almost entirely numbers (indexed as points + doc values).</p> <p dir="auto">As a "ceiling" for indexing performance I also indexed the same data set using Lucene's "thin wrapper" demo server (<a href="https://github.com/mikemccand/luceneserver">http://github.com/mikemccand/luceneserver</a>), indexing the same documents as efficiently as I know how (see <code class="notranslate">indexTaxis.py</code>).</p> <p dir="auto">The demo Lucene server has many differences vs. ES: it has no transaction log (does not periodically fsync), uses <code class="notranslate">addDocuments</code> not <code class="notranslate">updateDocument</code>, can index from a more compact documents source (190 GB CSV file, vs 512 GB json file for ES), does not add a costly <code class="notranslate">_uid</code> field (nor <code class="notranslate">_version</code>, <code class="notranslate">_type</code>) , uses a streaming bulk API, etc. I disabled <code class="notranslate">_all</code> and <code class="notranslate">_source</code> in ES, but net/net ES is substantially slower than the demo Lucene server.</p> <p dir="auto">So, one big thing I noticed that is maybe a lowish hanging fruit is that ES loses a lot of its indexing buffer to <code class="notranslate">LiveVersionMap</code>: if I give ES 1 GB indexing buffer, and index into only 1 shard, and disable refresh, the version map is taking ~2/3 of that buffer, leaving only ~1/3 for Lucene's <code class="notranslate">IndexWriter</code>:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="node0: [2016-08-03 09:39:07,557][DEBUG][index.engine ] [node0] [taxis][0] use refresh to write indexing buffer (heap size=[313.7mb]), to also clear version map (heap size=[730.3mb])"><pre class="notranslate"><code class="notranslate">node0: [2016-08-03 09:39:07,557][DEBUG][index.engine ] [node0] [taxis][0] use refresh to write indexing buffer (heap size=[313.7mb]), to also clear version map (heap size=[730.3mb]) </code></pre></div> <p dir="auto">This also means ES is necessarily doing periodic refresh when I didn't ask it to.</p> <p dir="auto">This is quite frustrating because I don't need optimistic concurrency here, nor real-time gets, nor refreshes. However, I fear the version map might be required during recovery, to ensure when playing back indexing operations from the transaction log that they do not incorrectly overwrite newer indexing operations? But then, this use case is also append-only, so maybe during recovery we could safely skip that, if the user turns on this new setting.</p> <p dir="auto">The version map makes an entry in a <code class="notranslate">HashMap</code> for each document indexed, and the entry stores non-trivial information, creating at least 4 new objects, holding longs/ints, etc. If we can't make it turn-off-able maybe we should instead try to reduce its per-indexing-op overhead...</p>
<p dir="auto">the node level TTL Purger thread fires up bulk delete request that might trigger <code class="notranslate">auto_create_index</code> if the purger thread runs a bulk after the index has been deleted.</p>
0
<h5 dir="auto">ISSUE TYPE</h5> <ul dir="auto"> <li>Bug Report</li> </ul> <h5 dir="auto">ANSIBLE VERSION</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="All recent releases"><pre class="notranslate"><code class="notranslate">All recent releases </code></pre></div> <h5 dir="auto">CONFIGURATION</h5> <p dir="auto">N/A</p> <h5 dir="auto">OS / ENVIRONMENT</h5> <p dir="auto">Ubuntu 16.04 4.4.0-24</p> <h5 dir="auto">SUMMARY</h5> <p dir="auto">An error prevents from building the debian package from git sources.</p> <h5 dir="auto">STEPS TO REPRODUCE</h5> <p dir="auto">release_number=$(your call)</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" build_date=$(date --rfc-2822) echo -------- echo Cleaning echo -------- cd git-ansible git reset --hard git clean -fxd :/ git fetch --progress --prune origin git checkout v${release_number} echo ------------------------------------------------------- echo &quot;Copying Debian control folder in the expected location&quot; echo ------------------------------------------------------- rsync -av --delete packaging/debian . echo -------------------------------------------------------------------------- echo &quot;Modifying debian/changelog with current release &amp; date&quot; echo --------------------------------------------------------------------------- sed -i 1,6d debian/changelog sed -i &quot;1s/^/ansible (${release_number}) unstable; urgency=low\n\n * ${release_number}\n\n -- Jean-Christophe Manciot &lt;[email protected]&gt; $build_date\n\n/&quot; debian/changelog echo -------- echo Building echo -------- dpkg-buildpackage -b -m&quot;Jean-Christophe Manciot &lt;[email protected]&gt;&quot;"><pre class="notranslate"><code class="notranslate"> build_date=$(date --rfc-2822) echo -------- echo Cleaning echo -------- cd git-ansible git reset --hard git clean -fxd :/ git fetch --progress --prune origin git checkout v${release_number} echo ------------------------------------------------------- echo "Copying Debian control folder in the expected location" echo ------------------------------------------------------- rsync -av --delete packaging/debian . echo -------------------------------------------------------------------------- echo "Modifying debian/changelog with current release &amp; date" echo --------------------------------------------------------------------------- sed -i 1,6d debian/changelog sed -i "1s/^/ansible (${release_number}) unstable; urgency=low\n\n * ${release_number}\n\n -- Jean-Christophe Manciot &lt;[email protected]&gt; $build_date\n\n/" debian/changelog echo -------- echo Building echo -------- dpkg-buildpackage -b -m"Jean-Christophe Manciot &lt;[email protected]&gt;" </code></pre></div> <h5 dir="auto">ACTUAL RESULTS</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="... dh_install -pansible dh_install: Cannot find (any matches for) &quot;docs/man/man1/*.1&quot; (tried in &quot;.&quot;) dh_install: ansible missing files: docs/man/man1/*.1 dh_install: missing files, aborting /usr/share/cdbs/1/rules/debhelper.mk:213: recipe for target 'binary-install/ansible' failed make: *** [binary-install/ansible] Error 255 dpkg-buildpackage: error: debian/rules binary gave error exit status 2"><pre class="notranslate"><code class="notranslate">... dh_install -pansible dh_install: Cannot find (any matches for) "docs/man/man1/*.1" (tried in ".") dh_install: ansible missing files: docs/man/man1/*.1 dh_install: missing files, aborting /usr/share/cdbs/1/rules/debhelper.mk:213: recipe for target 'binary-install/ansible' failed make: *** [binary-install/ansible] Error 255 dpkg-buildpackage: error: debian/rules binary gave error exit status 2 </code></pre></div> <p dir="auto">Full log with <strong>2.1.1.0-0.1.rc1</strong>:<br> <a href="https://github.com/ansible/ansible/files/321678/Cannot.find.any.matches.for.docs-man-man1-.1.txt">Cannot find any matches for docs-man-man1-*.1.txt</a></p>
<p dir="auto">ansible_sudo=True/False<br> in inventory.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[krb5] localhost s8webera ansible_ssh_user=root ansible_sudo=False ansible_python_interpreter=/usr/bin/python2.7"><pre class="notranslate"><code class="notranslate">[krb5] localhost s8webera ansible_ssh_user=root ansible_sudo=False ansible_python_interpreter=/usr/bin/python2.7 </code></pre></div> <p dir="auto">This is important on mixed environment where some system dont have sudo installed.</p> <p dir="auto">Here is a current working solution that im using in production.<br> This was programmed as a hack.. So please could a project maintainer develop this fix correctly.</p> <p dir="auto">file:///home/s8weber/srv/ansible/lib/ansible/runner/<strong>init</strong>.py</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" def _executor_internal(self, host): ''' executes any module one or more times ''' host_variables = self.inventory.get_variables(host) if host_variables.get('ansible_sudo', None): self.sudo = host_variables.get('ansible_sudo', None) == 'True' ...."><pre class="notranslate"><code class="notranslate"> def _executor_internal(self, host): ''' executes any module one or more times ''' host_variables = self.inventory.get_variables(host) if host_variables.get('ansible_sudo', None): self.sudo = host_variables.get('ansible_sudo', None) == 'True' .... </code></pre></div>
0
<ul dir="auto"> <li>Electron version: 1.2.5</li> <li>Operating system: Mac OS X el capitan</li> </ul> <p dir="auto">When sending IPC messages between the renderer and the main process, I think we sometimes get duplicate messages.</p> <p dir="auto">What kind of reliability is ensured by Electron? Should we handle de-duplication ourselves in the case of the same messages being re-sent?</p> <p dir="auto">I don't know if that's the right place for that question but I tried to post it on the discussion forum of Electron a few days ago and nobody answered so I am trying here.</p> <p dir="auto">Thanks</p>
<p dir="auto">After creating a notification and passing a tag, then subsequent notifications with the same tag don't show up for the entire lifespan of the app.</p> <ul dir="auto"> <li>Electron version: 1.8.1</li> <li>Operating system: Windows 7 x64</li> </ul> <h3 dir="auto">Expected behavior</h3> <p dir="auto">New notifications should open after the last one has closed.</p> <h3 dir="auto">Actual behavior</h3> <p dir="auto">Nothing happens</p> <h3 dir="auto">How to reproduce</h3> <p dir="auto">$ git clone <a href="https://github.com/electron/electron-quick-start">https://github.com/electron/electron-quick-start</a> .<br> $ npm install<br> $ npm start</p> <p dir="auto">Then in the app open dev tools and paste this in the console:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="new Notification(&quot;test&quot;, { tag: &quot;test&quot; });"><pre class="notranslate"><code class="notranslate">new Notification("test", { tag: "test" }); </code></pre></div> <p dir="auto">Wait for the notification to disappear and paste it again, observe nothingness.</p>
0
<p dir="auto">We have a library of components for angular that we are currently migrating to Angular 2. We have a container that injects content using <code class="notranslate">ng-content</code>. We would like to have a child component that injects the parent if you nest it inside of the parent, like so:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;parent&gt; &lt;child&gt;&lt;/child&gt; &lt;/parent&gt;"><pre class="notranslate"><code class="notranslate">&lt;parent&gt; &lt;child&gt;&lt;/child&gt; &lt;/parent&gt; </code></pre></div> <p dir="auto">This works beautifully in angular 2. However, since are in the process of migration, we would like to use the ngUpgrade adapter for this. The dependency injection seems to fail if the parent and child are specified in an angular 1 context. Any insights on this issue? Is this something that is going to be supported in the ngUpgrade adapter?</p> <p dir="auto">I have a working plunker that illustrates the problem:</p> <p dir="auto"><a href="http://plnkr.co/edit/9qb6ZK9SpJyrWoJDEFEj?p=preview" rel="nofollow">http://plnkr.co/edit/9qb6ZK9SpJyrWoJDEFEj?p=preview</a></p> <p dir="auto">In both cases, the template includes a parent with the child <code class="notranslate">transcluded/projected</code> into it. The child tries to inject the parent and then calls a function on it when you press the button. The ng2 example works, but not the ng1/ngUpgrade one.</p>
<p dir="auto">According to the docs, making a directive that listens for events on the host element is like so:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Directive({ selector: 'input', hostListeners: { 'change': 'onChange($event)', 'window:resize': 'onResize($event)' } }) class InputDirective { onChange(event:Event) {} onResize(event:Event) {} }"><pre class="notranslate">@<span class="pl-smi">Directive</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">selector</span>: <span class="pl-s">'input'</span><span class="pl-kos">,</span> <span class="pl-c1">hostListeners</span>: <span class="pl-kos">{</span> <span class="pl-s">'change'</span>: <span class="pl-s">'onChange($event)'</span><span class="pl-kos">,</span> <span class="pl-s">'window:resize'</span>: <span class="pl-s">'onResize($event)'</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-k">class</span> <span class="pl-smi">InputDirective</span> <span class="pl-kos">{</span> <span class="pl-en">onChange</span><span class="pl-kos">(</span><span class="pl-s1">event</span>:<span class="pl-smi">Event</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span> <span class="pl-en">onResize</span><span class="pl-kos">(</span><span class="pl-s1">event</span>:<span class="pl-smi">Event</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">This seems like it could be streamlined:</p> <ul dir="auto"> <li>The listeners are registered far away from where the handlers are defined</li> <li>The registration duplicates a) the method names and b) arguments.</li> <li>The registration uses strings which makes obfuscation and refactoring more difficult.</li> <li>You can listen for global events, too (seems odd that the <strong>host</strong>Listener object lets you do this)</li> <li>Listening for global events depends on a magic string prefix of "window:" (or "document:" or "body:", implied by the docs)</li> </ul> <p dir="auto">Here's a possible alternative:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Directive({ selector: 'input' }) class InputDirective { @HostListener('change') onChange(event: Event) {} @WindowListener('resize') onResize(event: Event) {} }"><pre class="notranslate">@<span class="pl-smi">Directive</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">selector</span>: <span class="pl-s">'input'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-k">class</span> <span class="pl-smi">InputDirective</span> <span class="pl-kos">{</span> @<span class="pl-smi">HostListener</span><span class="pl-kos">(</span><span class="pl-s">'change'</span><span class="pl-kos">)</span> <span class="pl-en">onChange</span><span class="pl-kos">(</span><span class="pl-s1">event</span>: <span class="pl-smi">Event</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span> @<span class="pl-smi">WindowListener</span><span class="pl-kos">(</span><span class="pl-s">'resize'</span><span class="pl-kos">)</span> <span class="pl-en">onResize</span><span class="pl-kos">(</span><span class="pl-s1">event</span>: <span class="pl-smi">Event</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">This doesn't suffer from any of the problems listed above.</p> <p dir="auto">You can imagine a similar streamlining for properties. Currently you write:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Directive({ selector: '[dependency]', properties: { 'id':'dependency' } }) class Dependency { id:string; }"><pre class="notranslate">@<span class="pl-smi">Directive</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">selector</span>: <span class="pl-s">'[dependency]'</span><span class="pl-kos">,</span> <span class="pl-c1">properties</span>: <span class="pl-kos">{</span> <span class="pl-s">'id'</span>:<span class="pl-s">'dependency'</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-k">class</span> <span class="pl-smi">Dependency</span> <span class="pl-kos">{</span> <span class="pl-c1">id</span>:<span class="pl-smi">string</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">But using decorators you could write:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Directive({ selector: '[dependency]', }) class Dependency { @Property('dependency') id:string; }"><pre class="notranslate">@<span class="pl-smi">Directive</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">selector</span>: <span class="pl-s">'[dependency]'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-k">class</span> <span class="pl-smi">Dependency</span> <span class="pl-kos">{</span> @<span class="pl-smi">Property</span><span class="pl-kos">(</span><span class="pl-s">'dependency'</span><span class="pl-kos">)</span> <span class="pl-c1">id</span>:<span class="pl-smi">string</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">I find it a whole lot easier to understand this, not needing to remember constantly what the left and right hand side of the configuration means. E.g. for <code class="notranslate">{ 'id': 'dependency' }</code> I cannot tell easily which one of 'id' or 'dependency' is the JS class property and which is the DOM element property. I constantly get this confused in Angular 1, too, with the scope config. Hopefully we can eliminate this rough edge in Angular 2...</p>
0
<h5 dir="auto">ISSUE TYPE</h5> <ul dir="auto"> <li>Bug Report</li> </ul> <h5 dir="auto">COMPONENT NAME</h5> <p dir="auto">modules/cloud/google/gce.py</p> <h5 dir="auto">ANSIBLE VERSION</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.0.1.0 config file = configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.0.1.0 config file = configured module search path = Default w/o overrides </code></pre></div> <h5 dir="auto">CONFIGURATION</h5> <p dir="auto">Python 2.7.10 from virtualenv and using apache-libcloud==1.5.0</p> <h5 dir="auto">OS / ENVIRONMENT</h5> <p dir="auto">OS X 10.10.5</p> <h5 dir="auto">SUMMARY</h5> <p dir="auto">Attempting to duplicate instance creation from example at <a href="http://docs.ansible.com/ansible/guide_gce.html" rel="nofollow">http://docs.ansible.com/ansible/guide_gce.html</a>.</p> <h5 dir="auto">STEPS TO REPRODUCE</h5> <p dir="auto">Please note I am able to interact with google cloud using apache-libcloud with same credentials.</p> <p dir="auto">&lt;---hosts file---&gt;<br> localhost ansible_connection=local</p> <p dir="auto">&lt;---playbook.yml---&gt;</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="--- - name: Create instance(s) hosts: localhost connection: local gather_facts: no vars: service_account_email: [email protected] credentials_file: /Users...json project_id: ...238 machine_type: n1-standard-1 image: debian-7 tasks: - name: Launch instances gce: instance_names: dev machine_type: &quot;{{ machine_type }}&quot; image: &quot;{{ image }}&quot; service_account_email: &quot;{{ service_account_email }}&quot; credentials_file: &quot;{{ credentials_file }}&quot; project_id: &quot;{{ project_id }}&quot;"><pre class="notranslate">--- - <span class="pl-ent">name</span>: <span class="pl-s">Create instance(s)</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">gather_facts</span>: <span class="pl-s">no</span> <span class="pl-ent">vars</span>: <span class="pl-ent">service_account_email</span>: <span class="pl-s">[email protected]</span> <span class="pl-ent">credentials_file</span>: <span class="pl-s">/Users...json</span> <span class="pl-ent">project_id</span>: <span class="pl-s">...238</span> <span class="pl-ent">machine_type</span>: <span class="pl-s">n1-standard-1</span> <span class="pl-ent">image</span>: <span class="pl-s">debian-7</span> <span class="pl-ent">tasks</span>: - <span class="pl-ent">name</span>: <span class="pl-s">Launch instances</span> <span class="pl-ent">gce</span>: <span class="pl-ent">instance_names</span>: <span class="pl-s">dev</span> <span class="pl-ent">machine_type</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ machine_type }}<span class="pl-pds">"</span></span> <span class="pl-ent">image</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ image }}<span class="pl-pds">"</span></span> <span class="pl-ent">service_account_email</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ 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>{{ credentials_file }}<span class="pl-pds">"</span></span> <span class="pl-ent">project_id</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ project_id }}<span class="pl-pds">"</span></span></pre></div> <p dir="auto">Command is: ansible-playbook -i hosts playbook.yml -vvvv</p> <h5 dir="auto">EXPECTED RESULTS</h5> <p dir="auto">Something indicating success; undocumented!</p> <h5 dir="auto">ACTUAL RESULTS</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [Create instance(s)] ****************************************************** TASK [Launch instances] ******************************************************** task path: /Users/me/ansible/me/guide_gce/as_of_010617.yml:16 ESTABLISH LOCAL CONNECTION FOR USER: me localhost EXEC /bin/sh -c '( umask 22 &amp;&amp; mkdir -p &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1483722674.82-53534914954591 `&quot; &amp;&amp; echo &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1483722674.82-53534914954591 `&quot; )' localhost PUT /var/folders/h1/bg76tk196rz065b81p1d28ch0000gn/T/tmpp7fYZZ TO /Users/me/.ansible/tmp/ansible-tmp-1483722674.82-53534914954591/gce localhost EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /Users/me/.ansible/tmp/ansible-tmp-1483722674.82-53534914954591/gce; rm -rf &quot;/Users/me/.ansible/tmp/ansible-tmp-1483722674.82-53534914954591/&quot; &gt; /dev/null 2&gt;&amp;1' fatal: [localhost]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;failed&quot;: true, &quot;invocation&quot;: {&quot;module_args&quot;: &lt;OMITTED&gt; &quot;module_name&quot;: &quot;gce&quot;}, &quot;msg&quot;: &quot;unsupported parameter for module: credentials_file&quot;} NO MORE HOSTS LEFT ************************************************************* to retry, use: --limit @as_of_010617.retry PLAY RECAP ********************************************************************* localhost : ok=0 changed=0 unreachable=0 failed=1 "><pre class="notranslate"><code class="notranslate">PLAY [Create instance(s)] ****************************************************** TASK [Launch instances] ******************************************************** task path: /Users/me/ansible/me/guide_gce/as_of_010617.yml:16 ESTABLISH LOCAL CONNECTION FOR USER: me localhost EXEC /bin/sh -c '( umask 22 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1483722674.82-53534914954591 `" &amp;&amp; echo "` echo $HOME/.ansible/tmp/ansible-tmp-1483722674.82-53534914954591 `" )' localhost PUT /var/folders/h1/bg76tk196rz065b81p1d28ch0000gn/T/tmpp7fYZZ TO /Users/me/.ansible/tmp/ansible-tmp-1483722674.82-53534914954591/gce localhost EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /Users/me/.ansible/tmp/ansible-tmp-1483722674.82-53534914954591/gce; rm -rf "/Users/me/.ansible/tmp/ansible-tmp-1483722674.82-53534914954591/" &gt; /dev/null 2&gt;&amp;1' fatal: [localhost]: FAILED! =&gt; {"changed": false, "failed": true, "invocation": {"module_args": &lt;OMITTED&gt; "module_name": "gce"}, "msg": "unsupported parameter for module: credentials_file"} NO MORE HOSTS LEFT ************************************************************* to retry, use: --limit @as_of_010617.retry PLAY RECAP ********************************************************************* localhost : ok=0 changed=0 unreachable=0 failed=1 </code></pre></div>
<p dir="auto">Documentation of the <code class="notranslate">copy</code> module suggests in the example that <em>owner</em>, <em>group</em>, and <em>mode</em> can be specified, even though these options aren't explicitly mentioned.</p> <p dir="auto">Looking through the source of <code class="notranslate">library/copy</code> suggests they aren't supported.</p> <p dir="auto">I feel they ought to be.</p>
0
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="java.lang.NullPointerException 1at android.graphics.Rect.&lt;init&gt;(Rect.java:72) 2at android.graphics.drawable.ShapeDrawable.mutate(ShapeDrawable.java:377) 3at android.widget.ImageView.applyColorMod(ImageView.java:1033) 4at android.widget.ImageView.updateDrawable(ImageView.java:611) 5at android.widget.ImageView.setImageDrawable(ImageView.java:359) 6at com.bumptech.glide.request.target.ImageViewTarget.void onLoadCleared(android.graphics.drawable.Drawable)(SourceFile:70) 7at com.bumptech.glide.request.GenericRequest.void clear()(SourceFile:312) 8at com.bumptech.glide.GenericRequestBuilder.com.bumptech.glide.request.target.Target into(com.bumptech.glide.request.target.Target)(SourceFile:603) 9at com.bumptech.glide.GenericRequestBuilder.com.bumptech.glide.request.target.Target into(android.widget.ImageView)(SourceFile:647) 10at com.bumptech.glide.BitmapRequestBuilder.com.bumptech.glide.request.target.Target into(android.widget.ImageView)(SourceFile:486) 11at com.app.Utils void loadImage(android.content.Context,ImageView,java.lang.String,size,drawable)(SourceFile:657)"><pre class="notranslate"><code class="notranslate">java.lang.NullPointerException 1at android.graphics.Rect.&lt;init&gt;(Rect.java:72) 2at android.graphics.drawable.ShapeDrawable.mutate(ShapeDrawable.java:377) 3at android.widget.ImageView.applyColorMod(ImageView.java:1033) 4at android.widget.ImageView.updateDrawable(ImageView.java:611) 5at android.widget.ImageView.setImageDrawable(ImageView.java:359) 6at com.bumptech.glide.request.target.ImageViewTarget.void onLoadCleared(android.graphics.drawable.Drawable)(SourceFile:70) 7at com.bumptech.glide.request.GenericRequest.void clear()(SourceFile:312) 8at com.bumptech.glide.GenericRequestBuilder.com.bumptech.glide.request.target.Target into(com.bumptech.glide.request.target.Target)(SourceFile:603) 9at com.bumptech.glide.GenericRequestBuilder.com.bumptech.glide.request.target.Target into(android.widget.ImageView)(SourceFile:647) 10at com.bumptech.glide.BitmapRequestBuilder.com.bumptech.glide.request.target.Target into(android.widget.ImageView)(SourceFile:486) 11at com.app.Utils void loadImage(android.content.Context,ImageView,java.lang.String,size,drawable)(SourceFile:657) </code></pre></div> <p dir="auto">happening sometimes</p>
<p dir="auto">If an ImageView has something that has its (internal) <code class="notranslate">mColorMod</code> field set to true (i.e. there is an alpha or color filter set - see <code class="notranslate">ImageView.applyColorMod()</code>), then when Glide updates the image view providing the <code class="notranslate">TransitionDrawable</code> (the current drawable + <code class="notranslate">SquaringDrawable</code>), the image view attempts to mutate it and crashes (NPE) when calling <code class="notranslate">SquaringDrawable.getConstantState()</code>.</p> <p dir="auto">Trace from Genymotion v4.4.2</p> <div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" java.lang.NullPointerException at android.graphics.drawable.LayerDrawable$LayerState.&lt;init&gt;(LayerDrawable.java:671) at android.graphics.drawable.TransitionDrawable$TransitionState.&lt;init&gt;(TransitionDrawable.java:249) at android.graphics.drawable.TransitionDrawable.createConstantState(TransitionDrawable.java:101) at android.graphics.drawable.LayerDrawable.mutate(LayerDrawable.java:608) at android.widget.ImageView.applyColorMod(ImageView.java:1216) at android.widget.ImageView.updateDrawable(ImageView.java:716) at android.widget.ImageView.setImageDrawable(ImageView.java:421) at com.bumptech.glide.request.target.ImageViewTarget.setDrawable(ImageViewTarget.java:37) at com.bumptech.glide.request.animation.DrawableCrossFadeViewAnimation.animate(DrawableCrossFadeViewAnimation.java:49) at com.bumptech.glide.request.animation.DrawableCrossFadeViewAnimation.animate(DrawableCrossFadeViewAnimation.java:14) at com.bumptech.glide.request.target.ImageViewTarget.onResourceReady(ImageViewTarget.java:75) at com.bumptech.glide.request.target.GlideDrawableImageViewTarget.onResourceReady(GlideDrawableImageViewTarget.java:66) at com.bumptech.glide.request.target.GlideDrawableImageViewTarget.onResourceReady(GlideDrawableImageViewTarget.java:12) at com.bumptech.glide.request.GenericRequest.onResourceReady(GenericRequest.java:499) at com.bumptech.glide.request.GenericRequest.onResourceReady(GenericRequest.java:486) at com.bumptech.glide.load.engine.EngineJob.handleResultOnMainThread(EngineJob.java:158) at com.bumptech.glide.load.engine.EngineJob.access$100(EngineJob.java:22) at com.bumptech.glide.load.engine.EngineJob$MainThreadCallback.handleMessage(EngineJob.java:202) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method)"><pre class="notranslate"> <span class="pl-smi">java</span>.<span class="pl-smi">lang</span>.<span class="pl-smi">NullPointerException</span> <span class="pl-s1">at</span> <span class="pl-s1">android</span>.<span class="pl-s1">graphics</span>.<span class="pl-s1">drawable</span>.<span class="pl-s1">LayerDrawable$LayerState</span>.&lt;<span class="pl-smi">init</span>&gt;(<span class="pl-smi">LayerDrawable</span>.<span class="pl-smi">java</span>:<span class="pl-c1">671</span>) <span class="pl-smi">at</span> <span class="pl-s1">android</span>.<span class="pl-s1">graphics</span>.<span class="pl-s1">drawable</span>.<span class="pl-s1">TransitionDrawable$TransitionState</span>.&lt;<span class="pl-smi">init</span>&gt;(<span class="pl-smi">TransitionDrawable</span>.<span class="pl-smi">java</span>:<span class="pl-c1">249</span>) <span class="pl-smi">at</span> <span class="pl-s1">android</span>.<span class="pl-s1">graphics</span>.<span class="pl-s1">drawable</span>.<span class="pl-s1">TransitionDrawable</span>.<span class="pl-en">createConstantState</span>(<span class="pl-smi">TransitionDrawable</span>.<span class="pl-smi">java</span>:<span class="pl-c1">101</span>) <span class="pl-s1">at</span> <span class="pl-s1">android</span>.<span class="pl-s1">graphics</span>.<span class="pl-s1">drawable</span>.<span class="pl-s1">LayerDrawable</span>.<span class="pl-en">mutate</span>(<span class="pl-smi">LayerDrawable</span>.<span class="pl-smi">java</span>:<span class="pl-c1">608</span>) <span class="pl-s1">at</span> <span class="pl-s1">android</span>.<span class="pl-s1">widget</span>.<span class="pl-s1">ImageView</span>.<span class="pl-en">applyColorMod</span>(<span class="pl-smi">ImageView</span>.<span class="pl-smi">java</span>:<span class="pl-c1">1216</span>) <span class="pl-s1">at</span> <span class="pl-s1">android</span>.<span class="pl-s1">widget</span>.<span class="pl-s1">ImageView</span>.<span class="pl-en">updateDrawable</span>(<span class="pl-smi">ImageView</span>.<span class="pl-smi">java</span>:<span class="pl-c1">716</span>) <span class="pl-s1">at</span> <span class="pl-s1">android</span>.<span class="pl-s1">widget</span>.<span class="pl-s1">ImageView</span>.<span class="pl-en">setImageDrawable</span>(<span class="pl-smi">ImageView</span>.<span class="pl-smi">java</span>:<span class="pl-c1">421</span>) <span class="pl-s1">at</span> <span class="pl-s1">com</span>.<span class="pl-s1">bumptech</span>.<span class="pl-s1">glide</span>.<span class="pl-s1">request</span>.<span class="pl-s1">target</span>.<span class="pl-s1">ImageViewTarget</span>.<span class="pl-en">setDrawable</span>(<span class="pl-smi">ImageViewTarget</span>.<span class="pl-smi">java</span>:<span class="pl-c1">37</span>) <span class="pl-s1">at</span> <span class="pl-s1">com</span>.<span class="pl-s1">bumptech</span>.<span class="pl-s1">glide</span>.<span class="pl-s1">request</span>.<span class="pl-s1">animation</span>.<span class="pl-s1">DrawableCrossFadeViewAnimation</span>.<span class="pl-en">animate</span>(<span class="pl-smi">DrawableCrossFadeViewAnimation</span>.<span class="pl-smi">java</span>:<span class="pl-c1">49</span>) <span class="pl-s1">at</span> <span class="pl-s1">com</span>.<span class="pl-s1">bumptech</span>.<span class="pl-s1">glide</span>.<span class="pl-s1">request</span>.<span class="pl-s1">animation</span>.<span class="pl-s1">DrawableCrossFadeViewAnimation</span>.<span class="pl-en">animate</span>(<span class="pl-smi">DrawableCrossFadeViewAnimation</span>.<span class="pl-smi">java</span>:<span class="pl-c1">14</span>) <span class="pl-s1">at</span> <span class="pl-s1">com</span>.<span class="pl-s1">bumptech</span>.<span class="pl-s1">glide</span>.<span class="pl-s1">request</span>.<span class="pl-s1">target</span>.<span class="pl-s1">ImageViewTarget</span>.<span class="pl-en">onResourceReady</span>(<span class="pl-smi">ImageViewTarget</span>.<span class="pl-smi">java</span>:<span class="pl-c1">75</span>) <span class="pl-s1">at</span> <span class="pl-s1">com</span>.<span class="pl-s1">bumptech</span>.<span class="pl-s1">glide</span>.<span class="pl-s1">request</span>.<span class="pl-s1">target</span>.<span class="pl-s1">GlideDrawableImageViewTarget</span>.<span class="pl-en">onResourceReady</span>(<span class="pl-smi">GlideDrawableImageViewTarget</span>.<span class="pl-smi">java</span>:<span class="pl-c1">66</span>) <span class="pl-s1">at</span> <span class="pl-s1">com</span>.<span class="pl-s1">bumptech</span>.<span class="pl-s1">glide</span>.<span class="pl-s1">request</span>.<span class="pl-s1">target</span>.<span class="pl-s1">GlideDrawableImageViewTarget</span>.<span class="pl-en">onResourceReady</span>(<span class="pl-smi">GlideDrawableImageViewTarget</span>.<span class="pl-smi">java</span>:<span class="pl-c1">12</span>) <span class="pl-s1">at</span> <span class="pl-s1">com</span>.<span class="pl-s1">bumptech</span>.<span class="pl-s1">glide</span>.<span class="pl-s1">request</span>.<span class="pl-s1">GenericRequest</span>.<span class="pl-en">onResourceReady</span>(<span class="pl-smi">GenericRequest</span>.<span class="pl-smi">java</span>:<span class="pl-c1">499</span>) <span class="pl-s1">at</span> <span class="pl-s1">com</span>.<span class="pl-s1">bumptech</span>.<span class="pl-s1">glide</span>.<span class="pl-s1">request</span>.<span class="pl-s1">GenericRequest</span>.<span class="pl-en">onResourceReady</span>(<span class="pl-smi">GenericRequest</span>.<span class="pl-smi">java</span>:<span class="pl-c1">486</span>) <span class="pl-s1">at</span> <span class="pl-s1">com</span>.<span class="pl-s1">bumptech</span>.<span class="pl-s1">glide</span>.<span class="pl-s1">load</span>.<span class="pl-s1">engine</span>.<span class="pl-s1">EngineJob</span>.<span class="pl-en">handleResultOnMainThread</span>(<span class="pl-smi">EngineJob</span>.<span class="pl-smi">java</span>:<span class="pl-c1">158</span>) <span class="pl-s1">at</span> <span class="pl-s1">com</span>.<span class="pl-s1">bumptech</span>.<span class="pl-s1">glide</span>.<span class="pl-s1">load</span>.<span class="pl-s1">engine</span>.<span class="pl-s1">EngineJob</span>.<span class="pl-en">access$100</span>(<span class="pl-smi">EngineJob</span>.<span class="pl-smi">java</span>:<span class="pl-c1">22</span>) <span class="pl-s1">at</span> <span class="pl-s1">com</span>.<span class="pl-s1">bumptech</span>.<span class="pl-s1">glide</span>.<span class="pl-s1">load</span>.<span class="pl-s1">engine</span>.<span class="pl-s1">EngineJob$MainThreadCallback</span>.<span class="pl-en">handleMessage</span>(<span class="pl-smi">EngineJob</span>.<span class="pl-smi">java</span>:<span class="pl-c1">202</span>) <span class="pl-s1">at</span> <span class="pl-s1">android</span>.<span class="pl-s1">os</span>.<span class="pl-s1">Handler</span>.<span class="pl-en">dispatchMessage</span>(<span class="pl-smi">Handler</span>.<span class="pl-smi">java</span>:<span class="pl-c1">98</span>) <span class="pl-s1">at</span> <span class="pl-s1">android</span>.<span class="pl-s1">os</span>.<span class="pl-s1">Looper</span>.<span class="pl-en">loop</span>(<span class="pl-smi">Looper</span>.<span class="pl-smi">java</span>:<span class="pl-c1">136</span>) <span class="pl-s1">at</span> <span class="pl-s1">android</span>.<span class="pl-s1">app</span>.<span class="pl-s1">ActivityThread</span>.<span class="pl-en">main</span>(<span class="pl-smi">ActivityThread</span>.<span class="pl-smi">java</span>:<span class="pl-c1">5017</span>) <span class="pl-s1">at</span> <span class="pl-s1">java</span>.<span class="pl-s1">lang</span>.<span class="pl-s1">reflect</span>.<span class="pl-s1">Method</span>.<span class="pl-en">invokeNative</span>(<span class="pl-smi">Native</span> <span class="pl-s1">Method</span>) <span class="pl-s1">at</span> <span class="pl-s1">java</span>.<span class="pl-s1">lang</span>.<span class="pl-s1">reflect</span>.<span class="pl-s1">Method</span>.<span class="pl-en">invoke</span>(<span class="pl-smi">Method</span>.<span class="pl-smi">java</span>:<span class="pl-c1">515</span>) <span class="pl-s1">at</span> <span class="pl-s1">com</span>.<span class="pl-s1">android</span>.<span class="pl-s1">internal</span>.<span class="pl-s1">os</span>.<span class="pl-s1">ZygoteInit$MethodAndArgsCaller</span>.<span class="pl-en">run</span>(<span class="pl-smi">ZygoteInit</span>.<span class="pl-smi">java</span>:<span class="pl-c1">779</span>) <span class="pl-s1">at</span> <span class="pl-s1">com</span>.<span class="pl-s1">android</span>.<span class="pl-s1">internal</span>.<span class="pl-s1">os</span>.<span class="pl-s1">ZygoteInit</span>.<span class="pl-en">main</span>(<span class="pl-smi">ZygoteInit</span>.<span class="pl-smi">java</span>:<span class="pl-c1">595</span>) <span class="pl-s1">at</span> <span class="pl-s1">dalvik</span>.<span class="pl-s1">system</span>.<span class="pl-s1">NativeStart</span>.<span class="pl-en">main</span>(<span class="pl-smi">Native</span> <span class="pl-s1">Method</span>)</pre></div>
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="[ ] bug report [x] feature request [ ] support request =&gt; 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">[ ] bug report [x] feature request [ ] support request =&gt; 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> Currently there is no equivalent to history.replaceState in the router API. The only way to redirect seems to be the redirectTo option in RouterConfig.</p> <p dir="auto"><strong>Expected/desired behavior</strong><br> I'd like to be able to redirect the user dynamically in my application.</p> <p dir="auto"><strong>Please tell us about your environment:</strong></p> <ul dir="auto"> <li><strong>Angular version:</strong> 2.0.0-rc.3</li> <li><strong>Browser:</strong> [all ]</li> <li><strong>Language:</strong> [all ]</li> </ul>
<p dir="auto">This issue is related to the new-new router:</p> <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="[ ] bug report [x] feature request [ ] support request =&gt; 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">[ ] bug report [x] feature request [ ] support request =&gt; 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> There is not currently any way to navigate through an application while skipping the browser history.</p> <p dir="auto"><strong>Expected/desired behavior</strong><br> In the router-deprecated there was a second parameter on the <code class="notranslate">navigateByUrl</code> method that allowed us to <code class="notranslate">skipLocationChange</code>. It would be nice if the <code class="notranslate">navigate</code> method allowed this too.</p> <p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br> I have a specific use case where we have a 'loader' component that does a service call and essentially decides where to route you. I would like to be able to navigate to this loader component without including it in the back button history so that the browser doesn't get stuck in an infinite loop of going back to the loader only to get redirected.</p> <p dir="auto"><strong>Please tell us about your environment:</strong></p> <ul dir="auto"> <li><strong>Angular version:</strong> 2.0.0-rc.3</li> <li><strong>Router version:</strong> alpha.7</li> <li><strong>Browser:</strong> [all]</li> <li><strong>Language:</strong> [all]</li> </ul>
1
<p dir="auto">I found a bug with the responsive behavior of the nav-justified element, on chrome.<br> When browser window is scaled down, the menu changes as it should, eventually turning into a vertical menu. but when window is scaled back up, it doesn't go back to the way it should be. When repeated, the problem increases.</p> <p dir="auto">check it out on:<br> <a href="http://getbootstrap.com/examples/justified-nav/" rel="nofollow">http://getbootstrap.com/examples/justified-nav/</a></p>
<p dir="auto">The justified nav example (<a href="http://getbootstrap.com/examples/justified-nav" rel="nofollow">http://getbootstrap.com/examples/justified-nav</a>) collapses perfectly when the screen is narrowed, but when the screen is expanded it get wonky.<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/db69ca8e316e013e7709351d88ecf7d585b87ae58bdeb880ad477c8bc93e6608/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f38333730382f3938323439352f33383763663635362d303766382d313165332d393330382d6363376238306661653266642e706e67"><img src="https://camo.githubusercontent.com/db69ca8e316e013e7709351d88ecf7d585b87ae58bdeb880ad477c8bc93e6608/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f38333730382f3938323439352f33383763663635362d303766382d313165332d393330382d6363376238306661653266642e706e67" alt="justified nav" data-canonical-src="https://f.cloud.github.com/assets/83708/982495/387cf656-07f8-11e3-9308-cc7b80fae2fd.png" style="max-width: 100%;"></a><br> expanded</p>
1
<p dir="auto"><a href="https://github.com/unicomp21"><img src="https://avatars.githubusercontent.com/u/546301?v=3" align="left" width="96" height="96" hspace="10" style="max-width: 100%;"></a> <strong>Issue by <a href="https://github.com/unicomp21">unicomp21</a></strong><br> <em>Sunday Oct 04, 2015 at 09:59 GMT</em><br> <em>Originally opened as <a href="https://github.com/flutter/engine/issues/1482">https://github.com/flutter/engine/issues/1482</a></em></p> <hr> <p dir="auto">Do we have ES 3.0?</p>
1
<h3 dir="auto">Apache Airflow version</h3> <p dir="auto">2.3.3</p> <h3 dir="auto">What happened</h3> <p dir="auto">I have multiple dags running regularly. Dags fail randomly for no reason. When I look at the grid view, one task is in skipped state due to dag timeout. But that task did not get executed during the entire period until timeout.</p> <p dir="auto">This happens randomly to any dag, to any task, at any time.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3456652/184148510-fad37728-1a6a-4d07-9c8c-55038df6372a.png"><img src="https://user-images.githubusercontent.com/3456652/184148510-fad37728-1a6a-4d07-9c8c-55038df6372a.png" alt="Screenshot 2022-07-27 at 12 04 00 PM" style="max-width: 100%;"></a><br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3456652/184148550-2e7bf4fe-28a1-4199-8929-14a4531d5e10.png"><img width="1792" alt="Screenshot 2022-07-27 at 12 04 06 PM" src="https://user-images.githubusercontent.com/3456652/184148550-2e7bf4fe-28a1-4199-8929-14a4531d5e10.png" style="max-width: 100%;"></a><br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3456652/184148557-3cd26862-593c-417c-bcc4-0805c44d9cf1.png"><img width="1792" alt="Screenshot 2022-07-27 at 12 04 10 PM" src="https://user-images.githubusercontent.com/3456652/184148557-3cd26862-593c-417c-bcc4-0805c44d9cf1.png" style="max-width: 100%;"></a><br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3456652/184148562-7b81dfcf-ac18-4517-8f70-165969429ea5.png"><img width="1792" alt="Screenshot 2022-07-27 at 12 04 13 PM" src="https://user-images.githubusercontent.com/3456652/184148562-7b81dfcf-ac18-4517-8f70-165969429ea5.png" style="max-width: 100%;"></a></p> <h3 dir="auto">What you think should happen instead</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">How to reproduce</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Operating System</h3> <p dir="auto">Ubuntu 20.04.3 LTS</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">Virtualenv installation</p> <h3 dir="auto">Deployment details</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Anything else</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Are you willing to submit PR?</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> 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.2</p> <h3 dir="auto">What happened</h3> <p dir="auto">We are using celery executor with Redis as broker.<br> We are using default settings for celery.<br> We are trying to test below case.</p> <ul dir="auto"> <li>What happens when Redis or Worker Pod goes down?</li> </ul> <p dir="auto">Observations:</p> <ul dir="auto"> <li> <p dir="auto">We tried killing Redis Pod when one task was in <code class="notranslate">queued</code> state.</p> </li> <li> <p dir="auto">We observed that task which was in <code class="notranslate">queued</code> state stays in <code class="notranslate">queued</code> state even after Redis Pod comes up.</p> </li> <li> <p dir="auto">From Airflow UI we tried clearing task and run again. But still it was getting stuck at <code class="notranslate">queued</code> state only.</p> </li> <li> <p dir="auto">Task message was received at <code class="notranslate">celery worker</code> . But worker is not starting executing the task.</p> </li> <li> <p dir="auto">Let us know if we can try changing any celery or airflow config to avoid this issue.</p> </li> <li> <p dir="auto">Also what is best practice to handle such cases.</p> </li> <li> <p dir="auto">Please help here to avoid this case. As this is very critical if this happens in production.</p> </li> </ul> <h3 dir="auto">What you think should happen instead</h3> <p dir="auto">Task must not get stuck at <code class="notranslate">queued</code> state and it should start executing.</p> <h3 dir="auto">How to reproduce</h3> <p dir="auto">While task is in queued state. Kill the Redis pod.</p> <h3 dir="auto">Operating System</h3> <p dir="auto">k8s</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">Official Helm chart</p> <h3 dir="auto">Deployment details</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Anything else</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Are you willing to submit PR?</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li> </ul> <h3 dir="auto">Code of Conduct</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li> </ul>
1
<p dir="auto">From working on <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="254786692" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/7819" data-hovercard-type="pull_request" data-hovercard-url="/scipy/scipy/pull/7819/hovercard?comment_id=327995047&amp;comment_type=issue_comment" href="https://github.com/scipy/scipy/pull/7819#issuecomment-327995047">#7819 (comment)</a>, here's a case where having both <code class="notranslate">bounds</code> and <code class="notranslate">constraints</code> enabled leads to bizarre behavior that violates both. I don't know where the actual problem is. Yellow dots are the local minima found during each step. Blue is an (exclusion) constraint, and red is out of bounds:</p> <p dir="auto"><strong>Neither:</strong></p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/58611/30195865-832bd920-942a-11e7-9f07-bdb739050338.png"><img src="https://user-images.githubusercontent.com/58611/30195865-832bd920-942a-11e7-9f07-bdb739050338.png" alt="no constraints no bounds" style="max-width: 100%;"></a></p> <p dir="auto"><strong>Bounds only (red):</strong></p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/58611/30195873-8e8e249e-942a-11e7-96ff-98a7dd4eb0a8.png"><img src="https://user-images.githubusercontent.com/58611/30195873-8e8e249e-942a-11e7-96ff-98a7dd4eb0a8.png" alt="bounds yes constraints no" style="max-width: 100%;"></a></p> <p dir="auto"><strong>Constraints only (blue):</strong></p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/58611/30195885-9c88b640-942a-11e7-98a1-1025b4002afa.png"><img src="https://user-images.githubusercontent.com/58611/30195885-9c88b640-942a-11e7-98a1-1025b4002afa.png" alt="constraints yes bounds no" style="max-width: 100%;"></a></p> <p dir="auto"><strong>Bounds (red) and constraints (blue):</strong></p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/58611/30195899-b4a16498-942a-11e7-8cdf-e8b16da3dcaa.png"><img src="https://user-images.githubusercontent.com/58611/30195899-b4a16498-942a-11e7-8cdf-e8b16da3dcaa.png" alt="bounds yes constraints yes" style="max-width: 100%;"></a></p> <p dir="auto">It finds lots of incorrect minima, many of which violate the bounds or the constraints or both.</p> <p dir="auto">I think these are using different minimizers, though. The "both" case seems to be slsqp.</p> <h3 dir="auto">Reproducing code example:</h3> <p dir="auto">Code for above: <a href="https://gist.github.com/endolith/6f89b1cb0baa98688a5bc49e590ce196">https://gist.github.com/endolith/6f89b1cb0baa98688a5bc49e590ce196</a></p> <h3 dir="auto">Scipy/Numpy/Python version information:</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="0.19.0 1.13.1 sys.version_info(major=3, minor=6, micro=1, releaselevel='final', serial=0)"><pre class="notranslate"><code class="notranslate">0.19.0 1.13.1 sys.version_info(major=3, minor=6, micro=1, releaselevel='final', serial=0) </code></pre></div>
<p dir="auto"><code class="notranslate">scipy.optimize.basinhopping</code> fails when constraints are specified, returning a result that violates the constraints, even though the minimizer can easily find the solution that fits the constraints.</p> <h3 dir="auto">Reproducing code example:</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np import matplotlib.pyplot as plt from scipy import optimize def func(x): return (x**2-8)**2+(x+2)**2 x0 = -4 x = np.linspace(-5, 5, 10000) plt.plot(x, func(x)) plt.plot(x0, func(x0), 'x') # Constrain to func value &gt;= 50 limit = 50 cons = ({'type': 'ineq', 'fun': lambda x: func(x) - limit},) plt.axhspan(limit, np.amax(func(x)), alpha=0.1) # This returns an invalid result result_bh = optimize.basinhopping(func, x0, disp=True, minimizer_kwargs={'constraints': cons}) plt.plot(result_bh['x'], result_bh['fun'], 'ro') print(result_bh) print('---------------------------------') # This finds the correct result easily result_min = optimize.minimize(func, x0, constraints=cons) plt.plot(result_min['x'], result_min['fun'], 'go') print(result_min)"><pre class="notranslate"><code class="notranslate">import numpy as np import matplotlib.pyplot as plt from scipy import optimize def func(x): return (x**2-8)**2+(x+2)**2 x0 = -4 x = np.linspace(-5, 5, 10000) plt.plot(x, func(x)) plt.plot(x0, func(x0), 'x') # Constrain to func value &gt;= 50 limit = 50 cons = ({'type': 'ineq', 'fun': lambda x: func(x) - limit},) plt.axhspan(limit, np.amax(func(x)), alpha=0.1) # This returns an invalid result result_bh = optimize.basinhopping(func, x0, disp=True, minimizer_kwargs={'constraints': cons}) plt.plot(result_bh['x'], result_bh['fun'], 'ro') print(result_bh) print('---------------------------------') # This finds the correct result easily result_min = optimize.minimize(func, x0, constraints=cons) plt.plot(result_min['x'], result_min['fun'], 'go') print(result_min) </code></pre></div> <h3 dir="auto">Results:</h3> <p dir="auto"><code class="notranslate">scipy.optimize.basinhopping</code> (red dot at -3.816, 46.353306367220874):</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" fun: 46.353306367220874 lowest_optimization_result: fun: 46.353306367220874 jac: array([-103.789]) message: 'Positive directional derivative for linesearch' nfev: 113 nit: 28 njev: 24 status: 8 success: False x: array([-3.816]) message: ['requested number of basinhopping iterations completed successfully'] minimization_failures: 49 nfev: 7064 nit: 100 njev: 1444 x: array([-3.816])"><pre class="notranslate"><code class="notranslate"> fun: 46.353306367220874 lowest_optimization_result: fun: 46.353306367220874 jac: array([-103.789]) message: 'Positive directional derivative for linesearch' nfev: 113 nit: 28 njev: 24 status: 8 success: False x: array([-3.816]) message: ['requested number of basinhopping iterations completed successfully'] minimization_failures: 49 nfev: 7064 nit: 100 njev: 1444 x: array([-3.816]) </code></pre></div> <p dir="auto"><code class="notranslate">scipy.optimize.minimize</code> (green dot at -3.85, 49.99991873706809):</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" fun: 49.99991873706809 jac: array([-108.809]) message: 'Optimization terminated successfully.' nfev: 28 nit: 10 njev: 6 status: 0 success: True x: array([-3.85])"><pre class="notranslate"><code class="notranslate"> fun: 49.99991873706809 jac: array([-108.809]) message: 'Optimization terminated successfully.' nfev: 28 nit: 10 njev: 6 status: 0 success: True x: array([-3.85]) </code></pre></div> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/58611/29752116-0586cc8a-8b26-11e7-97bb-94cf9ad44b4b.png"><img src="https://user-images.githubusercontent.com/58611/29752116-0586cc8a-8b26-11e7-97bb-94cf9ad44b4b.png" alt="green good red bad" style="max-width: 100%;"></a></p> <h3 dir="auto">Scipy/Numpy/Python version information:</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="0.19.0 1.13.1 sys.version_info(major=3, minor=6, micro=1, releaselevel='final', serial=0)"><pre class="notranslate"><code class="notranslate">0.19.0 1.13.1 sys.version_info(major=3, minor=6, micro=1, releaselevel='final', serial=0) </code></pre></div>
1
<h1 dir="auto">Brief Summary</h1> <p dir="auto">Celery 5.x is going to support Python 3.x only, and it might be appropriate to drop billiard and use multiprocessing from python 3 directly, as billiard is fork of multiprocessing module. It would a lot less code to maintain.</p>
<p dir="auto"><a href="https://github.com/erdewit/distex">distex</a> is a completely asynchronous process pool.<br> Given that Celery 5.0 will use the asyncio event loop as a core component an asynchronous process pool is crucial for us if the project were to succeed.</p>
1
<p dir="auto"><a href="https://github.com/twbs/bootstrap/blob/master/js/dropdown.js#L104">The code in question</a></p> <p dir="auto">If here is no attr('data-target'), it tries to get selector from href. which caused warning in firefox 23:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Empty string can't be argument for getElementById();"><pre class="notranslate"><code class="notranslate">Empty string can't be argument for getElementById(); </code></pre></div> <p dir="auto">because some elements that function is fired for have href="#" .</p> <p dir="auto">I think it should be correct to make the check like following:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="selector=!/^[\.#:]$/.test(selector) &amp;&amp; selector"><pre class="notranslate"><code class="notranslate">selector=!/^[\.#:]$/.test(selector) &amp;&amp; selector </code></pre></div> <p dir="auto"><em>also I wonder why it still uses <code class="notranslate">attr('data-target')</code> instead of <code class="notranslate">data('target')</code> ?</em></p>
<p dir="auto">I am Using Firefox 22.</p> <p dir="auto">Reproduce:</p> <ul dir="auto"> <li>Open <a href="http://getbootstrap.com/components/" rel="nofollow">http://getbootstrap.com/components/</a></li> <li>The error is visible in the console when clicking anywhere in the page but a dropdown menu.</li> </ul> <p dir="auto">I could track down the error to the <code class="notranslate">clearMenus</code> call, which in turn calls <code class="notranslate">getParents</code> where the error finally happens.</p> <p dir="auto">In <code class="notranslate">getParents</code> the <code class="notranslate">selector</code> variable is set to <code class="notranslate">'#'</code>. This character is stripped away inside jQuery.</p>
1
<p dir="auto">As pointed out by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dsm054/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dsm054">@dsm054</a>, there are multiple lurking split/partition API requests. Here are the issues and a short summary of what they would do (there are some duplicates here, I've checked off those issues/PRs that have been closed in favor of a related issue):</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2344651" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/414" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/414/hovercard" href="https://github.com/pandas-dev/pandas/issues/414">#414</a>: (i think) original issue for these ideas going back 3 years</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3702724" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/936" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/936/hovercard" href="https://github.com/pandas-dev/pandas/issues/936">#936</a>: windowing with time-length windows like <code class="notranslate">pd.rolling_mean(ts, window='30min')</code> and possibly even arbitrary windows using another column</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="12096079" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/3066" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/3066/hovercard" href="https://github.com/pandas-dev/pandas/issues/3066">#3066</a>: <code class="notranslate">split</code> method on pandas objects, playing around with ideas</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="12208965" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/3101" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/3101/hovercard" href="https://github.com/pandas-dev/pandas/pull/3101">#3101</a>: a closed PR by <a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/y-p/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/y-p">@y-p</a> to use the args of lambda to group a frame into views of a sliding window</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="14636052" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/3685" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/3685/hovercard" href="https://github.com/pandas-dev/pandas/issues/3685">#3685</a>: resampling using the first <code class="notranslate">n</code> samples of a bin.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="16097994" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/4059" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/4059/hovercard" href="https://github.com/pandas-dev/pandas/issues/4059">#4059</a>: <code class="notranslate">np.array_split</code> style API where you can split a pandas object into a list of <code class="notranslate">k</code> groups of possibly unequal size (could be a thin wrapper around <code class="notranslate">np.array_split</code>, or more integrated into the pandas DSL). IMO, this issue provides the best starting point for an API. <a href="http://stackoverflow.com/questions/24461906/how-can-i-divide-up-a-pandas-dataframe/24462529#24462529" rel="nofollow">SO usage</a></li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="22468657" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/5494" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/5494/hovercard" href="https://github.com/pandas-dev/pandas/issues/5494">#5494</a>: an API for to allow pandas' <code class="notranslate">groupby</code> to have <code class="notranslate">itertools.groupby</code> semantics (i.e., preserve the order of duplicated group keys), i.e., <code class="notranslate">'aabbaa'</code> would yield groups <code class="notranslate">['aa', 'bb', 'aa']</code> rather than <code class="notranslate">['aaaa', 'bb']</code>. There'd have to be some changes to the use of <code class="notranslate">dict</code> in the groupby backend as noted by <a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/y-p/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/y-p">@y-p</a> here <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="16097994" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/4059" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/4059/hovercard?comment_id=29061036&amp;comment_type=issue_comment" href="https://github.com/pandas-dev/pandas/issues/4059#issuecomment-29061036">#4059 (comment)</a>.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="29855601" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/6675" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/6675/hovercard" href="https://github.com/pandas-dev/pandas/issues/6675">#6675</a>: Ability to select ranged groups via another column, like "select all rows between the values X and Y from column C", e.g., an "events" column where you have a start and end markers and you want to get the data in between the markers. There are a couple of ways you can do this, but it would be nice to have an API for this. This is very similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3702724" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/936" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/936/hovercard" href="https://github.com/pandas-dev/pandas/issues/936">#936</a>.</li> </ul> <p dir="auto">The <a href="https://github.com/pytoolz/toolz"><code class="notranslate">toolz</code></a> library has a <code class="notranslate">partitionby</code> function that provides a nice way to do some of the splitting on sequences and might provide us with some insight on how to approach the API.</p> <p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jreback/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jreback">@jreback</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jorisvandenbossche/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jorisvandenbossche">@jorisvandenbossche</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/hayd/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/hayd">@hayd</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/danielballan/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/danielballan">@danielballan</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="cols = ['15:00:00', '15:01:00', '15:02:00', '15:02:30'] cols_td = pd.to_timedelta(cols) df = pd.DataFrame(0, index=range(4), columns=cols_td) vw1 = df.loc[:, :cols[-2]] vw2 = df.loc[:, :cols_td[-2]] print(vw1) print(vw2) print('Statement below must be equal') print(vw1.equals(vw2))"><pre class="notranslate"><span class="pl-s1">cols</span> <span class="pl-c1">=</span> [<span class="pl-s">'15:00:00'</span>, <span class="pl-s">'15:01:00'</span>, <span class="pl-s">'15:02:00'</span>, <span class="pl-s">'15:02:30'</span>] <span class="pl-s1">cols_td</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">to_timedelta</span>(<span class="pl-s1">cols</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-c1">0</span>, <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-en">range</span>(<span class="pl-c1">4</span>), <span class="pl-s1">columns</span><span class="pl-c1">=</span><span class="pl-s1">cols_td</span>) <span class="pl-s1">vw1</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-s1">loc</span>[:, :<span class="pl-s1">cols</span>[<span class="pl-c1">-</span><span class="pl-c1">2</span>]] <span class="pl-s1">vw2</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-s1">loc</span>[:, :<span class="pl-s1">cols_td</span>[<span class="pl-c1">-</span><span class="pl-c1">2</span>]] <span class="pl-en">print</span>(<span class="pl-s1">vw1</span>) <span class="pl-en">print</span>(<span class="pl-s1">vw2</span>) <span class="pl-en">print</span>(<span class="pl-s">'Statement below must be equal'</span>) <span class="pl-en">print</span>(<span class="pl-s1">vw1</span>.<span class="pl-en">equals</span>(<span class="pl-s1">vw2</span>))</pre></div> <h4 dir="auto">Problem description</h4> <p dir="auto">vw1 is wrong. vw2 is correct<br> Slicing TimdeltaIndex DataFrame with string doesn't seem to work. It doesn't take into account seconds</p> <h4 dir="auto">Expected Output</h4> <p dir="auto">Both views must be equal</p> <h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4> <details> <h2 dir="auto">INSTALLED VERSIONS</h2> <p dir="auto">commit: None<br> python: 3.6.3.final.0<br> python-bits: 64<br> OS: Windows<br> OS-release: 10<br> machine: AMD64<br> processor: Intel64 Family 6 Model 79 Stepping 1, GenuineIntel<br> byteorder: little<br> LC_ALL: None<br> LANG: None<br> LOCALE: None.None</p> <p dir="auto">pandas: 0.20.3<br> pytest: 3.2.1<br> pip: 9.0.1<br> setuptools: 36.5.0.post20170921<br> Cython: 0.26.1<br> numpy: 1.13.3<br> scipy: 0.19.1<br> xarray: None<br> IPython: 6.1.0<br> sphinx: 1.6.3<br> patsy: 0.4.1<br> dateutil: 2.6.1<br> pytz: 2017.2<br> blosc: None<br> bottleneck: 1.2.1<br> tables: 3.4.2<br> numexpr: 2.6.2<br> feather: None<br> matplotlib: 2.1.0<br> openpyxl: 2.4.8<br> xlrd: 1.1.0<br> xlwt: 1.3.0<br> xlsxwriter: 1.0.2<br> lxml: 4.1.0<br> bs4: 4.6.0<br> html5lib: 0.999999999<br> sqlalchemy: 1.1.13<br> pymysql: None<br> psycopg2: None<br> jinja2: 2.9.6<br> s3fs: None<br> pandas_gbq: None<br> pandas_datareader: None</p> </details>
0
<p dir="auto">Hi,</p> <p dir="auto">When adding new functions to object prototype, <code class="notranslate">this</code> could be hard-typed in below scenario:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface Array&lt;T&gt; { first(): T; } Array.prototype.first = function() { return this.length &gt; 0 ? this[0] : undefined; }"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">Array</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-c1">first</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">T</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-smi">Array</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-en">first</span> <span class="pl-c1">=</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-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span> ? <span class="pl-smi">this</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> : <span class="pl-c1">undefined</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <p dir="auto"><code class="notranslate">this</code> is of type <code class="notranslate">any</code>, why it can't be of type <code class="notranslate">Array</code> ?</p> <p dir="auto">typescript: 1.8.30</p>
<p dir="auto"><strong>TypeScript Version:</strong></p> <p dir="auto">1.8.9</p> <p dir="auto"><strong>Code</strong></p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export class Configuration { private storage: string; constructor() { this.storage = &quot;InMemoryStorageProvider()&quot;; } public useLocalStorage(): void { // This method will be injected via the prototype. } }"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">Configuration</span> <span class="pl-kos">{</span> <span class="pl-k">private</span> <span class="pl-c1">storage</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span> <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">storage</span> <span class="pl-c1">=</span> <span class="pl-s">"InMemoryStorageProvider()"</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">public</span> <span class="pl-en">useLocalStorage</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi"><span class="pl-k">void</span></span> <span class="pl-kos">{</span> <span class="pl-c">// This method will be injected via the prototype.</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { Configuration } from './classes/Configuration'; Configuration.prototype.useLocalStorage = function() { this.storage = &quot;NodeFileStorageProvider&quot; };"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">Configuration</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'./classes/Configuration'</span><span class="pl-kos">;</span> <span class="pl-smi">Configuration</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-en">useLocalStorage</span> <span class="pl-c1">=</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-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">storage</span> <span class="pl-c1">=</span> <span class="pl-s">"NodeFileStorageProvider"</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <p dir="auto"><strong>Expected behavior:</strong></p> <p dir="auto">When walking the AST I use:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="let identifier: ts.Identifier = &lt;ts.Identifier&gt;node; let identifierSymbol: ts.Symbol = this.checker.getSymbolAtLocation( identifier );"><pre class="notranslate"><code class="notranslate">let identifier: ts.Identifier = &lt;ts.Identifier&gt;node; let identifierSymbol: ts.Symbol = this.checker.getSymbolAtLocation( identifier ); </code></pre></div> <p dir="auto">to obtain the identifier and its possible associated symbol when the node is SyntaxKind.Identifier.</p> <p dir="auto">for the first 2 references to the private property <code class="notranslate">storage</code>, I obtain the identifier and the symbol (which correctly have the same <code class="notranslate">Id</code>). With the prototype function assigned to useLocalStorage the reference to <code class="notranslate">storage</code> the call to <code class="notranslate">this.checker.getSymbolAtLocation( identifier )</code> does not return a symbol.</p> <p dir="auto"><strong>Actual behavior:</strong></p> <p dir="auto">I am using the AST to identify identifiers which may be minified/shortened. The 1st and 2nd reference to <code class="notranslate">storage</code> gets shortened as it is a private property.</p> <p dir="auto">My expectation was that the reference to <code class="notranslate">storage</code> would have the same symbol ( not undefined ) as the other references to the <code class="notranslate">storage</code> property.</p>
1
<p dir="auto">Was it possible? App Engine and AWS Lambda?</p>
<p dir="auto">Is it possible to deploy a next.js web app to AWS Lambda &amp; API Gateway? (using <a href="https://github.com/claudiajs/claudia">claudia</a> for example)</p>
1
<p dir="auto">Hi,<br> my task is: <code class="notranslate">make the first run of X as fast as the second run</code>.<br> It seems quite difficult to achieve.<br> The situation is, that I'm covering all code I want to execute (over runtests.jl), so in theory it should be straight forward to infer what to compile.</p> <p dir="auto">What I've tried:</p> <ol dir="auto"> <li>Including runtests.jl into user image</li> <li><a href="https://github.com/timholy/SnoopCompile.jl">SnoopCompile</a> + user image</li> </ol> <div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use SnoopCompile to generate snoop_precompiles.jl from runtests.jl ---- MyPackage.jl module MyPackage include(&quot;snoop_precompiles.jl&quot;) end ---- userimg.jl using MyPacke ----"><pre class="notranslate">use SnoopCompile to generate snoop_precompiles<span class="pl-k">.</span>jl from runtests<span class="pl-k">.</span>jl <span class="pl-k">----</span> MyPackage<span class="pl-k">.</span>jl <span class="pl-k">module</span> MyPackage <span class="pl-c1">include</span>(<span class="pl-s"><span class="pl-pds">"</span>snoop_precompiles.jl<span class="pl-pds">"</span></span>) <span class="pl-k">end</span> <span class="pl-k">----</span> userimg<span class="pl-k">.</span>jl <span class="pl-k">using</span> MyPacke <span class="pl-k">----</span></pre></div> <ol start="3" dir="auto"> <li><a href="https://github.com/dhoegh/BuildExecutable.jl">BuildExecutable</a></li> </ol> <p dir="auto">Results:</p> <ol dir="auto"> <li>I have had good results with this approach, but it doesn't work for arbitrary code. Would it be worth while to trim the included code to work? I had various failures, and as soon as OpenGL comes into the game, things were not working at all anymore</li> <li>This sometimes generates a compilation speed up, sometimes not... Sometimes it changes type inference resulting in weird errors. Is this SnoopCompiles fault, or to be expected? Would fixing SnoopCompile be well invested time?</li> <li>The compiled executable actually executes slower than <code class="notranslate">julia executable_script.jl</code>, suggesting that this just links the exe to the JIT, while not caching any binary. I guess I still need precompile statements and it doesn't recursively infer from <code class="notranslate">main()</code> what to compile?</li> </ol> <p dir="auto">My dream workflow is something like this:</p> <div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# this could be executed by Pkg.build() -&gt; &gt;julia --cache-binary --output-incremental=yes GLVisualize/test/runtests.jl --&gt; v0.5/lib/cache_x.so julia&gt; using GLVisualize; &lt;-- all functions already run in runtests will need no JIT &gt;generate_py_wrapper v0.5/lib/cache_x.so GLVisualize/src/GLVisualize.jl --&gt; generates py c interop thingies to call the lib... Hehehe"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> this could be executed by Pkg.build() -&gt;</span> <span class="pl-k">&gt;</span>julia <span class="pl-k">--</span>cache<span class="pl-k">-</span>binary <span class="pl-k">--</span>output<span class="pl-k">-</span>incremental<span class="pl-k">=</span>yes GLVisualize<span class="pl-k">/</span>test<span class="pl-k">/</span>runtests<span class="pl-k">.</span>jl <span class="pl-k">--&gt;</span> v0.<span class="pl-c1">5</span><span class="pl-k">/</span>lib<span class="pl-k">/</span>cache_x<span class="pl-k">.</span>so julia<span class="pl-k">&gt;</span> <span class="pl-k">using</span> GLVisualize; <span class="pl-k">&lt;-</span><span class="pl-k">-</span> all functions already run <span class="pl-k">in</span> runtests will need no JIT <span class="pl-k">&gt;</span>generate_py_wrapper v0.<span class="pl-c1">5</span><span class="pl-k">/</span>lib<span class="pl-k">/</span>cache_x<span class="pl-k">.</span>so GLVisualize<span class="pl-k">/</span>src<span class="pl-k">/</span>GLVisualize<span class="pl-k">.</span>jl <span class="pl-k">--&gt;</span> generates py c interop thingies to call the lib<span class="pl-k">...</span> Hehehe</pre></div> <p dir="auto">Btw, would generating a seperate .so + ccall solve the (quite annoying) problem, that we always need to interact with the sysimg?</p> <p dir="auto">I'd be quite willing to work on this in some way.<br> I just need to know where to start :)</p>
<p dir="auto">At this point it makes sense to separate <code class="notranslate">julia</code> into an interactive <code class="notranslate">julia</code> which runs scripts and starts the REPL and <code class="notranslate">julia-compile</code> which provides various bootstrapping and compilation features. The basic usage of <code class="notranslate">julia-compile</code> should be <code class="notranslate">julia-compile program.jl</code> which should produce an executable called <code class="notranslate">program</code> which, when run behaves the same way that <code class="notranslate">julia program.jl</code> would. In more advanced modes, it can behave like the current <code class="notranslate">julia --compile=all</code>, etc. Let's use this issue to discuss the desired API and how to split up the options.</p>
1
<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>OS Platform and Distribution (e.g., Linux Ubuntu 16.04): mac OS Mojave</li> <li>TensorFlow installed from (source or binary): pip</li> <li>TensorFlow version (use command below): 2.0.0 alpha-0</li> <li>Python version: 3.7.2</li> </ul> <p dir="auto"><strong>Describe the current behavior</strong><br> When using Python internal "logging" module with Tensorflow, a logging module emits below warning message.</p> <blockquote> <p dir="auto">WARNING: Logging before flag parsing goes to stderr.</p> </blockquote> <p dir="auto">Also, it prints out duplicate logging message with my own formatter and something internally defined format(I guess) as below.</p> <blockquote> <p dir="auto">$ python3 test.py<br> [INFO|test.py:29] 2019-03-14 17:30:14,402 &gt;&gt; Hello World.<br> WARNING: Logging before flag parsing goes to stderr.<br> I0314 17:30:14.402168 4528047552 test.py:29] Hello World.<br> [INFO|test.py:30] 2019-03-14 17:30:14,402 &gt;&gt; This is message 1<br> I0314 17:30:14.402369 4528047552 test.py:30] This is message 1</p> </blockquote> <p dir="auto">When I try without importing Tensorflow, then it works properly.</p> <blockquote> <p dir="auto">$ python3 test.py<br> [INFO|test.py:29] 2019-03-14 17:37:40,172 &gt;&gt; Hello World.<br> [INFO|test.py:30] 2019-03-14 17:37:40,172 &gt;&gt; This is message 1</p> </blockquote> <p dir="auto"><strong>Describe the expected behavior</strong><br> Maybe stream handler is colliding each other.</p> <p dir="auto"><strong>Code to reproduce the issue</strong></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import logging import tensorflow as tf formatter = logging.Formatter('[%(levelname)s|%(filename)s:%(lineno)s] %(asctime)s &gt;&gt; %(message)s') stream_logger = logging.getLogger('logger_stream') stream_logger.setLevel(logging.INFO) # Set handler streamHandler = logging.StreamHandler() streamHandler.setFormatter(formatter) stream_logger.addHandler(streamHandler) stream_logger.info(&quot;Hello World&quot;) stream_logger.info(&quot;This is message 1&quot;)"><pre class="notranslate"><code class="notranslate">import logging import tensorflow as tf formatter = logging.Formatter('[%(levelname)s|%(filename)s:%(lineno)s] %(asctime)s &gt;&gt; %(message)s') stream_logger = logging.getLogger('logger_stream') stream_logger.setLevel(logging.INFO) # Set handler streamHandler = logging.StreamHandler() streamHandler.setFormatter(formatter) stream_logger.addHandler(streamHandler) stream_logger.info("Hello World") stream_logger.info("This is message 1") </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, I have created two CNN models</li> <li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: Linux Ubuntu 16.04</li> <li><strong>TensorFlow installed from (source or binary)</strong>: I installed tensorflow via pip install (Python 3)</li> <li><strong>TensorFlow version (use command below)</strong>: 1.4.0</li> <li><strong>Python version</strong>: 3</li> <li><strong>Bazel version (if compiling from source)</strong>:</li> <li><strong>GCC/Compiler version (if compiling from source)</strong>:</li> <li><strong>CUDA/cuDNN version</strong>: 8.0/6</li> <li><strong>GPU model and memory</strong>: NVIDIA Tesla k80 totalMemory: 11.17GiB freeMemory: 11.09GiB</li> <li><strong>Exact command to reproduce</strong>: See below:</li> </ul> <h3 dir="auto">Below is the log:</h3> <blockquote> <p dir="auto">keep_dims is deprecated, use keepdims instead</p> <hr> <h1 dir="auto">Layer (type) Output Shape Param #</h1> <p dir="auto">input_1 (InputLayer) (None, 7, 264) 0</p> <hr> <p dir="auto">reshape_1 (Reshape) (None, 7, 264, 1) 0</p> <hr> <p dir="auto">conv2d_1 (Conv2D) (None, 7, 264, 64) 16960</p> <hr> <p dir="auto">max_pooling2d_1 (MaxPooling2 (None, 7, 132, 64) 0</p> <hr> <p dir="auto">flatten_1 (Flatten) (None, 59136) 0</p> <hr> <p dir="auto">dense_1 (Dense) (None, 1024) 60556288</p> <hr> <p dir="auto">dropout_1 (Dropout) (None, 1024) 0</p> <hr> <p dir="auto">dense_2 (Dense) (None, 512) 524800</p> <hr> <p dir="auto">dropout_2 (Dropout) (None, 512) 0</p> <hr> <h1 dir="auto">dense_3 (Dense) (None, 88) 45144</h1> <p dir="auto">Total params: 61,143,192<br> Trainable params: 61,143,192<br> Non-trainable params: 0</p> <hr> <p dir="auto">/home/hpnhxxwn/miniconda3/envs/carnd-term1/lib/python3.5/site-packages/keras/engine/training.py:2057: UserWarning: Using a generator with <code class="notranslate">use_multiprocessing=True</code> and multiple worker<br> s may duplicate your data. Please consider using the<code class="notranslate">keras.utils.Sequence class. UserWarning('Using a generator with </code>use_multiprocessing=True`'<br> ld: learning rate is now 0.01<br> 2017-11-29 04:58:20.964015: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX A<br> VX2 FMA<br> 2017-11-29 04:58:21.094051: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:900] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUM<br> A node, so returning NUMA node zero<br> 2017-11-29 04:58:21.094719: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1062] Found device 0 with properties:<br> name: Tesla K80 major: 3 minor: 7 memoryClockRate(GHz): 0.8235<br> pciBusID: 0000:00:04.0<br> totalMemory: 11.17GiB freeMemory: 11.09GiB<br> 2017-11-29 04:58:21.094744: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1152] Creating TensorFlow device (/device:GPU:0) -&gt; (device: 0, name: Tesla K80, pci bus id: 0000:00:04.0<br> , compute capability: 3.7)<br> Epoch 1/1000<br> 5180/6944 [=====================&gt;........] - ETA: 3:43 - loss: 0.1382 - acc: 0.9637 - mean_absolute_error: 0.0715 - sparse_categorical_accuracy: 7.1640e-05switching to ['AkPnStgb']<br> 5212/6944 [=====================&gt;........] - ETA: 3:39 - loss: 0.1384 - acc: 0.9636 - mean_absolute_error: 0.0715 - sparse_categorical_accuracy: 7.1200e-052017-11-29 05:09:22.210897: F<br> tensorflow/stream_executor/cuda/cuda_dnn.cc:444] could not convert BatchDescriptor {count: 0 feature_map_count: 64 spatial: 7 264 value_min: 0.000000 value_max: 0.000000 layout: Batc<br> hDepthYX} to cudnn tensor descriptor: CUDNN_STATUS_BAD_PARAM</p> </blockquote> <h3 dir="auto">Below is the model.</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def baseline_model(): inputs = Input(shape=input_shape) reshape = Reshape(input_shape_channels)(inputs) #normal convnet layer (have to do one initially to get 64 channels) conv1 = Conv2D(50,(5,25),activation='tanh')(reshape) do1 = Dropout(0.5)(conv1) pool1 = MaxPooling2D(pool_size=(1,3))(do1) conv2 = Conv2D(50,(3,5),activation='tanh')(pool1) do2 = Dropout(0.5)(conv2) pool2 = MaxPooling2D(pool_size=(1,3))(do2) flattened = Flatten()(pool2) fc1 = Dense(1000, activation='sigmoid')(flattened) do3 = Dropout(0.5)(fc1) fc2 = Dense(200, activation='sigmoid')(do3) do4 = Dropout(0.5)(fc2) outputs = Dense(note_range, activation='sigmoid')(do4) model = Model(inputs=inputs, outputs=outputs) return model"><pre class="notranslate"><code class="notranslate">def baseline_model(): inputs = Input(shape=input_shape) reshape = Reshape(input_shape_channels)(inputs) #normal convnet layer (have to do one initially to get 64 channels) conv1 = Conv2D(50,(5,25),activation='tanh')(reshape) do1 = Dropout(0.5)(conv1) pool1 = MaxPooling2D(pool_size=(1,3))(do1) conv2 = Conv2D(50,(3,5),activation='tanh')(pool1) do2 = Dropout(0.5)(conv2) pool2 = MaxPooling2D(pool_size=(1,3))(do2) flattened = Flatten()(pool2) fc1 = Dense(1000, activation='sigmoid')(flattened) do3 = Dropout(0.5)(fc1) fc2 = Dense(200, activation='sigmoid')(do3) do4 = Dropout(0.5)(fc2) outputs = Dense(note_range, activation='sigmoid')(do4) model = Model(inputs=inputs, outputs=outputs) return model </code></pre></div> <p dir="auto">I have found other github issue created for the same issue, not so far seems like there is no fix yet. I heard the workaround is to use tf.cond, can someone show me how to use it in such case.</p>
0
<p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/change-the-color-of-text#?solution=%3Ch2%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%3Ch2%20style%3D%22color%3A%20red%22%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%3Cp%3EKitty%20ipsum%20dolor%20sit%20amet%2C%20shed%20everywhere%20shed%20everywhere%20stretching%20attack%20your%20ankles%20chase%20the%20red%20dot%2C%20hairball%20run%20catnip%20eat%20the%20grass%20sniff.%3C%2Fp%3E%0A" rel="nofollow">Change the Color of Text</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/48.0.2564.109 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="&lt;h2&gt;CatPhotoApp&lt;/h2&gt; &lt;h2 style=&quot;color: red&quot;&gt;CatPhotoApp&lt;/h2&gt; &lt;p&gt;Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.&lt;/p&gt; "><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">h2</span><span class="pl-kos">&gt;</span>CatPhotoApp<span class="pl-kos">&lt;/</span><span class="pl-ent">h2</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">h2</span> <span class="pl-c1">style</span>="<span class="pl-s">color: red</span>"<span class="pl-kos">&gt;</span>CatPhotoApp<span class="pl-kos">&lt;/</span><span class="pl-ent">h2</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">p</span><span class="pl-kos">&gt;</span>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.<span class="pl-kos">&lt;/</span><span class="pl-ent">p</span><span class="pl-kos">&gt;</span></pre></div>
<p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/change-the-color-of-text#?solution=%3Ch2%3ECatPhotoApp%3C%2Fh2%3E%0A%3Ch2%20style%3D%22color%3A%20red%22%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%3Cp%3EKitty%20ipsum%20dolor%20sit%20amet%2C%20shed%20everywhere%20shed%20everywhere%20stretching%20attack%20your%20ankles%20chase%20the%20red%20dot%2C%20hairball%20run%20catnip%20eat%20the%20grass%20sniff.%3C%2Fp%3E%0A" rel="nofollow">Change the Color of Text</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/48.0.2564.109 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="&lt;h2&gt;CatPhotoApp&lt;/h2&gt; &lt;h2 style=&quot;color: red&quot;&gt;CatPhotoApp&lt;/h2&gt; &lt;p&gt;Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.&lt;/p&gt; "><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">h2</span><span class="pl-kos">&gt;</span>CatPhotoApp<span class="pl-kos">&lt;/</span><span class="pl-ent">h2</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">h2</span> <span class="pl-c1">style</span>="<span class="pl-s">color: red</span>"<span class="pl-kos">&gt;</span>CatPhotoApp<span class="pl-kos">&lt;/</span><span class="pl-ent">h2</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">p</span><span class="pl-kos">&gt;</span>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.<span class="pl-kos">&lt;/</span><span class="pl-ent">p</span><span class="pl-kos">&gt;</span></pre></div>
1
<p dir="auto">The following code:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="subroutine s(n, a) integer :: n, a(1:2**n) end"><pre class="notranslate"><code class="notranslate">subroutine s(n, a) integer :: n, a(1:2**n) end </code></pre></div> <p dir="auto">causes f2py to crash with:</p> <blockquote> <p dir="auto">/tmp/tmprxk_Ew/src.linux-x86_64-2.7/f2py_bugmodule.c: In function ‘f2py_rout_f2py_bug_s’:<br> /tmp/tmprxk_Ew/src.linux-x86_64-2.7/f2py_bugmodule.c:217:15: error: invalid type argument of unary ‘<em>’ (have ‘int’)<br> a_Dims[0]=2</em>*n;<br> ^</p> </blockquote> <p dir="auto">Original report: <a href="http://stackoverflow.com/questions/35156750/f2py-invalid-type-argument-of-unary" rel="nofollow">http://stackoverflow.com/questions/35156750/f2py-invalid-type-argument-of-unary</a></p> <p dir="auto">Full output:</p> <blockquote> <blockquote> <p dir="auto">f2py -c f2py_bug.f90 -m f2py_bug<br> running build<br> running config_cc<br> unifing config_cc, config, build_clib, build_ext, build commands --compiler options<br> running config_fc<br> unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options<br> running build_src<br> build_src<br> building extension "f2py_bug" sources<br> f2py options: []<br> f2py:&gt; /tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.c<br> creating /tmp/tmplNikU7/src.linux-x86_64-2.7<br> Reading fortran codes...<br> Reading file 'f2py_bug.f90' (format:free)<br> Post-processing...<br> Block: f2py_bug<br> Block: s<br> Post-processing (stage 2)...<br> Building modules...<br> Building module "f2py_bug"...<br> Constructing wrapper function "s"...<br> s(n,a)<br> Wrote C/API module "f2py_bug" to file "/tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.c"<br> adding '/tmp/tmplNikU7/src.linux-x86_64-2.7/fortranobject.c' to sources.<br> adding '/tmp/tmplNikU7/src.linux-x86_64-2.7' to include_dirs.<br> copying /usr/lib64/python2.7/site-packages/numpy/f2py/src/fortranobject.c -&gt; /tmp/tmplNikU7/src.linux-x86_64-2.7<br> copying /usr/lib64/python2.7/site-packages/numpy/f2py/src/fortranobject.h -&gt; /tmp/tmplNikU7/src.linux-x86_64-2.7<br> build_src: building npy-pkg config files<br> running build_ext<br> customize UnixCCompiler<br> customize UnixCCompiler using build_ext<br> customize Gnu95FCompiler<br> Found executable /usr/bin/gfortran<br> customize Gnu95FCompiler<br> customize Gnu95FCompiler using build_ext<br> building 'f2py_bug' extension<br> compiling C sources<br> C compiler: gcc -pthread -fno-strict-aliasing -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DNDEBUG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -fPIC</p> </blockquote> <p dir="auto">creating /tmp/tmplNikU7/tmp<br> creating /tmp/tmplNikU7/tmp/tmplNikU7<br> creating /tmp/tmplNikU7/tmp/tmplNikU7/src.linux-x86_64-2.7<br> compile options: '-I/tmp/tmplNikU7/src.linux-x86_64-2.7 -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c'<br> gcc: /tmp/tmplNikU7/src.linux-x86_64-2.7/fortranobject.c<br> In file included from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1781:0,<br> from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,<br> from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,<br> from /tmp/tmplNikU7/src.linux-x86_64-2.7/fortranobject.h:13,<br> from /tmp/tmplNikU7/src.linux-x86_64-2.7/fortranobject.c:2:<br> /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]<br> #warning "Using deprecated NumPy API, disable it by " <br> ^<br> gcc: /tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.c<br> In file included from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1781:0,<br> from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,<br> from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,<br> from /tmp/tmplNikU7/src.linux-x86_64-2.7/fortranobject.h:13,<br> from /tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.c:19:<br> /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]<br> #warning "Using deprecated NumPy API, disable it by " <br> ^<br> /tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.c: In function ‘f2py_rout_f2py_bug_s’:<br> /tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.c:217:15: error: invalid type argument of unary ‘<em>’ (have ‘int’)<br> a_Dims[0]=2__n;<br> ^<br> /tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.c: At top level:<br> /tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.c:105:12: warning: ‘f2py_size’ defined but not used [-Wunused-function]<br> static int f2py_size(PyArrayObject</em> var, ...)<br> ^<br> In file included from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1781:0,<br> from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,<br> from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,<br> from /tmp/tmplNikU7/src.linux-x86_64-2.7/fortranobject.h:13,<br> from /tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.c:19:<br> /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]<br> #warning "Using deprecated NumPy API, disable it by " <br> ^<br> /tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.c: In function ‘f2py_rout_f2py_bug_s’:<br> /tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.c:217:15: error: invalid type argument of unary ‘<em>’ (have ‘int’)<br> a_Dims[0]=2__n;<br> ^<br> /tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.c: At top level:<br> /tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.c:105:12: warning: ‘f2py_size’ defined but not used [-Wunused-function]<br> static int f2py_size(PyArrayObject</em> var, ...)<br> ^<br> error: Command "gcc -pthread -fno-strict-aliasing -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DNDEBUG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -fPIC -I/tmp/tmplNikU7/src.linux-x86_64-2.7 -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c /tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.c -o /tmp/tmplNikU7/tmp/tmplNikU7/src.linux-x86_64-2.7/f2py_bugmodule.o" failed with exit status 1</p> </blockquote>
<p dir="auto">When I constructed an array named <code class="notranslate">list</code> in fortran, like code shown below:</p> <div class="highlight highlight-source-fortran notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="subroutine blah(list, n) integer, intent(in) :: n real, intent(out) :: list(2*n,0:2**n) list = 1.0 end subroutine"><pre class="notranslate"><span class="pl-k">subroutine</span> <span class="pl-en">blah</span>(<span class="pl-v">list</span>, <span class="pl-v">n</span>) <span class="pl-k">integer</span>, <span class="pl-k">intent</span>(<span class="pl-k">in</span>) <span class="pl-k">::</span> n <span class="pl-k">real</span>, <span class="pl-k">intent</span>(<span class="pl-k">out</span>) <span class="pl-k">::</span> list(<span class="pl-c1">2</span><span class="pl-k">*</span>n,<span class="pl-c1">0</span>:<span class="pl-c1">2</span><span class="pl-k">**</span>n) list <span class="pl-k">=</span> <span class="pl-c1">1.0</span> <span class="pl-k">end</span> <span class="pl-k">subroutine</span></pre></div> <p dir="auto">I encountered the following error, which seems to treat exponentiation as a pointer. Any ideas how to get rid of it? Thanks!</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/tmp/tmpHYL2Dx/src.linux-x86_64-2.7/cmmodule.c:216:37: error: invalid type argument of unary ‘*’ (have ‘int’) list_Dims[0]=2 * n,list_Dims[1]=2**n+1; ^"><pre class="notranslate"><code class="notranslate">/tmp/tmpHYL2Dx/src.linux-x86_64-2.7/cmmodule.c:216:37: error: invalid type argument of unary ‘*’ (have ‘int’) list_Dims[0]=2 * n,list_Dims[1]=2**n+1; ^ </code></pre></div>
1
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() { let foo: &amp;mut [u8] = &amp;mut [1,2,3]; foo as *mut [u8] as *mut u8; }"><pre class="notranslate"><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-k">let</span> foo<span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-k">mut</span> <span class="pl-kos">[</span><span class="pl-smi">u8</span><span class="pl-kos">]</span> = <span class="pl-c1">&amp;</span><span class="pl-k">mut</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">;</span> foo <span class="pl-k">as</span> <span class="pl-c1">*</span><span class="pl-k">mut</span> <span class="pl-kos">[</span><span class="pl-smi">u8</span><span class="pl-kos">]</span> <span class="pl-k">as</span> <span class="pl-c1">*</span><span class="pl-k">mut</span> <span class="pl-smi">u8</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="error: internal compiler error: translating unsupported cast: *mut [u8] (cast_other) -&gt; *mut u8 (cast_pointer) note: the compiler hit an unexpected failure path. this is a bug. note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html note: run with `RUST_BACKTRACE=1` for a backtrace task 'rustc' failed at 'Box&lt;Any&gt;', /build/rust-git/src/rust/src/libsyntax/diagnostic.rs:175"><pre class="notranslate"><code class="notranslate">error: internal compiler error: translating unsupported cast: *mut [u8] (cast_other) -&gt; *mut u8 (cast_pointer) note: the compiler hit an unexpected failure path. this is a bug. note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html note: run with `RUST_BACKTRACE=1` for a backtrace task 'rustc' failed at 'Box&lt;Any&gt;', /build/rust-git/src/rust/src/libsyntax/diagnostic.rs:175 </code></pre></div>
<p dir="auto">The following code ICEs:</p> <div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() { let r : &amp;[int] = &amp;[1,2,3]; let _ = r as *const [int] as uint; }"><pre class="notranslate"><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-k">let</span> r <span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-kos">[</span><span class="pl-smi">int</span><span class="pl-kos">]</span> = <span class="pl-c1">&amp;</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">2</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-k">let</span> _ = r <span class="pl-k">as</span> <span class="pl-c1">*</span><span class="pl-k">const</span> <span class="pl-kos">[</span><span class="pl-smi">int</span><span class="pl-kos">]</span> <span class="pl-k">as</span> <span class="pl-smi">uint</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">with the following error:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: internal compiler error: translating unsupported cast: *const [int] (cast_other) -&gt; uint (cast_integral) note: the compiler hit an unexpected failure path. this is a bug. note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html note: run with `RUST_BACKTRACE=1` for a backtrace task 'rustc' failed at 'Box&lt;Any&gt;', /tmp/tmp.AJuZnZc9G6/rust/src/libsyntax/ast_util.rs:776 stack backtrace: 1: 0x7fd831534e20 - rt::backtrace::imp::write::h05ad71e0d8d53545YFq 2: 0x7fd831537fe0 - failure::on_fail::h67318170e271381eq1q 3: 0x7fd831d0ef40 - unwind::begin_unwind_inner::hab98eb958c8dd037MTd 4: 0x7fd830019c20 - unwind::begin_unwind::h6101647644969584620 5: 0x7fd83001a3c0 - diagnostic::Handler::bug::h73bed1cade32a05dYID 6: 0x7fd832101800 - driver::session::Session::bug::haf0a22dbefd7a44bSmv 7: 0x7fd8325467d0 - middle::trans::expr::trans_imm_cast::h3be503504a2cb4d6iY2 8: 0x7fd832539140 - middle::trans::expr::trans_unadjusted::hd291a28db4ab1b64i50 9: 0x7fd8324f6380 - middle::trans::expr::trans::h4aa7a0f1f6a515f12o0 10: 0x7fd83259d640 - middle::trans::_match::store_local::h95ac038bd6a8824cjRf 11: 0x7fd8324f4310 - middle::trans::base::init_local::hcaa97d53d8042b21zyb 12: 0x7fd8324f3810 - middle::trans::controlflow::trans_stmt::h754badf284040952fjW 13: 0x7fd8324f51b0 - middle::trans::controlflow::trans_block::hd9fdbeb4ba696bd2boW 14: 0x7fd8325a6520 - middle::trans::base::trans_closure::h201746f506a92a56lpc 15: 0x7fd8324e4b50 - middle::trans::base::trans_fn::hfc81a7de00fc2ea6yAc 16: 0x7fd8324e01d0 - middle::trans::base::trans_item::h0854978c1c605151HTc 17: 0x7fd8325b2910 - middle::trans::base::trans_crate::haa777e4646f5d49aBRd 18: 0x7fd8329f3c80 - driver::driver::phase_4_translate_to_llvm::hee038ef8fdb7099bjOu 19: 0x7fd8329eb130 - driver::driver::compile_input::h411f5de1517db61bIpu 20: 0x7fd832a7f680 - driver::run_compiler::h918ca986269540e0iay 21: 0x7fd832a7f560 - driver::main_args::closure.148406 22: 0x7fd83212f540 - task::TaskBuilder&lt;S&gt;::try_future::closure.100321 23: 0x7fd83212f330 - task::TaskBuilder&lt;S&gt;::spawn_internal::closure.100292 24: 0x7fd8333eb720 - task::spawn_opts::closure.8416 25: 0x7fd831d6f930 - rust_try_inner 26: 0x7fd831d6f920 - rust_try 27: 0x7fd831d0c520 - unwind::try::ha98ecfc6c2b84277uId 28: 0x7fd831d0c380 - task::Task::run::hc9ce4f8671722f9bfYc 29: 0x7fd8333eb490 - task::spawn_opts::closure.8356 30: 0x7fd831d0df70 - thread::thread_start::h605925f5652c970frid 31: 0x7fd830ff6dc0 - start_thread 32: 0x0 - &lt;unknown&gt;"><pre class="notranslate"><code class="notranslate">error: internal compiler error: translating unsupported cast: *const [int] (cast_other) -&gt; uint (cast_integral) note: the compiler hit an unexpected failure path. this is a bug. note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html note: run with `RUST_BACKTRACE=1` for a backtrace task 'rustc' failed at 'Box&lt;Any&gt;', /tmp/tmp.AJuZnZc9G6/rust/src/libsyntax/ast_util.rs:776 stack backtrace: 1: 0x7fd831534e20 - rt::backtrace::imp::write::h05ad71e0d8d53545YFq 2: 0x7fd831537fe0 - failure::on_fail::h67318170e271381eq1q 3: 0x7fd831d0ef40 - unwind::begin_unwind_inner::hab98eb958c8dd037MTd 4: 0x7fd830019c20 - unwind::begin_unwind::h6101647644969584620 5: 0x7fd83001a3c0 - diagnostic::Handler::bug::h73bed1cade32a05dYID 6: 0x7fd832101800 - driver::session::Session::bug::haf0a22dbefd7a44bSmv 7: 0x7fd8325467d0 - middle::trans::expr::trans_imm_cast::h3be503504a2cb4d6iY2 8: 0x7fd832539140 - middle::trans::expr::trans_unadjusted::hd291a28db4ab1b64i50 9: 0x7fd8324f6380 - middle::trans::expr::trans::h4aa7a0f1f6a515f12o0 10: 0x7fd83259d640 - middle::trans::_match::store_local::h95ac038bd6a8824cjRf 11: 0x7fd8324f4310 - middle::trans::base::init_local::hcaa97d53d8042b21zyb 12: 0x7fd8324f3810 - middle::trans::controlflow::trans_stmt::h754badf284040952fjW 13: 0x7fd8324f51b0 - middle::trans::controlflow::trans_block::hd9fdbeb4ba696bd2boW 14: 0x7fd8325a6520 - middle::trans::base::trans_closure::h201746f506a92a56lpc 15: 0x7fd8324e4b50 - middle::trans::base::trans_fn::hfc81a7de00fc2ea6yAc 16: 0x7fd8324e01d0 - middle::trans::base::trans_item::h0854978c1c605151HTc 17: 0x7fd8325b2910 - middle::trans::base::trans_crate::haa777e4646f5d49aBRd 18: 0x7fd8329f3c80 - driver::driver::phase_4_translate_to_llvm::hee038ef8fdb7099bjOu 19: 0x7fd8329eb130 - driver::driver::compile_input::h411f5de1517db61bIpu 20: 0x7fd832a7f680 - driver::run_compiler::h918ca986269540e0iay 21: 0x7fd832a7f560 - driver::main_args::closure.148406 22: 0x7fd83212f540 - task::TaskBuilder&lt;S&gt;::try_future::closure.100321 23: 0x7fd83212f330 - task::TaskBuilder&lt;S&gt;::spawn_internal::closure.100292 24: 0x7fd8333eb720 - task::spawn_opts::closure.8416 25: 0x7fd831d6f930 - rust_try_inner 26: 0x7fd831d6f920 - rust_try 27: 0x7fd831d0c520 - unwind::try::ha98ecfc6c2b84277uId 28: 0x7fd831d0c380 - task::Task::run::hc9ce4f8671722f9bfYc 29: 0x7fd8333eb490 - task::spawn_opts::closure.8356 30: 0x7fd831d0df70 - thread::thread_start::h605925f5652c970frid 31: 0x7fd830ff6dc0 - start_thread 32: 0x0 - &lt;unknown&gt; </code></pre></div>
1
<h4 dir="auto">Code Sample</h4> <p dir="auto">Create an Enum as described in the <a href="https://docs.python.org/3/library/enum.html" rel="nofollow">Python docs</a>, then create a dataframe and try to set multiindex:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from enum import Enum import pandas as pd class Method(Enum): LINEAR = 1 CONSTANT= 2 df = pd.DataFrame(data={&quot;a&quot;:[Method.LINEAR, Method.CONSTANT, Method.LINEAR, Method.CONSTANT], &quot;b&quot;:[1,2,2,3], &quot;c&quot;:[0,1,2,3]}) df.set_index([&quot;a&quot;, &quot;b&quot;])"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">enum</span> <span class="pl-k">import</span> <span class="pl-v">Enum</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">class</span> <span class="pl-v">Method</span>(<span class="pl-v">Enum</span>): <span class="pl-v">LINEAR</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span> <span class="pl-v">CONSTANT</span><span class="pl-c1">=</span> <span class="pl-c1">2</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-s1">data</span><span class="pl-c1">=</span>{<span class="pl-s">"a"</span>:[<span class="pl-v">Method</span>.<span class="pl-v">LINEAR</span>, <span class="pl-v">Method</span>.<span class="pl-v">CONSTANT</span>, <span class="pl-v">Method</span>.<span class="pl-v">LINEAR</span>, <span class="pl-v">Method</span>.<span class="pl-v">CONSTANT</span>], <span class="pl-s">"b"</span>:[<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>], <span class="pl-s">"c"</span>:[<span class="pl-c1">0</span>,<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>]}) <span class="pl-s1">df</span>.<span class="pl-en">set_index</span>([<span class="pl-s">"a"</span>, <span class="pl-s">"b"</span>])</pre></div> <p dir="auto">Error:</p> <blockquote> <p dir="auto">File "C:\A_PROGRAMS\anaconda3\lib\site-packages\pandas\core\arrays\categorical.py", line 2515, in _factorize_from_iterable<br> cat = Categorical(values, ordered=True)<br> File "C:\A_PROGRAMS\anaconda3\lib\site-packages\pandas\core\arrays\categorical.py", line 351, in <strong>init</strong><br> raise TypeError("'values' is not ordered, please "</p> </blockquote> <h4 dir="auto">Problem description</h4> <p dir="auto">Enum is a data type of the official Python 3 STL and should be supported by pandas. set_index works fine with enums when using them alone, e.g. <code class="notranslate">df.set_index(["a"]) </code> works.</p> <p dir="auto">I assume that the "ordered=True" might be the problem in categorical.py?</p> <h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4> <details> <h2 dir="auto">INSTALLED VERSIONS</h2> <p dir="auto">commit: None<br> python: 3.6.5.final.0<br> python-bits: 64<br> OS: Windows<br> OS-release: 7<br> machine: AMD64<br> processor: Intel64 Family 6 Model 94 Stepping 3, GenuineIntel<br> byteorder: little<br> LC_ALL: None<br> LANG: en<br> LOCALE: None.None</p> <p dir="auto">pandas: 0.23.0<br> pytest: 3.5.1<br> pip: 10.0.1<br> setuptools: 39.1.0<br> Cython: 0.28.2<br> numpy: 1.14.3<br> scipy: 1.1.0<br> pyarrow: 0.9.0<br> xarray: None<br> IPython: 6.4.0<br> sphinx: 1.7.4<br> patsy: 0.5.0<br> dateutil: 2.7.3<br> pytz: 2018.4<br> blosc: None<br> bottleneck: 1.2.1<br> tables: 3.4.3<br> numexpr: 2.6.5<br> feather: 0.4.0<br> matplotlib: 2.2.2<br> openpyxl: 2.5.3<br> xlrd: 1.1.0<br> xlwt: 1.3.0<br> xlsxwriter: 1.0.4<br> lxml: 4.2.1<br> bs4: 4.6.0<br> html5lib: 1.0.1<br> sqlalchemy: 1.2.7<br> pymysql: None<br> psycopg2: None<br> jinja2: 2.10<br> s3fs: None<br> fastparquet: None<br> pandas_gbq: None<br> pandas_datareader: None</p> </details>
<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="import pandas as pd from enum import Enum MyEnum = Enum(&quot;MyEnum&quot;, &quot;A B&quot;) df = pd.DataFrame(columns=pd.MultiIndex.from_product(iterables=[MyEnum, [1, 2]])) # TypeError: 'values' is not ordered, please explicitly specify the categories order by passing in a categories argument. df = pd.DataFrame(columns=pd.MultiIndex.from_product(iterables=[pd.Series(MyEnum, dtype=&quot;category&quot;), [1, 2]])) # this workaround successfully executes, but... df.append({(MyEnum.A, 1): &quot;abc&quot;, (MyEnum.B, 2): &quot;xyz&quot;}, ignore_index=True) # ... this &quot;append&quot; statement then raises the same error. df.loc[0, [(MyEnum.A, 1), (MyEnum.B, 2)]] = 'abc', 'xyz' # this works, but is less desirable (can't pass a dict, need to come up with a row indexer, etc.) "><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">from</span> <span class="pl-s1">enum</span> <span class="pl-k">import</span> <span class="pl-v">Enum</span> <span class="pl-v">MyEnum</span> <span class="pl-c1">=</span> <span class="pl-v">Enum</span>(<span class="pl-s">"MyEnum"</span>, <span class="pl-s">"A B"</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-s1">columns</span><span class="pl-c1">=</span><span class="pl-s1">pd</span>.<span class="pl-v">MultiIndex</span>.<span class="pl-en">from_product</span>(<span class="pl-s1">iterables</span><span class="pl-c1">=</span>[<span class="pl-v">MyEnum</span>, [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>]])) <span class="pl-c"># TypeError: 'values' is not ordered, please explicitly specify the categories order by passing in a categories argument.</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-s1">columns</span><span class="pl-c1">=</span><span class="pl-s1">pd</span>.<span class="pl-v">MultiIndex</span>.<span class="pl-en">from_product</span>(<span class="pl-s1">iterables</span><span class="pl-c1">=</span>[<span class="pl-s1">pd</span>.<span class="pl-v">Series</span>(<span class="pl-v">MyEnum</span>, <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">"category"</span>), [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>]])) <span class="pl-c"># this workaround successfully executes, but...</span> <span class="pl-s1">df</span>.<span class="pl-en">append</span>({(<span class="pl-v">MyEnum</span>.<span class="pl-v">A</span>, <span class="pl-c1">1</span>): <span class="pl-s">"abc"</span>, (<span class="pl-v">MyEnum</span>.<span class="pl-v">B</span>, <span class="pl-c1">2</span>): <span class="pl-s">"xyz"</span>}, <span class="pl-s1">ignore_index</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-c"># ... this "append" statement then raises the same error.</span> <span class="pl-s1">df</span>.<span class="pl-s1">loc</span>[<span class="pl-c1">0</span>, [(<span class="pl-v">MyEnum</span>.<span class="pl-v">A</span>, <span class="pl-c1">1</span>), (<span class="pl-v">MyEnum</span>.<span class="pl-v">B</span>, <span class="pl-c1">2</span>)]] <span class="pl-c1">=</span> <span class="pl-s">'abc'</span>, <span class="pl-s">'xyz'</span> <span class="pl-c"># this works, but is less desirable (can't pass a dict, need to come up with a row indexer, etc.)</span></pre></div> <h4 dir="auto">Problem description</h4> <p dir="auto">Though Enums can easily be used as column indexers, strange errors appear to arise when they are used (as one of the factors) in a MultiIndex.</p> <p dir="auto">The multiindex (and dataframe) can be created successfully if an (ordered) categorical Series is passed to the constructor. Yet in this case, appending rows in the usual way fails. One can create new rows using <code class="notranslate">.loc</code>, and yet this is not as nice.</p> <p dir="auto">This whole situation can be avoided by using strings instead of an Enum. Alternatively, one can use an IntEnum---and yet this essentially uses the underlying integers, instead of the names, as the column indexers.</p> <p dir="auto">As the use of enums as columns is perfectly supported in the case of a simple index, it seems a shortcoming that they can't be used in a MultiIndex.</p> <h4 dir="auto">Expected Output</h4> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; df = pd.DataFrame(columns=pd.MultiIndex.from_product(iterables=[MyEnum, [1, 2]])) &gt;&gt;&gt; df Empty DataFrame Columns: [(MyEnum.A, 1), (MyEnum.A, 2), (MyEnum.B, 1), (MyEnum.B, 2)] Index: [] &gt;&gt;&gt; df.append({(MyEnum.A, 1): &quot;abc&quot;, (MyEnum.B, 2): &quot;xyz&quot;}, ignore_index=True) MyEnum.A MyEnum.B 1 2 1 2 0 abc NaN NaN xyz"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</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-s1">columns</span><span class="pl-c1">=</span><span class="pl-s1">pd</span>.<span class="pl-v">MultiIndex</span>.<span class="pl-en">from_product</span>(<span class="pl-s1">iterables</span><span class="pl-c1">=</span>[<span class="pl-v">MyEnum</span>, [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>]])) <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span> <span class="pl-v">Empty</span> <span class="pl-v">DataFrame</span> <span class="pl-v">Columns</span>: [(<span class="pl-v">MyEnum</span>.<span class="pl-v">A</span>, <span class="pl-c1">1</span>), (<span class="pl-v">MyEnum</span>.<span class="pl-v">A</span>, <span class="pl-c1">2</span>), (<span class="pl-v">MyEnum</span>.<span class="pl-v">B</span>, <span class="pl-c1">1</span>), (<span class="pl-v">MyEnum</span>.<span class="pl-v">B</span>, <span class="pl-c1">2</span>)] <span class="pl-v">Index</span>: [] <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span>.<span class="pl-en">append</span>({(<span class="pl-v">MyEnum</span>.<span class="pl-v">A</span>, <span class="pl-c1">1</span>): <span class="pl-s">"abc"</span>, (<span class="pl-v">MyEnum</span>.<span class="pl-v">B</span>, <span class="pl-c1">2</span>): <span class="pl-s">"xyz"</span>}, <span class="pl-s1">ignore_index</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-v">MyEnum</span>.<span class="pl-v">A</span> <span class="pl-v">MyEnum</span>.<span class="pl-v">B</span> <span class="pl-c1">1</span> <span class="pl-c1">2</span> <span class="pl-c1">1</span> <span class="pl-c1">2</span> <span class="pl-c1">0</span> <span class="pl-s1">abc</span> <span class="pl-v">NaN</span> <span class="pl-v">NaN</span> <span class="pl-s1">xyz</span></pre></div> <h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4> <details> <h2 dir="auto">INSTALLED VERSIONS</h2> <p dir="auto">commit: None<br> python: 3.6.3.final.0<br> python-bits: 64<br> OS: Darwin<br> OS-release: 17.5.0<br> machine: x86_64<br> processor: i386<br> byteorder: little<br> LC_ALL: None<br> LANG: en_US.UTF-8<br> LOCALE: en_US.UTF-8</p> <p dir="auto">pandas: 0.23.0<br> pytest: None<br> pip: 10.0.1<br> setuptools: 39.0.1<br> Cython: None<br> numpy: 1.13.3<br> scipy: None<br> pyarrow: None<br> xarray: None<br> IPython: None<br> sphinx: None<br> patsy: None<br> dateutil: 2.6.1<br> pytz: 2017.3<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: None<br> s3fs: None<br> fastparquet: None<br> pandas_gbq: None<br> pandas_datareader: None</p> </details>
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 =&gt; search github for a similar issue or PR before submitting [ ] feature request [ ] support request =&gt; 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 =&gt; search github for a similar issue or PR before submitting [ ] feature request [ ] support request =&gt; 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> Test Repo - <a href="https://github.com/mildfuzz/angular-mockError">https://github.com/mildfuzz/angular-mockError</a></p> <p dir="auto">I am unable to test predicted HTTP error responses. Mockbackend can either send a response with an error code (which my app treats as a successful response in the test environment, but as an error in real world)</p> <p dir="auto">I am unable to send status codes with an error response in my tests, so I can not test any error handling my application might implements.</p> <p dir="auto"><strong>Expected behavior</strong><br> at least one of the defined test cases passes</p> <p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong><br> Test Repo - <a href="https://github.com/mildfuzz/angular-mockError">https://github.com/mildfuzz/angular-mockError</a></p> <p dir="auto">this is a re-opening of issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="139123794" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/7471" data-hovercard-type="issue" data-hovercard-url="/angular/angular/issues/7471/hovercard" href="https://github.com/angular/angular/issues/7471">#7471</a>, which was closed due to lack of repro steps.</p> <p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br> To be able to test all responses</p> <p dir="auto"><strong>Please tell us about your environment:</strong><br> OsX</p> <ul dir="auto"> <li> <p dir="auto"><strong>Angular version:</strong> 2.0.X<br> Angular 2.1.0</p> </li> <li> <p dir="auto"><strong>Browser:</strong> [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]<br> Chrome 54</p> </li> <li> <p dir="auto"><strong>Language:</strong> TypeScript 2.0.3</p> </li> <li> <p dir="auto"><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> = 6.9.1</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 =&gt; search github for a similar issue or PR before submitting [ ] feature request [ ] support request =&gt; 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 =&gt; search github for a similar issue or PR before submitting [ ] feature request [ ] support request =&gt; 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> When showing a form in IE 11 with an input field, the initial state of the field is not pristine, leading to error messages being shown to the user before he touched the field.</p> <p dir="auto"><strong>Expected behavior</strong><br> The field state should be pristine until the user first entered and removed some text. This works fine in e.g. Google Chrome</p> <p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong><br> <a href="http://embed.plnkr.co/fm7lH2/" rel="nofollow">http://embed.plnkr.co/fm7lH2/</a><br> The red error message should only be display when the user entered and removed some text.</p> <p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br> Form validation errors should only be displayed when a user touched the form.</p> <p dir="auto"><strong>Please tell us about your environment:</strong><br> Windows 7 / IE 11</p> <ul dir="auto"> <li> <p dir="auto"><strong>Angular version:</strong> 2.4.7</p> </li> <li> <p dir="auto"><strong>Browser:</strong> IE 11</p> </li> <li> <p dir="auto"><strong>Language:</strong> TypeScript</p> </li> <li> <p dir="auto"><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> = v6.3.1</p> </li> </ul>
0
<p dir="auto"><strong>Context:</strong></p> <ul dir="auto"> <li>Playwright Version: 1.22.2</li> <li>Operating System: Windows 10 21H2 &amp; macOS Monterey</li> <li>Node.js version: v16.14.0</li> <li>Browser: Chromium</li> <li>Extra: [any specific details about your environment]</li> </ul> <h2 dir="auto">Windows 10 System:</h2> <ul dir="auto"> <li>OS: Windows 10 10.0.19044</li> <li>Memory: 10.86 GB / 31.71 GB</li> </ul> <h2 dir="auto">Windows 10 Binaries:</h2> <ul dir="auto"> <li>Node: 16.15.0 - C:\Program Files\nodejs\node.EXE</li> <li>npm: 8.5.5 - C:\Program Files\nodejs\npm.CMD</li> </ul> <h2 dir="auto">macOS 12.3.1 System:</h2> <ul dir="auto"> <li>OS: macOS 12.3.1</li> <li>Memory: 89.27 MB / 64.00 GB</li> </ul> <h2 dir="auto">macOS 12.3.1 Binaries:</h2> <ul dir="auto"> <li>Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node</li> <li>Yarn: 1.22.17 - /opt/homebrew/bin/yarn</li> <li>npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm</li> </ul> <h2 dir="auto">macOS 12.3.1 Languages:</h2> <ul dir="auto"> <li>Bash: 3.2.57 - /bin/bash</li> </ul> <p dir="auto">##<strong>Code Snippet</strong><br> As per <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mxschmitt/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mxschmitt">@mxschmitt</a> they wanted a <em><strong>minimal reproducible attached in the form of a GitHub repository</strong></em> took some time to strip most of the data that is relevant to my work project and still be able to repro. I think it's related to data-driven test cases coming from my caseData.json file, when I remove it the Buffer() issues go away, but I need data-driven test cases.</p> <h3 dir="auto">Minimum Reproducible Github Repository:</h3> <p dir="auto"><a href="https://github.com/cameracode/qa-automation-playwright">qa-automation-playwright</a></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(node:355124) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (Use 'node --trace-deprecation ... ' to show where the warning was created)"><pre class="notranslate"><code class="notranslate">(node:355124) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (Use 'node --trace-deprecation ... ' to show where the warning was created) </code></pre></div> <p dir="auto">Using <code class="notranslate">node --trace-deprecation ....</code></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Error: Cannot find module 'C:\Source\Repos\qa-automation\tests\...' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: []"><pre class="notranslate"><code class="notranslate">Error: Cannot find module 'C:\Source\Repos\qa-automation\tests\...' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] </code></pre></div> <h2 dir="auto">Checking for playwright duplicates</h2> <p dir="auto"><code class="notranslate">npm list</code></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[email protected] C:\Source\Repos\qa-automation-playwright ├── @playwright/[email protected] ├── [email protected] └── [email protected]"><pre class="notranslate"><code class="notranslate">[email protected] C:\Source\Repos\qa-automation-playwright ├── @playwright/[email protected] ├── [email protected] └── [email protected] </code></pre></div> <p dir="auto">From the project locally I'm seeing 1.23.0-alpha-jun-7-2022 and when I attempt <code class="notranslate">npm list -g</code> I only see grunt installed.</p> <p dir="auto">When I run <code class="notranslate">npx playwright -V</code> see:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PS C:\Source\Repos\qa-automation-playwright&gt; npx playwright -V Version 1.23.0-alpha-jun-7-2022"><pre class="notranslate"><code class="notranslate">PS C:\Source\Repos\qa-automation-playwright&gt; npx playwright -V Version 1.23.0-alpha-jun-7-2022 </code></pre></div> <p dir="auto">##Test Script Output:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Registration › Registration on Product [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Registration › Registration on Product (node:328216) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (Use `node --trace-deprecation ...` to show where the warning was created) [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] (node:341020) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (Use `node --trace-deprecation ...` to show where the warning was created) [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Registration › Registration on Product (node:355124) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (Use `node --trace-deprecation ...` to show where the warning was created) [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Registration › Registration on Product (node:358552) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (Use `node --trace-deprecation ...` to show where the warning was created)"><pre class="notranslate"><code class="notranslate">[TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Registration › Registration on Product [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Registration › Registration on Product (node:328216) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (Use `node --trace-deprecation ...` to show where the warning was created) [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] (node:341020) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (Use `node --trace-deprecation ...` to show where the warning was created) [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Registration › Registration on Product (node:355124) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (Use `node --trace-deprecation ...` to show where the warning was created) [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Registration › Registration on Product (node:358552) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (Use `node --trace-deprecation ...` to show where the warning was created) </code></pre></div> <h2 dir="auto">Windows 10 Stack Trace</h2> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$Env:NODE_OPTIONS=&quot;--trace-deprecation&quot; npx playwright test --config=playwright.config.ts --project=Chromium"><pre class="notranslate"><code class="notranslate">$Env:NODE_OPTIONS="--trace-deprecation" npx playwright test --config=playwright.config.ts --project=Chromium </code></pre></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PS C:\Source\Repos\qa-automation-playwright\tests&gt; $Env:NODE_OPTIONS=&quot;--trace-deprecation&quot; PS C:\Source\Repos\qa-automation-playwright\tests&gt; npx playwright test --config=playwright.config.ts --project=Chromium [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] Running 7 tests using 6 workers (node:474972) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (node:buffer:187:11) at new Buffer (node:buffer:271:3) at Array.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666 at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782) at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10 at Array.map (&lt;anonymous&gt;) at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810) at maybeOverridePrepareStackTrace (node:internal/errors:142:29) at prepareStackTrace (node:internal/errors:116:5) at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15) at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14 at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17) [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration (node:484728) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (node:buffer:187:11) at new Buffer (node:buffer:271:3) at Array.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666 at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782) at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10 at Array.map (&lt;anonymous&gt;) at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810) at maybeOverridePrepareStackTrace (node:internal/errors:142:29) at prepareStackTrace (node:internal/errors:116:5) at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15) at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14 at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17) (node:470588) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (node:buffer:187:11) at new Buffer (node:buffer:271:3) at Array.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666 at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782) at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10 at Array.map (&lt;anonymous&gt;) at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810) at maybeOverridePrepareStackTrace (node:internal/errors:142:29) at prepareStackTrace (node:internal/errors:116:5) at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15) at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14 at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17) [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration (node:493340) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (node:buffer:187:11) at new Buffer (node:buffer:271:3) at Array.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666 at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782) at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10 at Array.map (&lt;anonymous&gt;) at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810) at maybeOverridePrepareStackTrace (node:internal/errors:142:29) at prepareStackTrace (node:internal/errors:116:5) at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15) at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14 at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17) (node:449628) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (node:buffer:187:11) at new Buffer (node:buffer:271:3) at Array.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666 at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782) at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10 at Array.map (&lt;anonymous&gt;) at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810) at maybeOverridePrepareStackTrace (node:internal/errors:142:29) at prepareStackTrace (node:internal/errors:116:5) at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15) at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14 at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17) [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration (node:488108) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (node:buffer:187:11) at new Buffer (node:buffer:271:3) at Array.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666 at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782) at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10 at Array.map (&lt;anonymous&gt;) at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810) at maybeOverridePrepareStackTrace (node:internal/errors:142:29) at prepareStackTrace (node:internal/errors:116:5) at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15) at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14 at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17) (node:476512) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (node:buffer:187:11) at new Buffer (node:buffer:271:3) at Array.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666 at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782) at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10 at Array.map (&lt;anonymous&gt;) at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810) at maybeOverridePrepareStackTrace (node:internal/errors:142:29) at prepareStackTrace (node:internal/errors:116:5) at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15) at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14 at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) ✓ [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration (16s) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17)"><pre class="notranslate"><code class="notranslate">PS C:\Source\Repos\qa-automation-playwright\tests&gt; $Env:NODE_OPTIONS="--trace-deprecation" PS C:\Source\Repos\qa-automation-playwright\tests&gt; npx playwright test --config=playwright.config.ts --project=Chromium [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] Running 7 tests using 6 workers (node:474972) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (node:buffer:187:11) at new Buffer (node:buffer:271:3) at Array.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666 at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782) at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10 at Array.map (&lt;anonymous&gt;) at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810) at maybeOverridePrepareStackTrace (node:internal/errors:142:29) at prepareStackTrace (node:internal/errors:116:5) at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15) at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14 at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17) [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration (node:484728) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (node:buffer:187:11) at new Buffer (node:buffer:271:3) at Array.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666 at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782) at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10 at Array.map (&lt;anonymous&gt;) at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810) at maybeOverridePrepareStackTrace (node:internal/errors:142:29) at prepareStackTrace (node:internal/errors:116:5) at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15) at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14 at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17) (node:470588) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (node:buffer:187:11) at new Buffer (node:buffer:271:3) at Array.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666 at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782) at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10 at Array.map (&lt;anonymous&gt;) at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810) at maybeOverridePrepareStackTrace (node:internal/errors:142:29) at prepareStackTrace (node:internal/errors:116:5) at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15) at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14 at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17) [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration (node:493340) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (node:buffer:187:11) at new Buffer (node:buffer:271:3) at Array.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666 at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782) at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10 at Array.map (&lt;anonymous&gt;) at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810) at maybeOverridePrepareStackTrace (node:internal/errors:142:29) at prepareStackTrace (node:internal/errors:116:5) at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15) at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14 at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17) (node:449628) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (node:buffer:187:11) at new Buffer (node:buffer:271:3) at Array.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666 at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782) at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10 at Array.map (&lt;anonymous&gt;) at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810) at maybeOverridePrepareStackTrace (node:internal/errors:142:29) at prepareStackTrace (node:internal/errors:116:5) at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15) at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14 at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17) [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration (node:488108) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (node:buffer:187:11) at new Buffer (node:buffer:271:3) at Array.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666 at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782) at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10 at Array.map (&lt;anonymous&gt;) at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810) at maybeOverridePrepareStackTrace (node:internal/errors:142:29) at prepareStackTrace (node:internal/errors:116:5) at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15) at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14 at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17) (node:476512) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (node:buffer:187:11) at new Buffer (node:buffer:271:3) at Array.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666 at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782) at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427) at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10 at Array.map (&lt;anonymous&gt;) at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810) at maybeOverridePrepareStackTrace (node:internal/errors:142:29) at prepareStackTrace (node:internal/errors:116:5) at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15) at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14 at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) ✓ [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration (16s) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.&lt;anonymous&gt; (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17) </code></pre></div> <p dir="auto"><strong>Describe the bug</strong></p> <p dir="auto">*<em>During <code class="notranslate">npx playwright test --config=playwright.config.ts --project=Chromium</code> this error occurs even after attempting to upgrade to latest alpha build with Merge <a href="https://github.com/microsoft/playwright/pull/14638" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/playwright/pull/14638/hovercard">PR 14638 fix: hide DeprecationWarning of fd-slicer</a></em></p> <p dir="auto">Buffer() keeps being thrown, I have zeroed down on data-driven JSON file causing the issue, why, I don't know. If I remove the JSON file the errors go away. I do not have dupe playwright or playwright/test versions installed.</p> <p dir="auto">It's not a super major issue, but it is spamming my test output</p> <h2 dir="auto">Minimum Reproducible Github Repository:</h2> <p dir="auto"><a href="https://github.com/cameracode/qa-automation-playwright">qa-automation-playwright</a></p> <p dir="auto">See <a href="https://github.com/microsoft/playwright/issues/14065#" data-hovercard-type="issue" data-hovercard-url="/microsoft/playwright/issues/14065/hovercard">Bug: DeprecationWarning: Buffer() is deprecated due to security and usability issues</a></p>
<p dir="auto">It would be helpful include the SHA256 sum of the browsers that are downloaded. That would allow the checking to ensure that the proper binary was downloaded as expected.</p> <p dir="auto">Additionally, this would aid in integration with other tools that may have download caches to prevent duplicated downloads.</p>
0
<p dir="auto">The specific error occurs in <a href="https://github.com/alexchandel/conrod/commit/b27fb8c7b58f1b67d9d4f963312bab8b3c53d1bf">this commit</a> on <a href="https://github.com/alexchandel/conrod">my bugfix fork</a> of <a href="https://github.com/PistonDevelopers/conrod">conrod</a>.</p> <p dir="auto">An FnMut is created, boxed, and passed to a function that takes a Box&lt;FnMut(bool) + 'a&gt;. The closure modifies its environment:</p> <div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="conrod/examples/all_widgets.rs:318:36: 318:97 error: internal compiler error: aliasability violation with closure conrod/examples/all_widgets.rs:318 .callback(Box::new(|&amp;mut: new_val: bool| {demo.bool_matrix[col][row] = new_val;})) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"><pre class="notranslate">conrod/examples/all_widgets<span class="pl-kos">.</span><span class="pl-c1">rs</span><span class="pl-kos">:</span><span class="pl-c1">318</span><span class="pl-kos">:</span><span class="pl-c1">36</span><span class="pl-kos">:</span> <span class="pl-c1">318</span><span class="pl-kos">:</span><span class="pl-c1">97</span> error<span class="pl-kos">:</span> internal compiler error<span class="pl-kos">:</span> aliasability violation with closure conrod/examples/all_widgets<span class="pl-kos">.</span><span class="pl-c1">rs</span><span class="pl-kos">:</span><span class="pl-c1">318</span> <span class="pl-kos">.</span><span class="pl-en">callback</span><span class="pl-kos">(</span><span class="pl-smi">Box</span><span class="pl-kos">::</span><span class="pl-en">new</span><span class="pl-kos">(</span>|<span class="pl-c1">&amp;</span><span class="pl-k">mut</span><span class="pl-kos">:</span> new_val<span class="pl-kos">:</span> <span class="pl-smi">bool</span>| <span class="pl-kos">{</span>demo<span class="pl-kos">.</span><span class="pl-c1">bool_matrix</span><span class="pl-kos">[</span>col<span class="pl-kos">]</span><span class="pl-kos">[</span>row<span class="pl-kos">]</span> = new_val<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">rustc --version --verbose:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc 1.0.0-nightly (f4f10dba2 2015-01-17 20:31:08 +0000) binary: rustc commit-hash: f4f10dba2975b51c2d2c92157018db3ac13d4d4a commit-date: 2015-01-17 20:31:08 +0000 host: x86_64-pc-windows-gnu release: 1.0.0-nightly"><pre class="notranslate"><code class="notranslate">rustc 1.0.0-nightly (f4f10dba2 2015-01-17 20:31:08 +0000) binary: rustc commit-hash: f4f10dba2975b51c2d2c92157018db3ac13d4d4a commit-date: 2015-01-17 20:31:08 +0000 host: x86_64-pc-windows-gnu release: 1.0.0-nightly </code></pre></div> <p dir="auto">Backtrace: (the offending line 111 is at the bottom of the source snippet below)</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="source.rs:111:22: 111:78 error: internal compiler error: aliasability violation with closure source.rs:111 try_consume( key, &amp;|&amp;: value| item.effects.effects.push( consume( value ) ) ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html note: run with `RUST_BACKTRACE=1` for a backtrace thread 'rustc' panicked at 'Box&lt;Any&gt;', C:\bot\slave\nightly-dist-rustc-win-64\build\src\libsyntax\diagnostic.rs:126 stack backtrace: 1: 0x69beb95b - sys::backtrace::write::h3574a74d3ac66ba0Dcu 2: 0x69bff6c3 - rt::unwind::register::hb202fe2a2fd24f5eyYz 3: 0x69b8363f - rt::unwind::begin_unwind_inner::h24cce2e033842dba7Vz 4: 0x6f89b58c - diagnostic::SpanHandler::span_bug::he7f492467f6ccae95qF 5: 0x6f89b543 - diagnostic::SpanHandler::span_bug::he7f492467f6ccae95qF 6: 0x591d82 - session::Session::span_bug::hbbd1fa2194e20c7cfBp 7: 0x705e170c - borrowck::move_data::MovePathIndex...std..cmp..PartialEq::ne::h1a3439607cb47b24mTd 8: 0x705e84bd - borrowck::gather_loans::GatherLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::mutate::hdc7adcebb6b13c04Nsc 9: 0x705e66c9 - borrowck::gather_loans::GatherLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::borrow::h4842d9e140720d87kqc 10: 0x705d92f3 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 11: 0x705d5152 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 12: 0x705d8ef6 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 13: 0x705d4d13 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 14: 0x705d8c17 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 15: 0x705d51df - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 16: 0x705d8c17 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 17: 0x705d3b11 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 18: 0x705d3fc7 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 19: 0x705d8c17 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 20: 0x705d3c0a - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 21: 0x705fcc12 - borrowck::check_crate::hb708c27b837bb24bUIe 22: 0x705f9986 - borrowck::BorrowckCtxt&lt;'a, 'tcx&gt;.Visitor&lt;'v&gt;::visit_fn::h85e169569b3db6adOHe 23: 0x705fbb13 - borrowck::check_crate::hb708c27b837bb24bUIe Could not compile `DotA_Simulator`."><pre class="notranslate"><code class="notranslate">source.rs:111:22: 111:78 error: internal compiler error: aliasability violation with closure source.rs:111 try_consume( key, &amp;|&amp;: value| item.effects.effects.push( consume( value ) ) ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html note: run with `RUST_BACKTRACE=1` for a backtrace thread 'rustc' panicked at 'Box&lt;Any&gt;', C:\bot\slave\nightly-dist-rustc-win-64\build\src\libsyntax\diagnostic.rs:126 stack backtrace: 1: 0x69beb95b - sys::backtrace::write::h3574a74d3ac66ba0Dcu 2: 0x69bff6c3 - rt::unwind::register::hb202fe2a2fd24f5eyYz 3: 0x69b8363f - rt::unwind::begin_unwind_inner::h24cce2e033842dba7Vz 4: 0x6f89b58c - diagnostic::SpanHandler::span_bug::he7f492467f6ccae95qF 5: 0x6f89b543 - diagnostic::SpanHandler::span_bug::he7f492467f6ccae95qF 6: 0x591d82 - session::Session::span_bug::hbbd1fa2194e20c7cfBp 7: 0x705e170c - borrowck::move_data::MovePathIndex...std..cmp..PartialEq::ne::h1a3439607cb47b24mTd 8: 0x705e84bd - borrowck::gather_loans::GatherLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::mutate::hdc7adcebb6b13c04Nsc 9: 0x705e66c9 - borrowck::gather_loans::GatherLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::borrow::h4842d9e140720d87kqc 10: 0x705d92f3 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 11: 0x705d5152 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 12: 0x705d8ef6 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 13: 0x705d4d13 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 14: 0x705d8c17 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 15: 0x705d51df - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 16: 0x705d8c17 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 17: 0x705d3b11 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 18: 0x705d3fc7 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 19: 0x705d8c17 - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 20: 0x705d3c0a - borrowck::check_loans::CheckLoanCtxt&lt;'a, 'tcx&gt;.euv..Delegate&lt;'tcx&gt;::decl_without_init::h9c67fbfec08849cbHoa 21: 0x705fcc12 - borrowck::check_crate::hb708c27b837bb24bUIe 22: 0x705f9986 - borrowck::BorrowckCtxt&lt;'a, 'tcx&gt;.Visitor&lt;'v&gt;::visit_fn::h85e169569b3db6adOHe 23: 0x705fbb13 - borrowck::check_crate::hb708c27b837bb24bUIe Could not compile `DotA_Simulator`. </code></pre></div> <p dir="auto">Source code (only the parts related to the problem):</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="... let string = File::open( &amp;Path::new( filename ) ).read_to_string().unwrap(); let json = json::from_str( string.as_slice() ).unwrap(); let object = json.as_object().unwrap(); let mut item = Item::new(); item.name = object[&quot;Name&quot;.to_string()].as_string().unwrap().to_string(); item.cost = object[&quot;ItemCost&quot;.to_string()].as_f64().unwrap(); //get the corresponding f64 to a key let get_f64 = |&amp;: key: &amp;str| -&gt; f64 { object.get( &amp;key.to_string() ).unwrap().as_f64().unwrap() }; //Checks if all keys are mapped let contains_all = |&amp;: keys: &amp;[&amp;str]| -&gt; bool { for k in keys.iter() { if !object.contains_key( &amp;k.to_string() ) { return false; } } true }; //Consumes a value if its key exists. let try_consume = |&amp;: key: &amp;str, consume: &amp;Fn(f64)| { match object.get(&amp;key.to_string()) { Some(ref json) =&gt; consume( json.as_f64().unwrap() ), None =&gt; () }; }; { //Same as above but consume creates an Effect that gets pushed onto the item. //This is in a separate scope because the Closure captures item.effects.effects until it goes out of scope. let try_consume_push = |&amp;: key: &amp;str, consume: &amp;Fn(f64) -&gt; Effect| { try_consume( key, &amp;|&amp;: value| item.effects.effects.push( consume( value ) ) ); }; ..."><pre class="notranslate"><code class="notranslate">... let string = File::open( &amp;Path::new( filename ) ).read_to_string().unwrap(); let json = json::from_str( string.as_slice() ).unwrap(); let object = json.as_object().unwrap(); let mut item = Item::new(); item.name = object["Name".to_string()].as_string().unwrap().to_string(); item.cost = object["ItemCost".to_string()].as_f64().unwrap(); //get the corresponding f64 to a key let get_f64 = |&amp;: key: &amp;str| -&gt; f64 { object.get( &amp;key.to_string() ).unwrap().as_f64().unwrap() }; //Checks if all keys are mapped let contains_all = |&amp;: keys: &amp;[&amp;str]| -&gt; bool { for k in keys.iter() { if !object.contains_key( &amp;k.to_string() ) { return false; } } true }; //Consumes a value if its key exists. let try_consume = |&amp;: key: &amp;str, consume: &amp;Fn(f64)| { match object.get(&amp;key.to_string()) { Some(ref json) =&gt; consume( json.as_f64().unwrap() ), None =&gt; () }; }; { //Same as above but consume creates an Effect that gets pushed onto the item. //This is in a separate scope because the Closure captures item.effects.effects until it goes out of scope. let try_consume_push = |&amp;: key: &amp;str, consume: &amp;Fn(f64) -&gt; Effect| { try_consume( key, &amp;|&amp;: value| item.effects.effects.push( consume( value ) ) ); }; ... </code></pre></div> <p dir="auto">If some info about my code matters:<br> I have a json object from which I want to extract a bunch of values that are all f64 and which get turned into a struct called Effect depending on their key which are put into a struct called Item. To have less duplicate code I define a few helper closures that use the same json object, Item and eachother.<br> The closures take other closures as arguments which I pass by reference because the compiler complains about them not being sized otherwise.</p>
1
<h5 dir="auto">System information (version)</h5> <ul dir="auto"> <li>OpenCV =&gt; 3.4.7 / 4.1.1</li> <li>Operating System / Platform =&gt; Ubuntu 18.04 x86_64</li> <li>Compiler =&gt; gcc 8.3 / gcc 9.1</li> </ul> <h5 dir="auto">Detailed description</h5> <p dir="auto">OpenCV fails to build when Eigen is imported as a CMake target and precompiled header are ON.</p> <p dir="auto">When Eigen is imported as a CMake target (here <a href="https://github.com/opencv/opencv/blob/3.4.7/cmake/OpenCVFindLibsPerf.cmake#L47-L50">https://github.com/opencv/opencv/blob/3.4.7/cmake/OpenCVFindLibsPerf.cmake#L47-L50</a>) I got the following error when compiling :</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[321/1436] Building CXX object modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.cxx.o FAILED: modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.cxx.o /usr/bin/c++ -DOPENCV_WITH_ITT=1 -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I. -I../modules/core/src -I../modules/core/include -Imodules/core -I../3rdparty/include/opencl/1.2 -I../3rdparty/ittnotify/include -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -fPIC -std=c++11 -MD -MT modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.cxx.o -MF modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.cxx.o.d -o modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.cxx.o -c modules/core/opencv_core_pch_dephelp.cxx In file included from /tmp/Genie/External/source/opencv/modules/core/src/precomp.hpp:55, from modules/core/opencv_core_pch_dephelp.cxx:1: ../modules/core/include/opencv2/core/private.hpp:66:12: fatal error: Eigen/Core: No such file or directory # include &lt;Eigen/Core&gt; ^~~~~~~~~~~~"><pre class="notranslate"><code class="notranslate">[321/1436] Building CXX object modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.cxx.o FAILED: modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.cxx.o /usr/bin/c++ -DOPENCV_WITH_ITT=1 -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I. -I../modules/core/src -I../modules/core/include -Imodules/core -I../3rdparty/include/opencl/1.2 -I../3rdparty/ittnotify/include -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -fPIC -std=c++11 -MD -MT modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.cxx.o -MF modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.cxx.o.d -o modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.cxx.o -c modules/core/opencv_core_pch_dephelp.cxx In file included from /tmp/Genie/External/source/opencv/modules/core/src/precomp.hpp:55, from modules/core/opencv_core_pch_dephelp.cxx:1: ../modules/core/include/opencv2/core/private.hpp:66:12: fatal error: Eigen/Core: No such file or directory # include &lt;Eigen/Core&gt; ^~~~~~~~~~~~ </code></pre></div> <p dir="auto">Disabling precompiled header with <code class="notranslate">ENABLE_PRECOMPILED_HEADER=OFF</code> when configuring is workaround.</p>
<h5 dir="auto">System information (version)</h5> <ul dir="auto"> <li>OpenCV =&gt; 4.1.1</li> <li>Operating System / Platform =&gt; Linux Debian 9</li> <li>Compiler =&gt; GCC 6.3.0</li> </ul> <h5 dir="auto">Detailed description</h5> <p dir="auto">I encountered an error with #include &lt;Eigen/core&gt; when building OpenCV 4.1.1 even though Eigen is installed on the system and is found by cmake.</p> <p dir="auto"><code class="notranslate">[ 1%] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/Half/half.cpp.o In file included from /home/user/OpenCV/opencv-4.1.1/modules/imgproc/src/precomp.hpp:50:0, from /home/user/OpenCV/build/modules/imgproc/opencv_imgproc_pch_dephelp.cxx:1: /home/user/OpenCV/opencv-4.1.1/modules/core/include/opencv2/core/private.hpp:66:24: fatal error: Eigen/Core: No such file or directory # include &lt;Eigen/Core&gt;</code></p> <p dir="auto">Please find attached my <a href="https://github.com/opencv/opencv/files/3435311/CMakeCache.txt">CMakeCache.txt</a>.</p> <p dir="auto">Temporary workaround that solved the issue:<br> Add <code class="notranslate">-I&lt;path-to-include/eigen3&gt;</code> to <code class="notranslate">CMAKE_CXX_FLAGS</code>.</p> <h5 dir="auto">Steps to reproduce</h5> <ol dir="auto"> <li>Download code of OpenCV 4.1.1</li> <li>Build with configuration specified in <a href="https://github.com/opencv/opencv/files/3435311/CMakeCache.txt">CMakeCache.txt</a>.</li> </ol>
1
<h3 dir="auto">Describe the issue:</h3> <p dir="auto">Suppose we have an array whose total size is zero (product of <code class="notranslate">shape[i]</code> is zero) but the <code class="notranslate">shape != (0,)</code>. Below, I'm making one by slicing a non-empty array.</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; array = np.array([[1, 2, 3], [4, 5, 6]]) &gt;&gt;&gt; array array([[1, 2, 3], [4, 5, 6]]) &gt;&gt;&gt; array.tolist() [[1, 2, 3], [4, 5, 6]] &gt;&gt;&gt; array[:, :0] array([], shape=(2, 0), dtype=int64) &gt;&gt;&gt; array[:, :0].tolist() [[], []]"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">array</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([[<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>], [<span class="pl-c1">4</span>, <span class="pl-c1">5</span>, <span class="pl-c1">6</span>]]) <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">array</span> <span class="pl-en">array</span>([[<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>], [<span class="pl-c1">4</span>, <span class="pl-c1">5</span>, <span class="pl-c1">6</span>]]) <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">array</span>.<span class="pl-en">tolist</span>() [[<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>], [<span class="pl-c1">4</span>, <span class="pl-c1">5</span>, <span class="pl-c1">6</span>]] <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">array</span>[:, :<span class="pl-c1">0</span>] <span class="pl-en">array</span>([], <span class="pl-s1">shape</span><span class="pl-c1">=</span>(<span class="pl-c1">2</span>, <span class="pl-c1">0</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">int64</span>) <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">array</span>[:, :<span class="pl-c1">0</span>].<span class="pl-en">tolist</span>() [[], []]</pre></div> <p dir="auto">The <code class="notranslate">repr</code> looks like <code class="notranslate">[]</code>, but I would expect it to be <code class="notranslate">[[], []]</code>, as the list representation is. This is minor, but I thought I'd point it out.</p> <p dir="auto">I also didn't see anything like it in the current open issues.</p> <h3 dir="auto">Reproduce the code example:</h3> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="See above."><pre class="notranslate"><span class="pl-v">See</span> <span class="pl-s1">above</span>.</pre></div> <h3 dir="auto">Error message:</h3> <div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="No error message."><pre class="notranslate">No error message.</pre></div> <h3 dir="auto">NumPy/Python version information:</h3> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import sys, numpy; print(numpy.__version__, sys.version) 1.22.4 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:56:21) [GCC 10.3.0]"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-k">import</span> <span class="pl-s1">sys</span>, <span class="pl-s1">numpy</span>; <span class="pl-en">print</span>(<span class="pl-s1">numpy</span>.<span class="pl-s1">__version__</span>, <span class="pl-s1">sys</span>.<span class="pl-s1">version</span>) <span class="pl-c1">1.22</span>.<span class="pl-c1">4</span> <span class="pl-c1">3.9</span>.<span class="pl-c1">13</span> <span class="pl-c1">|</span> <span class="pl-s1">packaged</span> <span class="pl-s1">by</span> <span class="pl-s1">conda</span><span class="pl-c1">-</span><span class="pl-s1">forge</span> <span class="pl-c1">|</span> (<span class="pl-s1">main</span>, <span class="pl-v">May</span> <span class="pl-c1">27</span> <span class="pl-c1">2022</span>, <span class="pl-c1">16</span>:<span class="pl-c1">56</span>:<span class="pl-c1">21</span>) [<span class="pl-v">GCC</span> <span class="pl-c1">10.3</span><span class="pl-c1">.0</span>]</pre></div>
<h3 dir="auto">Reproducing code example:</h3> <p dir="auto">Empty arrays repr like <code class="notranslate">array([], shape=(0, 0), dtype=float64)</code>, but this is not actually valid because <code class="notranslate">shape</code> cannot be passed to the array constructor:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; from numpy import * &gt;&gt;&gt; empty((0, 0)) array([], shape=(0, 0), dtype=float64) &gt;&gt;&gt; array([], shape=(0, 0), dtype=float64) Traceback (most recent call last): File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt; TypeError: 'shape' is an invalid keyword argument for array()"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-k">from</span> <span class="pl-s1">numpy</span> <span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-en">empty</span>((<span class="pl-c1">0</span>, <span class="pl-c1">0</span>)) <span class="pl-en">array</span>([], <span class="pl-s1">shape</span><span class="pl-c1">=</span>(<span class="pl-c1">0</span>, <span class="pl-c1">0</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">float64</span>) <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-en">array</span>([], <span class="pl-s1">shape</span><span class="pl-c1">=</span>(<span class="pl-c1">0</span>, <span class="pl-c1">0</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">float64</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-v">File</span> <span class="pl-s">"&lt;stdin&gt;"</span>, <span class="pl-s1">line</span> <span class="pl-c1">1</span>, <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span> <span class="pl-v">TypeError</span>: <span class="pl-s">'shape'</span> <span class="pl-c1">is</span> <span class="pl-s1">an</span> <span class="pl-s1">invalid</span> <span class="pl-s1">keyword</span> <span class="pl-s1">argument</span> <span class="pl-k">for</span> <span class="pl-en">array</span>()</pre></div> <p dir="auto">It would be useful if either <code class="notranslate">array([], shape=(0, 0), dtype=float64)</code> worked or empty arrays printed to another string that actually did work, like <code class="notranslate">empty(shape=(0, 0), dtype=float64)</code>. Aside from copy-pastability being useful, it's very confusing that it shows the <code class="notranslate">shape</code> keyword like this when it doesn't actually exist.</p> <h3 dir="auto">Error message:</h3> <h3 dir="auto">Numpy/Python version information:</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; np.__version__ '1.18.1'"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; np.__version__ '1.18.1' </code></pre></div>
1
<p dir="auto">As we talk about parallel computing in various contexts, it might be handy to keep in mind<br> all the high level moving parts. Here are some that come to mind, just to get the ball rolling.</p> <p dir="auto">Hardware</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Shared Memory Machines (Threads: See <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="9422371" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/1790" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/1790/hovercard" href="https://github.com/JuliaLang/julia/issues/1790">#1790</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="9453947" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/1802" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/1802/hovercard" href="https://github.com/JuliaLang/julia/issues/1802">#1802</a>)</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Distributed Memory (especially networks of shared memory) (spawns, MPI?, migrating threads?)</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> GPUs? (we do/don't believe these are here to stay)</li> </ul> <p dir="auto">Tools</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Nice Graphical Performance Tools and Instrumentation (My first wish: just<br> have Green (working) / Red (idle) on every processor easily every time I do parallel julia)</li> </ul> <p dir="auto">Programming Models</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Persistent Data as in Global Array Syntax Darrays (Star-P and others)</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> CILK/Spawns</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Map/reduce etc.</li> </ul> <p dir="auto">Communication Layers</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ZMQ, MPI, sockets</li> </ul> <p dir="auto">Schedulers</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ??</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Does one master know all state?</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Can our serial model be in conflict with various parallel models?</li> </ul> <p dir="auto">Libraries</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Scalapack, parallel FFTW?, sparse matrices, PETSc , (star-p like to compare<br> with more pure julia methods?)</li> </ul>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mlubin/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mlubin">@mlubin</a> This is what I propose for lufact!</p> <ol dir="auto"> <li>Create a new type - SparseMatrixCSCZeroIndexing</li> <li>Avoid the copy in lufact!, and simply use S all along</li> <li>Make S of type SparseMatrixCSCZeroIndexing, so that it doesn't mess up the printing of the Factorization object</li> </ol> <p dir="auto">Even in the lufact() we can then use this new opaque object, so that it doesn't print all wrong.</p>
0
<h3 dir="auto">Preflight Checklist</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li> </ul> <h3 dir="auto">Electron Version</h3> <p dir="auto">12.0.6</p> <h3 dir="auto">What operating system are you using?</h3> <p dir="auto">Windows</p> <h3 dir="auto">Operating System Version</h3> <p dir="auto">Windows 10 Pro 2004</p> <h3 dir="auto">What arch are you using?</h3> <p dir="auto">x64</p> <h3 dir="auto">Last Known Working Electron version</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Expected Behavior</h3> <ul dir="auto"> <li>The app opens a child window using <code class="notranslate">window.open</code> method (<code class="notranslate">nativeWindowOpen</code> is set to <code class="notranslate">true</code>).</li> <li>User clicks on a button that is supposed to bring the previously opened window to front. The app calls <code class="notranslate">win.focus()</code> on a said child window object.</li> <li>The child window should appear above the main window.</li> </ul> <h3 dir="auto">Actual Behavior</h3> <p dir="auto">Nothing happens when <code class="notranslate">win.focus()</code> is called.</p> <h3 dir="auto">Testcase Gist URL</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Additional Information</h3> <p dir="auto">When running (almost) the same code as a web app (in Chrome), the focus method brings the window to the top.</p> <p dir="auto">There was a similar issue reported a few years back:<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="107679327" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/2867" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/2867/hovercard" href="https://github.com/electron/electron/issues/2867">#2867</a></p>
<ul dir="auto"> <li>Output of <code class="notranslate">node_modules/.bin/electron --version</code>: 3.0.0-beta.11 &amp;&amp; 3.0.0-beta.12</li> <li>Operating System (Platform and Version): macOS High Sierra Version 10.13.6 and Windows 10</li> <li>Output of <code class="notranslate">node_modules/.bin/electron --version</code> on last known working Electron version (if applicable): 3.0.0-beta.10</li> </ul> <p dir="auto"><strong>Expected Behavior</strong><br> In 3.0.0-beta.10, the Pepper Flash Plugin does load and does play flash videos</p> <p dir="auto"><strong>Actual behavior</strong><br> In 3.0.0-beta.11/12, the Pepper Flash Plugin does NOT load and does NOT play flash videos</p> <p dir="auto"><strong>To Reproduce</strong><br> If you provide a URL, please list the commands required to clone/setup/run your repo e.g.</p> <div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ git clone https://github.com/alexanderturinske/electron-sample-apps -b pepper-flash-test $ npm install -g [email protected] $ electron pepper-flash-plugin"><pre class="notranslate">$ git clone https://github.com/alexanderturinske/electron-sample-apps -b pepper-flash-test $ npm install -g [email protected] $ electron pepper-flash-plugin</pre></div> <p dir="auto">New window shows up and it DOES NOT show "Couldn't load plugin"<br> Close the window</p> <div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ git clone https://github.com/alexanderturinske/electron-sample-apps -b pepper-flash-test $ npm install -g [email protected] $ electron pepper-flash-plugin"><pre class="notranslate">$ git clone https://github.com/alexanderturinske/electron-sample-apps -b pepper-flash-test $ npm install -g [email protected] $ electron pepper-flash-plugin</pre></div> <p dir="auto">New window shows up and it DOES show "Couldn't load plugin"<br> <strong>Screenshots</strong><br> 3.0.0-beta.10:<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/12485238/45648393-51272b80-ba7d-11e8-9105-4962c8f83112.png"><img src="https://user-images.githubusercontent.com/12485238/45648393-51272b80-ba7d-11e8-9105-4962c8f83112.png" alt="image" style="max-width: 100%;"></a><br> 3.0.0-beta.12:<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/12485238/45648344-276e0480-ba7d-11e8-9737-1dd31571f8a6.png"><img src="https://user-images.githubusercontent.com/12485238/45648344-276e0480-ba7d-11e8-9737-1dd31571f8a6.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto"><strong>Additional Information</strong><br> Add any other context about the problem here.</p>
0
<h3 dir="auto">Preflight Checklist</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/main/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li> </ul> <h3 dir="auto">Electron Version</h3> <p dir="auto">15.1.0</p> <h3 dir="auto">What operating system are you using?</h3> <p dir="auto">Ubuntu</p> <h3 dir="auto">Operating System Version</h3> <p dir="auto">ubuntu 18.04</p> <h3 dir="auto">What arch are you using?</h3> <p dir="auto">x64</p> <h3 dir="auto">Last Known Working Electron version</h3> <p dir="auto">15.0.0</p> <h3 dir="auto">Expected Behavior</h3> <p dir="auto">When invoking a context-menu event on the webcontents of a webview in the renderer process, the function works and does not give an error.</p> <h3 dir="auto">Actual Behavior</h3> <p dir="auto">Since <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="987935764" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/30831" data-hovercard-type="pull_request" data-hovercard-url="/electron/electron/pull/30831/hovercard" href="https://github.com/electron/electron/pull/30831">#30831</a> <code class="notranslate">frame</code> is sent along with the params, but <code class="notranslate">frame</code> is not serializable so can not cross from the main process to the renderer process. This results in an error being shown to the user.</p> <h3 dir="auto">Testcase Gist URL</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Additional Information</h3> <p dir="auto">I'm aware that getting the webContents in the renderer process (using @electron/remote) is an antipattern. Still, I feel this is something we should not break in a minor release.</p>
<h3 dir="auto">Preflight Checklist</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/main/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li> </ul> <h3 dir="auto">Electron Version</h3> <p dir="auto">15.1.0 / and all 16.0.0-alpha.x</p> <h3 dir="auto">What operating system are you using?</h3> <p dir="auto">Other Linux</p> <h3 dir="auto">Operating System Version</h3> <p dir="auto">kernel 5.14.7-2</p> <h3 dir="auto">What arch are you using?</h3> <p dir="auto">x64</p> <h3 dir="auto">Last Known Working Electron version</h3> <p dir="auto">15.0.0</p> <h3 dir="auto">Expected Behavior</h3> <p dir="auto">No error occurs.</p> <h3 dir="auto">Actual Behavior</h3> <p dir="auto">The <code class="notranslate">Failed to serialize arguments</code> error occurs on right mouse click on the webview's content.</p> <h3 dir="auto">Testcase Gist URL</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Additional Information</h3> <p dir="auto">Notice there is no error when you do the right mouse click on the browserwindow's content but on webview's.</p> <p dir="auto">Notice that adding the "context-menu" handler is not even required.</p> <p dir="auto">The "input" controls were added to the snippet just for the convenience of testing. The right mouse click on any area of webview triggers the error.</p> <p dir="auto">To reproduce:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const {app, BrowserWindow} = require(&quot;electron&quot;) app.whenReady().then(() =&gt; { // app.on(&quot;web-contents-created&quot;, (...[/* event */, webContents]) =&gt; { // webContents.on(&quot;context-menu&quot;, () =&gt; {/* NOOP */}) // }) new BrowserWindow({webPreferences: {webviewTag: true}}).loadURL(`data:text/html, &lt;html&gt;&lt;body&gt; &lt;input type='text' value='input'&gt; &lt;webview src=&quot;data:text/html,&lt;input type='text' value='webview input'&gt;&quot;&gt;&lt;/webview&gt; &lt;/body&gt;&lt;/html&gt;`, ) })"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-kos">{</span>app<span class="pl-kos">,</span> BrowserWindow<span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"electron"</span><span class="pl-kos">)</span> <span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">whenReady</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-c">// app.on("web-contents-created", (...[/* event */, webContents]) =&gt; {</span> <span class="pl-c">// webContents.on("context-menu", () =&gt; {/* NOOP */})</span> <span class="pl-c">// })</span> <span class="pl-k">new</span> <span class="pl-v">BrowserWindow</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">webPreferences</span>: <span class="pl-kos">{</span><span class="pl-c1">webviewTag</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-en">loadURL</span><span class="pl-kos">(</span><span class="pl-s">`data:text/html,</span> <span class="pl-s"> &lt;html&gt;&lt;body&gt;</span> <span class="pl-s"> &lt;input type='text' value='input'&gt;</span> <span class="pl-s"> &lt;webview src="data:text/html,&lt;input type='text' value='webview input'&gt;"&gt;&lt;/webview&gt;</span> <span class="pl-s"> &lt;/body&gt;&lt;/html&gt;`</span><span class="pl-kos">,</span> <span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
1
<h4 dir="auto">When value_counts on different list value, it's ok:</h4> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="ser1 = pd.Series([[1], [2], [2]]) ser1.value_counts() [2] 2 [1] 1 dtype: int64"><pre class="notranslate"><span class="pl-s1">ser1</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([[<span class="pl-c1">1</span>], [<span class="pl-c1">2</span>], [<span class="pl-c1">2</span>]]) <span class="pl-s1">ser1</span>.<span class="pl-en">value_counts</span>() [<span class="pl-c1">2</span>] <span class="pl-c1">2</span> [<span class="pl-c1">1</span>] <span class="pl-c1">1</span> <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span></pre></div> <h4 dir="auto">But, when value_counts on unique list value, it's failed:</h4> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="ser2 = pd.Series([[1], [1], [1]]) ser2.value_counts() --------------------------------------------------------------------------- TypeError Traceback (most recent call last) &lt;ipython-input-64-845402fb8b57&gt; in &lt;module&gt;() 1 ser2 = pd.Series([[1], [1], [1]]) ----&gt; 2 ser2.value_counts() /home/centos/anaconda2/lib/python2.7/site-packages/pandas/core/base.pyc in value_counts(self, normalize, sort, ascending, bins, dropna) 945 from pandas.core.algorithms import value_counts 946 result = value_counts(self, sort=sort, ascending=ascending, --&gt; 947 normalize=normalize, bins=bins, dropna=dropna) 948 return result 949 /home/centos/anaconda2/lib/python2.7/site-packages/pandas/core/algorithms.pyc in value_counts(values, sort, ascending, normalize, bins, dropna) 276 else: 277 # ndarray path. pass original to handle DatetimeTzBlock --&gt; 278 keys, counts = _value_counts_arraylike(values, dropna=dropna) 279 280 from pandas import Index, Series /home/centos/anaconda2/lib/python2.7/site-packages/pandas/core/algorithms.pyc in _value_counts_arraylike(values, dropna) 346 values = com._ensure_object(values) 347 mask = com.isnull(values) --&gt; 348 keys, counts = htable.value_count_object(values, mask) 349 if not dropna and mask.any(): 350 keys = np.insert(keys, 0, np.NaN) pandas/hashtable.pyx in pandas.hashtable.value_count_object (pandas/hashtable.c:18970)() pandas/hashtable.pyx in pandas.hashtable.value_count_object (pandas/hashtable.c:18705)() TypeError: unhashable type: 'list'"><pre class="notranslate"><span class="pl-s1">ser2</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([[<span class="pl-c1">1</span>], [<span class="pl-c1">1</span>], [<span class="pl-c1">1</span>]]) <span class="pl-s1">ser2</span>.<span class="pl-en">value_counts</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">-</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">-</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">-</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">-</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">-</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">-</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">-</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">-</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">-</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">-</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">-</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">-</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">-</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">-</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">-</span> <span class="pl-v">TypeError</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">&lt;</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">64</span><span class="pl-c1">-</span><span class="pl-c1">845402</span><span class="pl-s1">fb8b57</span><span class="pl-c1">&gt;</span> <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>() <span class="pl-c1">1</span> <span class="pl-s1">ser2</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>([[<span class="pl-c1">1</span>], [<span class="pl-c1">1</span>], [<span class="pl-c1">1</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">&gt;</span> <span class="pl-c1">2</span> <span class="pl-s1">ser2</span>.<span class="pl-en">value_counts</span>() <span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">centos</span><span class="pl-c1">/</span><span class="pl-s1">anaconda2</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python2</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">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">base</span>.<span class="pl-s1">pyc</span> <span class="pl-c1">in</span> <span class="pl-en">value_counts</span>(<span class="pl-s1">self</span>, <span class="pl-s1">normalize</span>, <span class="pl-s1">sort</span>, <span class="pl-s1">ascending</span>, <span class="pl-s1">bins</span>, <span class="pl-s1">dropna</span>) <span class="pl-c1">945</span> <span class="pl-k">from</span> <span class="pl-s1">pandas</span>.<span class="pl-s1">core</span>.<span class="pl-s1">algorithms</span> <span class="pl-k">import</span> <span class="pl-s1">value_counts</span> <span class="pl-c1">946</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-en">value_counts</span>(<span class="pl-s1">self</span>, <span class="pl-s1">sort</span><span class="pl-c1">=</span><span class="pl-s1">sort</span>, <span class="pl-s1">ascending</span><span class="pl-c1">=</span><span class="pl-s1">ascending</span>, <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">947</span> <span class="pl-s1">normalize</span><span class="pl-c1">=</span><span class="pl-s1">normalize</span>, <span class="pl-s1">bins</span><span class="pl-c1">=</span><span class="pl-s1">bins</span>, <span class="pl-s1">dropna</span><span class="pl-c1">=</span><span class="pl-s1">dropna</span>) <span class="pl-c1">948</span> <span class="pl-k">return</span> <span class="pl-s1">result</span> <span class="pl-c1">949</span> <span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">centos</span><span class="pl-c1">/</span><span class="pl-s1">anaconda2</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python2</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">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">algorithms</span>.<span class="pl-s1">pyc</span> <span class="pl-c1">in</span> <span class="pl-en">value_counts</span>(<span class="pl-s1">values</span>, <span class="pl-s1">sort</span>, <span class="pl-s1">ascending</span>, <span class="pl-s1">normalize</span>, <span class="pl-s1">bins</span>, <span class="pl-s1">dropna</span>) <span class="pl-c1">276</span> <span class="pl-s1">else</span>: <span class="pl-c1">277</span> <span class="pl-c"># ndarray path. pass original to handle DatetimeTzBlock</span> <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">278</span> <span class="pl-s1">keys</span>, <span class="pl-s1">counts</span> <span class="pl-c1">=</span> <span class="pl-en">_value_counts_arraylike</span>(<span class="pl-s1">values</span>, <span class="pl-s1">dropna</span><span class="pl-c1">=</span><span class="pl-s1">dropna</span>) <span class="pl-c1">279</span> <span class="pl-c1">280</span> <span class="pl-k">from</span> <span class="pl-s1">pandas</span> <span class="pl-k">import</span> <span class="pl-v">Index</span>, <span class="pl-v">Series</span> <span class="pl-c1">/</span><span class="pl-s1">home</span><span class="pl-c1">/</span><span class="pl-s1">centos</span><span class="pl-c1">/</span><span class="pl-s1">anaconda2</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python2</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">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">algorithms</span>.<span class="pl-s1">pyc</span> <span class="pl-c1">in</span> <span class="pl-en">_value_counts_arraylike</span>(<span class="pl-s1">values</span>, <span class="pl-s1">dropna</span>) <span class="pl-c1">346</span> <span class="pl-s1">values</span> <span class="pl-c1">=</span> <span class="pl-s1">com</span>.<span class="pl-en">_ensure_object</span>(<span class="pl-s1">values</span>) <span class="pl-c1">347</span> <span class="pl-s1">mask</span> <span class="pl-c1">=</span> <span class="pl-s1">com</span>.<span class="pl-en">isnull</span>(<span class="pl-s1">values</span>) <span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">348</span> <span class="pl-s1">keys</span>, <span class="pl-s1">counts</span> <span class="pl-c1">=</span> <span class="pl-s1">htable</span>.<span class="pl-en">value_count_object</span>(<span class="pl-s1">values</span>, <span class="pl-s1">mask</span>) <span class="pl-c1">349</span> <span class="pl-k">if</span> <span class="pl-c1">not</span> <span class="pl-s1">dropna</span> <span class="pl-c1">and</span> <span class="pl-s1">mask</span>.<span class="pl-en">any</span>(): <span class="pl-c1">350</span> <span class="pl-s1">keys</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">insert</span>(<span class="pl-s1">keys</span>, <span class="pl-c1">0</span>, <span class="pl-s1">np</span>.<span class="pl-v">NaN</span>) <span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">hashtable</span>.<span class="pl-s1">pyx</span> <span class="pl-c1">in</span> <span class="pl-s1">pandas</span>.<span class="pl-s1">hashtable</span>.<span class="pl-en">value_count_object</span> (<span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">hashtable</span>.<span class="pl-s1">c</span>:<span class="pl-c1">18970</span>)() <span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">hashtable</span>.<span class="pl-s1">pyx</span> <span class="pl-c1">in</span> <span class="pl-s1">pandas</span>.<span class="pl-s1">hashtable</span>.<span class="pl-en">value_count_object</span> (<span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">hashtable</span>.<span class="pl-s1">c</span>:<span class="pl-c1">18705</span>)() <span class="pl-v">TypeError</span>: <span class="pl-s1">unhashable</span> <span class="pl-s1">type</span>: <span class="pl-s">'list'</span></pre></div> <h4 dir="auto">I tried 1.18.1 and 1.19.0</h4> <h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code>, 1.18.1</h4> <h2 dir="auto">INSTALLED VERSIONS</h2> <p dir="auto">commit: None<br> python: 2.7.12.final.0<br> python-bits: 64<br> OS: Linux<br> OS-release: 3.10.0-327.36.2.el7.x86_64<br> machine: x86_64<br> processor: x86_64<br> byteorder: little<br> LC_ALL: None<br> LANG: en_US.UTF-8</p> <p dir="auto">pandas: 0.18.1<br> nose: 1.3.7<br> pip: 8.1.2<br> setuptools: 27.2.0<br> Cython: 0.24.1<br> numpy: 1.11.1<br> scipy: 0.18.1<br> statsmodels: 0.6.1<br> xarray: None<br> IPython: 5.1.0<br> sphinx: 1.4.6<br> patsy: 0.4.1<br> dateutil: 2.5.3<br> pytz: 2016.6.1<br> blosc: None<br> bottleneck: 1.1.0<br> tables: 3.2.3.1<br> numexpr: 2.6.1<br> matplotlib: 1.5.3<br> openpyxl: 2.3.2<br> xlrd: 1.0.0<br> xlwt: 1.1.2<br> xlsxwriter: 0.9.3<br> lxml: 3.6.4<br> bs4: 4.5.1<br> html5lib: None<br> httplib2: None<br> apiclient: None<br> sqlalchemy: 1.0.13<br> pymysql: None<br> psycopg2: None<br> jinja2: 2.8<br> boto: 2.42.0<br> pandas_datareader: None</p> <h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code>, 1.19.0</h4> <h2 dir="auto">INSTALLED VERSIONS</h2> <p dir="auto">commit: None<br> python: 2.7.12.final.0<br> python-bits: 64<br> OS: Linux<br> OS-release: 4.4.0-45-generic<br> machine: x86_64<br> processor: x86_64<br> byteorder: little<br> LC_ALL: None<br> LANG: None<br> LOCALE: None.None</p> <p dir="auto">pandas: 0.19.0<br> nose: 1.3.7<br> pip: 8.1.2<br> setuptools: 27.2.0<br> Cython: 0.24.1<br> numpy: 1.11.2<br> scipy: 0.18.1<br> statsmodels: 0.6.1<br> xarray: None<br> IPython: 5.1.0<br> sphinx: 1.4.6<br> patsy: 0.4.1<br> dateutil: 2.5.3<br> pytz: 2016.7<br> blosc: None<br> bottleneck: 1.1.0<br> tables: 3.2.3.1<br> numexpr: 2.6.1<br> matplotlib: 1.5.3<br> openpyxl: 2.3.2<br> xlrd: 1.0.0<br> xlwt: 1.1.2<br> xlsxwriter: 0.9.3<br> lxml: 3.6.4<br> bs4: 4.5.1<br> html5lib: None<br> httplib2: None<br> apiclient: None<br> sqlalchemy: 1.0.13<br> pymysql: None<br> psycopg2: None<br> jinja2: 2.8<br> boto: 2.42.0<br> pandas_datareader: None</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="import pandas as pd"><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></pre></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="df = pd.DataFrame({'foo': [1.0001] * 5 + [0.]*5})"><pre class="notranslate"><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">'foo'</span>: [<span class="pl-c1">1.0001</span>] <span class="pl-c1">*</span> <span class="pl-c1">5</span> <span class="pl-c1">+</span> [<span class="pl-c1">0.</span>]<span class="pl-c1">*</span><span class="pl-c1">5</span>})</pre></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="df"><pre class="notranslate"><span class="pl-s1">df</span></pre></div> <div dir="auto"> <table border="1" role="table"> <thead> <tr> <th></th> <th>foo</th> </tr> </thead> <tbody> <tr> <th>0</th> <td>1.0001</td> </tr> <tr> <th>1</th> <td>1.0001</td> </tr> <tr> <th>2</th> <td>1.0001</td> </tr> <tr> <th>3</th> <td>1.0001</td> </tr> <tr> <th>4</th> <td>1.0001</td> </tr> <tr> <th>5</th> <td>0.0000</td> </tr> <tr> <th>6</th> <td>0.0000</td> </tr> <tr> <th>7</th> <td>0.0000</td> </tr> <tr> <th>8</th> <td>0.0000</td> </tr> <tr> <th>9</th> <td>0.0000</td> </tr> </tbody> </table> </div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="df.rolling(2).sum()"><pre class="notranslate"><span class="pl-s1">df</span>.<span class="pl-en">rolling</span>(<span class="pl-c1">2</span>).<span class="pl-en">sum</span>()</pre></div> <div dir="auto"> <table border="1" role="table"> <thead> <tr> <th></th> <th>foo</th> </tr> </thead> <tbody> <tr> <th>0</th> <td>NaN</td> </tr> <tr> <th>1</th> <td>2.000200e+00</td> </tr> <tr> <th>2</th> <td>2.000200e+00</td> </tr> <tr> <th>3</th> <td>2.000200e+00</td> </tr> <tr> <th>4</th> <td>2.000200e+00</td> </tr> <tr> <th>5</th> <td>1.000100e+00</td> </tr> <tr> <th>6</th> <td>4.440892e-16</td> </tr> <tr> <th>7</th> <td>4.440892e-16</td> </tr> <tr> <th>8</th> <td>4.440892e-16</td> </tr> <tr> <th>9</th> <td>4.440892e-16</td> </tr> </tbody> </table> </div> <h4 dir="auto">Problem description</h4> <p dir="auto">Rolling sum of zeros sometimes gives a very small negative number, which is not the desired behavior.</p> <h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4> <details> <h2 dir="auto">INSTALLED VERSIONS</h2> <p dir="auto">commit: None<br> python: 3.5.4.final.0<br> python-bits: 64<br> OS: Linux<br> OS-release: 4.1.35-pv-ts2<br> machine: x86_64<br> processor:<br> byteorder: little<br> LC_ALL: en_US.utf8<br> LANG: en_US.utf8<br> LOCALE: en_US.UTF-8</p> <p dir="auto">pandas: 0.20.3<br> pytest: 3.2.1<br> pip: 9.0.1<br> setuptools: 36.4.0<br> Cython: 0.26<br> numpy: 1.12.1<br> scipy: 0.19.1<br> xarray: None<br> IPython: 6.1.0<br> sphinx: 1.6.3<br> patsy: 0.4.1<br> dateutil: 2.6.1<br> pytz: 2017.2<br> blosc: None<br> bottleneck: 1.2.1<br> tables: 3.4.2<br> numexpr: 2.6.2<br> feather: None<br> matplotlib: 2.0.2<br> openpyxl: 2.4.8<br> xlrd: 1.1.0<br> xlwt: None<br> xlsxwriter: 0.9.8<br> lxml: None<br> bs4: 4.6.0<br> html5lib: 0.9999999<br> sqlalchemy: 1.1.13<br> pymysql: None<br> psycopg2: None<br> jinja2: 2.9.6<br> s3fs: None<br> pandas_gbq: None<br> pandas_datareader: None</p> </details>
0
<p dir="auto">The change to <code class="notranslate">utils/template.py</code> introduced in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="23297467" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/5059" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/5059/hovercard" href="https://github.com/ansible/ansible/issues/5059">#5059</a> swallows errors about variable lookups. This causes unexpected issues later on. In my case a file is unexpectedly empty without an error.</p> <p dir="auto">I think AnsibleErrors should be passed on like this::</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def lookup(name, *args, **kwargs): from ansible import utils instance = utils.plugins.lookup_loader.get(name.lower(), basedir=kwargs.get('basedir',None)) vars = kwargs.get('vars', None) if instance is not None: # safely catch run failures per #5059 try: ran = instance.run(*args, inject=vars, **kwargs) except errors.AnsibleError: raise except Exception, e: ran = None if ran: ran = &quot;,&quot;.join(ran) return ran else: raise errors.AnsibleError(&quot;lookup plugin (%s) not found&quot; % name)"><pre class="notranslate"><code class="notranslate">def lookup(name, *args, **kwargs): from ansible import utils instance = utils.plugins.lookup_loader.get(name.lower(), basedir=kwargs.get('basedir',None)) vars = kwargs.get('vars', None) if instance is not None: # safely catch run failures per #5059 try: ran = instance.run(*args, inject=vars, **kwargs) except errors.AnsibleError: raise except Exception, e: ran = None if ran: ran = ",".join(ran) return ran else: raise errors.AnsibleError("lookup plugin (%s) not found" % name) </code></pre></div> <p dir="auto">That way typos in variable names or in the file name show up again.</p>
<h5 dir="auto">Issue Type:</h5> <p dir="auto">Bug Report</p> <h5 dir="auto">Ansible Version:</h5> <p dir="auto">ansible 1.7 (devel <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/a6a1e240c68e935b9afde6b85f64ee9820db2dea/hovercard" href="https://github.com/ansible/ansible/commit/a6a1e240c68e935b9afde6b85f64ee9820db2dea"><tt>a6a1e24</tt></a>) last updated 2014/05/12 10:59:56 (GMT -400)</p> <p dir="auto">This happens in 1.6 as well.</p> <h5 dir="auto">Environment:</h5> <p dir="auto">OSX 10.9.2</p> <h5 dir="auto">Summary:</h5> <p dir="auto">Errors in templates are not propagated when using the template lookup plugin, which returns an empty string instead. Errors in these templates can be very difficult to debug as a result.</p> <h5 dir="auto">Steps To Reproduce:</h5> <p dir="auto">ansible-playbook -vvv -i inventory/local pb_test.yml</p> <p dir="auto"><a href="https://gist.github.com/scottanderson42/c1d172aa56916a258ff1">https://gist.github.com/scottanderson42/c1d172aa56916a258ff1</a></p> <h5 dir="auto">Expected Results:</h5> <p dir="auto">The first task should fail as the variable does_not_exist is not set.</p> <h5 dir="auto">Actual Results:</h5> <p dir="auto">The lookup task returns an empty string when the variable is not set instead of failing.</p> <p dir="auto">(sp_devops)GoatRodeo:devops anderson (development)$ ansible-playbook -vvv -i inventory/local pb_test.yml</p> <p dir="auto">PLAY [127.0.0.1] **************************************************************</p> <p dir="auto">TASK: [debug msg=] ************************************************************<br> ok: [127.0.0.1] =&gt; {<br> "msg": ""<br> }</p> <p dir="auto">PLAY [127.0.0.1] **************************************************************</p> <p dir="auto">TASK: [debug msg=This does not exist: 42<br> ] ************************************<br> ok: [127.0.0.1] =&gt; {<br> "msg": "This"<br> }</p> <p dir="auto">PLAY RECAP ********************************************************************<br> 127.0.0.1 : ok=2 changed=0 unreachable=0 failed=0</p>
1
<p dir="auto"><code class="notranslate">Promise&lt;Derived&gt;</code> is assignable to <code class="notranslate">Promise&lt;Base&gt;</code> (good), but <code class="notranslate">Promise&lt;Base&gt;</code> is also assignable to <code class="notranslate">Promise&lt;Derived&gt;</code> (bad - should require a cast)</p> <p dir="auto">This weakens type checking, especially since it's so easy to accidentally create <code class="notranslate">Promise&lt;{}&gt;</code> which is assignable to any other <code class="notranslate">Promise</code>:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function f() { return new Promise(resolve =&gt; { resolve(1); }); // oops, this has a return type of Promise&lt;{}&gt; } function g(p: Promise&lt;string&gt;) { /* ... */ } g(f()); // Allowed due to contravariance!"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">f</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-smi">Promise</span><span class="pl-kos">(</span><span class="pl-s1">resolve</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// oops, this has a return type of Promise&lt;{}&gt;</span> <span class="pl-kos">}</span> <span class="pl-k">function</span> <span class="pl-en">g</span><span class="pl-kos">(</span><span class="pl-s1">p</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi">string</span><span class="pl-kos">&gt;</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">/* ... */</span> <span class="pl-kos">}</span> <span class="pl-en">g</span><span class="pl-kos">(</span><span class="pl-en">f</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">// Allowed due to contravariance!</span></pre></div> <p dir="auto">It's possible to work around this by extending the Promise interface with a dummy property:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface Promise&lt;T&gt; { _assignabilityHack: T }"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">Promise</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-c1">_assignabilityHack</span>: <span class="pl-smi">T</span> <span class="pl-kos">}</span></pre></div>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var as: ArrayLike&lt;number | string&gt; = &lt;ArrayLike&lt;string&gt;&gt;null; var an: ArrayLike&lt;number&gt; = &lt;ArrayLike&lt;number | string&gt;&gt;as; // detect incompatibility var ps: PromiseLike&lt;number | string&gt; = &lt;PromiseLike&lt;string&gt;&gt;null; var pn: PromiseLike&lt;number&gt; = &lt;PromiseLike&lt;number | string&gt;&gt;ps; // cannot detect"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">as</span>: <span class="pl-smi">ArrayLike</span><span class="pl-kos">&lt;</span><span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span><span class="pl-kos">&gt;</span> <span class="pl-c1">=</span> <span class="pl-kos">&lt;</span><span class="pl-smi">ArrayLike</span><span class="pl-kos">&lt;</span><span class="pl-smi">string</span><span class="pl-kos">&gt;</span><span class="pl-kos">&gt;</span><span class="pl-c1">null</span><span class="pl-kos">;</span> <span class="pl-k">var</span> <span class="pl-s1">an</span>: <span class="pl-smi">ArrayLike</span><span class="pl-kos">&lt;</span><span class="pl-smi">number</span><span class="pl-kos">&gt;</span> <span class="pl-c1">=</span> <span class="pl-kos">&lt;</span><span class="pl-smi">ArrayLike</span><span class="pl-kos">&lt;</span><span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span><span class="pl-kos">&gt;</span><span class="pl-kos">&gt;</span><span class="pl-s1">as</span><span class="pl-kos">;</span> <span class="pl-c">// detect incompatibility</span> <span class="pl-k">var</span> <span class="pl-s1">ps</span>: <span class="pl-smi">PromiseLike</span><span class="pl-kos">&lt;</span><span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span><span class="pl-kos">&gt;</span> <span class="pl-c1">=</span> <span class="pl-kos">&lt;</span><span class="pl-smi">PromiseLike</span><span class="pl-kos">&lt;</span><span class="pl-smi">string</span><span class="pl-kos">&gt;</span><span class="pl-kos">&gt;</span><span class="pl-c1">null</span><span class="pl-kos">;</span> <span class="pl-k">var</span> <span class="pl-s1">pn</span>: <span class="pl-smi">PromiseLike</span><span class="pl-kos">&lt;</span><span class="pl-smi">number</span><span class="pl-kos">&gt;</span> <span class="pl-c1">=</span> <span class="pl-kos">&lt;</span><span class="pl-smi">PromiseLike</span><span class="pl-kos">&lt;</span><span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span><span class="pl-kos">&gt;</span><span class="pl-kos">&gt;</span><span class="pl-s1">ps</span><span class="pl-kos">;</span> <span class="pl-c">// cannot detect</span></pre></div> <p dir="auto">We must add the following additional definition to detect the incompatibility of <code class="notranslate">PromiseLike</code>, like a <code class="notranslate">ArrayLike</code>.</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface PromiseLike&lt;T&gt; { _?: T; }"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">PromiseLike</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-c1">_</span>?: <span class="pl-smi">T</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface PromiseLike&lt;T&gt; { _?: T; } var ps: PromiseLike&lt;number | string&gt; = &lt;PromiseLike&lt;string&gt;&gt;null; var pn: PromiseLike&lt;number&gt; = &lt;PromiseLike&lt;number | string&gt;&gt;ps; // detect incompatibility"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">PromiseLike</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-c1">_</span>?: <span class="pl-smi">T</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">var</span> <span class="pl-s1">ps</span>: <span class="pl-smi">PromiseLike</span><span class="pl-kos">&lt;</span><span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span><span class="pl-kos">&gt;</span> <span class="pl-c1">=</span> <span class="pl-kos">&lt;</span><span class="pl-smi">PromiseLike</span><span class="pl-kos">&lt;</span><span class="pl-smi">string</span><span class="pl-kos">&gt;</span><span class="pl-kos">&gt;</span><span class="pl-c1">null</span><span class="pl-kos">;</span> <span class="pl-k">var</span> <span class="pl-s1">pn</span>: <span class="pl-smi">PromiseLike</span><span class="pl-kos">&lt;</span><span class="pl-smi">number</span><span class="pl-kos">&gt;</span> <span class="pl-c1">=</span> <span class="pl-kos">&lt;</span><span class="pl-smi">PromiseLike</span><span class="pl-kos">&lt;</span><span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span><span class="pl-kos">&gt;</span><span class="pl-kos">&gt;</span><span class="pl-s1">ps</span><span class="pl-kos">;</span> <span class="pl-c">// detect incompatibility</span></pre></div> <p dir="auto">This behavior is the spec, but this incompleteness is unfavorable.</p>
1
<p dir="auto">Hi,<br> I used VS Code since it launched, one of the feature i loved so much is the intellisense while adding a file using require when coding for node js.</p> <p dir="auto">After the latest update (Version: 0.10.8, Shell: 0.35.6) require intellisense is not working at all, it always says 'No suggestions'</p> <p dir="auto">Can someone help me to get the intellisense for 'require' command.</p>
<p dir="auto">One of the features that I really liked with vscode was the folder path intellisense inside require('path') while doing NodeJs development. Now I just see a list of global variables. I don't use the new salsa, and I'm targeting ES5.</p> <p dir="auto">Something that might be worth mentioning is that the intellisense of the required modules is working as before.</p>
1
<p dir="auto"><a href="https://webpack.github.io/docs/list-of-plugins.html#provideplugin" rel="nofollow">ProvidePlugin</a> can only be used for default exports, the example in the doc is jQuery.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="new webpack.ProvidePlugin({ $: &quot;jquery&quot; })"><pre class="notranslate"><span class="pl-k">new</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">ProvidePlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">$</span>: <span class="pl-s">"jquery"</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p dir="auto">However if you're using libraries with named exports, like <code class="notranslate">preact</code> you're out of luck</p> <p dir="auto">Hello world with preact:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { h, render } from 'preact'; render( &lt;span&gt;Hello, world!&lt;/span&gt;, document.body );"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">h</span><span class="pl-kos">,</span> <span class="pl-s1">render</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'preact'</span><span class="pl-kos">;</span> <span class="pl-en">render</span><span class="pl-kos">(</span> <span class="pl-c1">&lt;</span><span class="pl-ent">span</span><span class="pl-c1">&gt;</span>Hello, world!<span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">span</span><span class="pl-c1">&gt;</span><span class="pl-kos">,</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-c1">body</span> <span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">The variable <code class="notranslate">h</code> is never used in the source file but it's needed because babel transpiles jsx into <code class="notranslate">h()</code> calls.</p> <p dir="auto">Ideally one would only write <code class="notranslate">import { render } from 'preact';</code> and then use <code class="notranslate">ProvidePlugin</code> to inject the import for <code class="notranslate">h</code>.</p> <p dir="auto">Maybe something like</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="new webpack.ProvidePlugin({ h: [&quot;preact&quot;, &quot;h&quot;] // &lt;- module name becomes an array })"><pre class="notranslate"><span class="pl-k">new</span> <span class="pl-s1">webpack</span><span class="pl-kos">.</span><span class="pl-c1">ProvidePlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">h</span>: <span class="pl-kos">[</span><span class="pl-s">"preact"</span><span class="pl-kos">,</span> <span class="pl-s">"h"</span><span class="pl-kos">]</span> <span class="pl-c">// &lt;- module name becomes an array</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p dir="auto">The <a href="https://github.com/developit/preact-boilerplate">preact-boilerplate</a> imports <code class="notranslate">h</code> in every file and then defines an eslint rule to disable the unused error <code class="notranslate">"no-unused-vars": [0, { "varsIgnorePattern": "^h$" }]</code>.</p> <p dir="auto"><a href="https://github.com/rollup/rollup-plugin-inject">rollup-plugin-inject</a> allows named exports</p>
<p dir="auto">I think it will be suitable to provide version of expression to ProvidePlugin to import PROPERTY of module</p> <p dir="auto">For example:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" new webpack.ProvidePlugin({ 'variable': [&quot;npm-module&quot;,&quot;variable&quot;] })"><pre class="notranslate"><code class="notranslate"> new webpack.ProvidePlugin({ 'variable': ["npm-module","variable"] }) </code></pre></div> <p dir="auto">in this case it is resolved as require("npm-module")["variable"]</p> <p dir="auto"><strong>Webpack version:</strong><br> 2 latest NPM</p> <p dir="auto"><strong>Please tell us about your environment:</strong><br> Windows 10</p>
1
<h3 dir="auto">Summary of the new feature/enhancement</h3> <p dir="auto">In Windows Snap, when unsnapping the window, it returns to its previous size. Would like the same feature (maybe as an option) for zones when exiting a zone.</p>
<h1 dir="auto">Summary of the new feature/enhancement</h1> <p dir="auto">User has a Surface PRO and Surface Dock for work. Often attends meetings and thus takes the Surface PRO with them. This means disconnecting and reconnecting to monitor(s) many times per day. Currently this requires moving windows back to desired position with every reconnect. On rare occasion, Windows has a bug where when you reconnect the monitor, windows are not visible but they are open. You have to press ALT+Space, Move and then use the arrow keys to get the window back into a visible portion of the screen so you can move it with the mouse again.</p> <p dir="auto">It would be immensely helpful if FancyZones would restore windows to their saved zone when monitors are connected to the computer. This would save time and it would be a great work-around for the Windows bug I mention above.</p> <h1 dir="auto">Proposed technical implementation details (optional)</h1> <ol dir="auto"> <li>User sets up FancyZones on Surface screen (e.g., 1 Grid Zone; let's call that Zone 0) and on other monitor (e.g., 2 Grid Zone; let's call these Zone 1 and 2).</li> <li>User moves Slack app to Zone 0, Edge to Zone 1, Mail to Zone 2.</li> <li>EXPECTED : If user restarts while still connected to the Surface Dock, upon reboot and opening of same apps, they will return to their assigned Zones.</li> <li>User disconnects from Surface Dock. Now only Zone 0 exists so FancyZones moves all apps to Zone 0.</li> <li>User connects to Surface Dock. External monitor comes back on. FancyZones detects the monitor is available again, and restores Zone 1 and Zone 2 to that monitor and then moves the apps that had been in Zone 1 and Zone 2 back into their position.</li> </ol>
0
<p dir="auto">I have post the issue to <a href="https://github.com/tensorflow/tensorflow/issues/50718" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/50718/hovercard">tensorflow</a>,and they suggest I post the issue here.</p>
<p dir="auto">I have post the issue to <a href="https://github.com/tensorflow/tensorflow/issues/50718" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/50718/hovercard">tensorflow</a>,and they suggest I post the issue here.</p> <p dir="auto">I'm using MacBook Air with M1 chip. OS version is Big Sur 11.4.<br> <code class="notranslate">which python</code><br> <code class="notranslate">/Users/dmitry/Applications/Miniforge3/bin/python</code><br> I run the following code using <a href="https://developer.apple.com/metal/tensorflow-plugin/" rel="nofollow">tensorflow-macos</a> and <a href="https://github.com/apple/tensorflow_macos">tensorflow_macos</a>, respectively.<br> <code class="notranslate">import tensorflow as tf</code><br> <code class="notranslate">mnist = tf.keras.datasets.mnist</code><br> <code class="notranslate">(x_train, y_train), (x_test, y_test) = mnist.load_data()</code><br> <code class="notranslate">x_train, x_test = x_train / 255.0, x_test / 255.0</code><br> <code class="notranslate">model = tf.keras.models.Sequential([</code><br> <code class="notranslate"> tf.keras.layers.Flatten(input_shape=(28, 28)),</code><br> <code class="notranslate"> tf.keras.layers.Dense(128, activation='relu'),</code><br> <code class="notranslate"> tf.keras.layers.Dropout(0.2),</code><br> <code class="notranslate"> tf.keras.layers.Dense(10)</code><br> <code class="notranslate">])</code><br> <code class="notranslate">predictions = model(x_train[:1]).numpy()</code><br> <code class="notranslate">tf.nn.softmax(predictions).numpy()</code><br> <code class="notranslate">loss_fn = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)</code><br> <code class="notranslate">loss_fn(y_train[:1], predictions).numpy()</code><br> <code class="notranslate">model.compile(optimizer = 'sgd', loss = loss_fn)</code><br> <code class="notranslate">model.fit(x_train, y_train, epochs=100)</code></p> <p dir="auto">I got this! with <a href="https://developer.apple.com/metal/tensorflow-plugin/" rel="nofollow">tensorflow-macos</a> and python3.9:<br> 1875/1875 [==============================] - 8s 4ms/step - loss: 0.7026<br> Epoch 2/100<br> 1875/1875 [==============================] - 8s 4ms/step - loss: 0.3872<br> Epoch 3/100<br> 1875/1875 [==============================] - 8s 4ms/step - loss: 0.3284<br> Epoch 4/100<br> 1875/1875 [==============================] - 8s 4ms/step - loss: 0.2891<br> Epoch 5/100<br> 1875/1875 [==============================] - 8s 4ms/step - loss: 0.2622</p> <p dir="auto">with <a href="https://github.com/apple/tensorflow_macos">tensorflow_macos</a> and python3.8 env:<br> Epoch 1/100<br> 1875/1875 [==============================] - 1s 276us/step - loss: 1.2181<br> Epoch 2/100<br> 1875/1875 [==============================] - 1s 270us/step - loss: 0.4678<br> Epoch 3/100<br> 1875/1875 [==============================] - 1s 269us/step - loss: 0.3935<br> Epoch 4/100<br> 1875/1875 [==============================] - 1s 271us/step - loss: 0.3507<br> Epoch 5/100<br> 1875/1875 [==============================] - 1s 270us/step - loss: 0.3231</p> <p dir="auto">Why <a href="https://developer.apple.com/metal/tensorflow-plugin/" rel="nofollow">tensorflow-macos</a> is so slower than <a href="https://github.com/apple/tensorflow_macos">tensorflow_macos</a>?Did I miss something?</p>
1
<p dir="auto">Using and example code from <a href="http://www.html5rocks.com/" rel="nofollow">http://www.html5rocks.com/</a> in the body of my index.html. Don't show the bubble when i click the button (the input change the focus and the border glow but don't show the bubble).</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;form&gt; &lt;input type=&quot;text&quot; required value=&quot;&quot; /&gt; &lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt; &lt;/form&gt;"><pre class="notranslate"><code class="notranslate">&lt;form&gt; &lt;input type="text" required value="" /&gt; &lt;input type="submit" value="Submit" /&gt; &lt;/form&gt; </code></pre></div> <p dir="auto">The buble that don't show with Electron:<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/6ca25d66f99c7e29ebe4955a2546b71cc7a7e98c23df11d7b22c4060527a1d05/687474703a2f2f7777772e68746d6c35726f636b732e636f6d2f7374617469632f696d616765732f7475746f7269616c732f636f6e73747261696e7476616c69646174696f6e2f4368726f6d652e706e67"><img src="https://camo.githubusercontent.com/6ca25d66f99c7e29ebe4955a2546b71cc7a7e98c23df11d7b22c4060527a1d05/687474703a2f2f7777772e68746d6c35726f636b732e636f6d2f7374617469632f696d616765732f7475746f7269616c732f636f6e73747261696e7476616c69646174696f6e2f4368726f6d652e706e67" alt="Bubble" data-canonical-src="http://www.html5rocks.com/static/images/tutorials/constraintvalidation/Chrome.png" style="max-width: 100%;"></a></p> <p dir="auto">I'm using the prebuild v0.209 from: <a href="https://github.com/atom/atom/releases/tag/v0.209.0">https://github.com/atom/atom/releases/tag/v0.209.0</a></p>
<p dir="auto">Atom shell currently does not support HTML5 form validation notifications -- client side form validation is supported and you cannot submit invalid form entries, however, there is no visual cue or notification for invalid entries as there is in most browsers (see image below).</p> <p dir="auto">Is support for this planned?</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/3952537/4208326/3b7cc960-385f-11e4-847a-f52e076a5753.png"><img src="https://cloud.githubusercontent.com/assets/3952537/4208326/3b7cc960-385f-11e4-847a-f52e076a5753.png" alt="" style="max-width: 100%;"></a></p>
1
<p dir="auto">I'm using the v1.0.1 pre-release.</p> <p dir="auto">I've created a single machine cluster (v0.19.3) using the <code class="notranslate">KUBERNETES_PROVIDER=ubuntu ./kube-up.sh</code> command. It started normally.<br> Then I tried to start the Heapster on the "cluster":</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="wicked@w:~/docker/kubernetes $ kubectl create -f cluster/addons/cluster-monitoring/influxdb --namespace=kube-system services/monitoring-grafana replicationcontrollers/monitoring-heapster-v5 services/monitoring-heapster replicationcontrollers/monitoring-influx-grafana-v1 services/monitoring-influxdb"><pre class="notranslate"><code class="notranslate">wicked@w:~/docker/kubernetes $ kubectl create -f cluster/addons/cluster-monitoring/influxdb --namespace=kube-system services/monitoring-grafana replicationcontrollers/monitoring-heapster-v5 services/monitoring-heapster replicationcontrollers/monitoring-influx-grafana-v1 services/monitoring-influxdb </code></pre></div> <p dir="auto">It has created 5 docker containers running:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="a8b397bb47d1 gcr.io/google_containers/heapster_grafana:v0.7 &quot;/kuisp -p 8080 -c / 9 minutes ago Up 9 minutes k8s_grafana.7ff9ddef_monitoring-influx-grafana-v1-xumof_kube-system_efec7e43-2f69-11e5-9ca4-005056010186_d3fc3378 78ce40555bb7 gcr.io/google_containers/heapster_influxdb:v0.3 &quot;/run.sh&quot; 9 minutes ago Up 9 minutes k8s_influxdb.787acd0e_monitoring-influx-grafana-v1-xumof_kube-system_efec7e43-2f69-11e5-9ca4-005056010186_03ef2fc5 5bf518831100 gcr.io/google_containers/heapster:v0.16.0 &quot;/heapster --source= 9 minutes ago Up 9 minutes k8s_heapster.8972800b_monitoring-heapster-v5-jy7o5_kube-system_efd4cc8c-2f69-11e5-9ca4-005056010186_4f1014d0 c5d90b64aca7 gcr.io/google_containers/pause:0.8.0 &quot;/pause&quot; 9 minutes ago Up 9 minutes 0.0.0.0:8083-&gt;8083/tcp, 0.0.0.0:8086-&gt;8086/tcp k8s_POD.fc880c63_monitoring-influx-grafana-v1-xumof_kube-system_efec7e43-2f69-11e5-9ca4-005056010186_46d51def c63dbddfd38d gcr.io/google_containers/pause:0.8.0 &quot;/pause&quot; 9 minutes ago Up 9 minutes k8s_POD.e4cc795_monitoring-heapster-v5-jy7o5_kube-system_efd4cc8c-2f69-11e5-9ca4-005056010186_a34b8057 "><pre class="notranslate"><code class="notranslate">a8b397bb47d1 gcr.io/google_containers/heapster_grafana:v0.7 "/kuisp -p 8080 -c / 9 minutes ago Up 9 minutes k8s_grafana.7ff9ddef_monitoring-influx-grafana-v1-xumof_kube-system_efec7e43-2f69-11e5-9ca4-005056010186_d3fc3378 78ce40555bb7 gcr.io/google_containers/heapster_influxdb:v0.3 "/run.sh" 9 minutes ago Up 9 minutes k8s_influxdb.787acd0e_monitoring-influx-grafana-v1-xumof_kube-system_efec7e43-2f69-11e5-9ca4-005056010186_03ef2fc5 5bf518831100 gcr.io/google_containers/heapster:v0.16.0 "/heapster --source= 9 minutes ago Up 9 minutes k8s_heapster.8972800b_monitoring-heapster-v5-jy7o5_kube-system_efd4cc8c-2f69-11e5-9ca4-005056010186_4f1014d0 c5d90b64aca7 gcr.io/google_containers/pause:0.8.0 "/pause" 9 minutes ago Up 9 minutes 0.0.0.0:8083-&gt;8083/tcp, 0.0.0.0:8086-&gt;8086/tcp k8s_POD.fc880c63_monitoring-influx-grafana-v1-xumof_kube-system_efec7e43-2f69-11e5-9ca4-005056010186_46d51def c63dbddfd38d gcr.io/google_containers/pause:0.8.0 "/pause" 9 minutes ago Up 9 minutes k8s_POD.e4cc795_monitoring-heapster-v5-jy7o5_kube-system_efd4cc8c-2f69-11e5-9ca4-005056010186_a34b8057 </code></pre></div> <p dir="auto">But the heapster container repeatedly reports an error:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="E0721 05:48:45.733960 1 reflector.go:136] Failed to list *api.Node: Get https://192.168.0.2:443/api/v1/nodes: x509: failed to load system roots and no roots provided E0721 05:48:45.954969 1 reflector.go:136] Failed to list *api.Pod: Get https://192.168.0.2:443/api/v1/pods?fieldSelector=spec.nodeName%21%3D: x509: failed to load system roots and no roots provided E0721 05:48:46.385188 1 reflector.go:136] Failed to list *api.Namespace: Get https://192.168.0.2:443/api/v1/namespaces: x509: failed to load system roots and no roots provided"><pre class="notranslate"><code class="notranslate">E0721 05:48:45.733960 1 reflector.go:136] Failed to list *api.Node: Get https://192.168.0.2:443/api/v1/nodes: x509: failed to load system roots and no roots provided E0721 05:48:45.954969 1 reflector.go:136] Failed to list *api.Pod: Get https://192.168.0.2:443/api/v1/pods?fieldSelector=spec.nodeName%21%3D: x509: failed to load system roots and no roots provided E0721 05:48:46.385188 1 reflector.go:136] Failed to list *api.Namespace: Get https://192.168.0.2:443/api/v1/namespaces: x509: failed to load system roots and no roots provided </code></pre></div>
<p dir="auto">heapster is not able to connect to kube-apimaster in case of self signed certificate and there is no way to provide ca.crt file as parameter no disable ssl check.<br> I'm using:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="I0720 10:50:47.268679 1 heapster.go:52] /heapster --source=kubernetes:'' --sink=influxdb:http://monitoring-influxdb:8086 --poll_duration=2m --stats_resolution=1m I0720 10:50:47.268713 1 heapster.go:53] Heapster version 0.16.0"><pre class="notranslate"><code class="notranslate">I0720 10:50:47.268679 1 heapster.go:52] /heapster --source=kubernetes:'' --sink=influxdb:http://monitoring-influxdb:8086 --poll_duration=2m --stats_resolution=1m I0720 10:50:47.268713 1 heapster.go:53] Heapster version 0.16.0 </code></pre></div> <p dir="auto">with kubernetes 1.0.1</p>
1
<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">0.18.5</p> <h3 dir="auto">Meta database</h3> <p dir="auto">MySQL</p> <h3 dir="auto">Expected results</h3> <p dir="auto">No error</p> <h3 dir="auto">Actual results</h3> <p dir="auto">Has an error</p> <h3 dir="auto">Steps to reproduce</h3> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/16470564/28707152-ca45643a-73a9-11e7-8b9b-5df98f6d476f.png"><img src="https://user-images.githubusercontent.com/16470564/28707152-ca45643a-73a9-11e7-8b9b-5df98f6d476f.png" alt="1" style="max-width: 100%;"></a><br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/16470564/28707159-d2057962-73a9-11e7-88c9-7b42509189ff.png"><img src="https://user-images.githubusercontent.com/16470564/28707159-d2057962-73a9-11e7-88c9-7b42509189ff.png" alt="2" style="max-width: 100%;"></a><br> The error is:<br> _OperationalError: (<em>mysql_exceptions.OperationalError) (1054, "Unknown column 'created_by' in 'order clause'") [SQL: u'SELECT dashboards.created_on AS dashboards_created_on, dashboards.changed_on AS dashboards_changed_on, dashboards.id AS dashboards_id, dashboards.dashboard_title AS dashboards_dashboard_title, dashboards.position_json AS dashboards_position_json, dashboards.description AS dashboards_description, dashboards.css AS dashboards_css, dashboards.json_metadata AS dashboards_json_metadata, dashboards.slug AS dashboards_slug, dashboards.changed_by_fk AS dashboards_changed_by_fk, dashboards.created_by_fk AS dashboards_created_by_fk \nFROM dashboards ORDER BY created_by asc \n LIMIT %s'] [parameters: (100,)]</em></p> <p dir="auto">My tested result :<br> "ORDER BY <strong>created_on</strong>" is work。<br> “dbs” table has “created_on” field instead of “created_by”.</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" 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.18.5<br> python 3.4<br> mysql: 5.7.18</p> <h3 dir="auto">Expected results</h3> <p dir="auto">Can be sorted by "Database" successfully</p> <h3 dir="auto">Actual results</h3> <p dir="auto">Throw Error:<br> sqlalchemy.exc.ProgrammingError: (_mysql_exceptions.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc \n LIMIT 100' at line 2") [SQL: 'SELECT <code class="notranslate">tables</code>.created_on AS tables_created_on, <code class="notranslate">tables</code>.changed_on AS tables_changed_on, <code class="notranslate">tables</code>.id AS tables_id, <code class="notranslate">tables</code>.description AS tables_description, <code class="notranslate">tables</code>.default_endpoint AS tables_default_endpoint, <code class="notranslate">tables</code>.is_featured AS tables_is_featured, <code class="notranslate">tables</code>.filter_select_enabled AS tables_filter_select_enabled, <code class="notranslate">tables</code>.offset AS tables_offset, <code class="notranslate">tables</code>.cache_timeout AS tables_cache_timeout, <code class="notranslate">tables</code>.params AS tables_params, <code class="notranslate">tables</code>.perm AS tables_perm, <code class="notranslate">tables</code>.table_name AS tables_table_name, <code class="notranslate">tables</code>.main_dttm_col AS tables_main_dttm_col, <code class="notranslate">tables</code>.database_id AS tables_database_id, <code class="notranslate">tables</code>.fetch_values_predicate AS tables_fetch_values_predicate, <code class="notranslate">tables</code>.user_id AS tables_user_id, <code class="notranslate">tables</code>.<code class="notranslate">schema</code> AS tables_schema, <code class="notranslate">tables</code>.<code class="notranslate">sql</code> AS tables_sql, <code class="notranslate">tables</code>.created_by_fk AS tables_created_by_fk, <code class="notranslate">tables</code>.changed_by_fk AS tables_changed_by_fk \nFROM <code class="notranslate">tables</code> ORDER BY database asc \n LIMIT %s'] [parameters: (100,)]</p> <h3 dir="auto">Steps to reproduce</h3> <ol dir="auto"> <li>Use admin user to login Superset</li> <li>Click navigation menu "Sources", then click sub menu "Tables"</li> <li>Click table header "Database"</li> </ol>
1
<p dir="auto">In order to support understanding (rare, but possible) SEGFAULT, OOM, etc, in AOT Dart code we will likely to want to support symbol generation for gen_snapshot, etc.</p> <p dir="auto">I don't know what the contract is for AOT dart code (is it supposed to be able to crash this way?) but it seems like this may be useful?</p> <p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/a-siva/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/a-siva">@a-siva</a> may already have a bug on file for this, but I didn't find it in a quick search so here is one.</p>
<p dir="auto">This request comes from customer:fast. They're getting crash logs from their production app (via package:logging) but no line numbers in --release builds. If possible, they would like line numbers.</p> <p dir="auto">Possible? <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/a-siva/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/a-siva">@a-siva</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zanderso/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zanderso">@zanderso</a>?</p>
1
<h1 dir="auto">Summary of the new feature/enhancement</h1> <p dir="auto">Add an option to enter a custom window resolution in the FancyZones editor.</p> <p dir="auto">So users <em>(who use FancyZones for resizing windows)</em> can add their preferred zone resolution Like (1024x576) or (1080x720) <em>in a Text-box for example.</em></p> <h1 dir="auto">Proposed technical implementation details (optional)</h1> <p dir="auto">When edit my custom FancyZones layout. A text-box appears on the zone that allow me to enter a preferred zone size. (or maybe add it as a right click option)</p> <p dir="auto"><em>A screenshot concept: <a href="https://imgur.com/a/3o0L7am" rel="nofollow">https://imgur.com/a/3o0L7am</a></em></p>
<h1 dir="auto">Summary of the new feature/enhancement</h1> <p dir="auto">Sizing of custom zones in editor by dragging mouse is a little bit coarse (hit and miss) in terms of getting close to edges of screen symmetrically and allowing window edges of multiple zones to line up neatly. Some possible solutions are suggested for consideration.</p> <h1 dir="auto">Proposed technical implementation details (optional)</h1> <ol dir="auto"> <li> <p dir="auto">Perhaps have an option for the editor to snap to a grid of user specified n pixels.</p> </li> <li> <p dir="auto">Perhaps have optional ability to input window dimension and position directly in both absolute terms (n x n pixels) and in terms of percentage of screen width and height.</p> </li> </ol>
1
<p dir="auto">NOTE: Only file GitHub issues for bugs and feature requests. All other topics will be closed.</p> <p dir="auto">For general support from the community, see <a href="https://stackoverflow.com/questions/tagged/tensorflow" rel="nofollow">StackOverflow</a>.<br> To make bugs and feature requests more easy to find and organize, we close issues that are deemed<br> out of scope for GitHub Issues and point people to StackOverflow.</p> <p dir="auto">For bugs or installation issues, please provide the following information.<br> The more information you provide, the more easily we will be able to offer<br> help and advice.</p> <h3 dir="auto">What related GitHub issues or StackOverflow threads have you found by searching the web for your problem?</h3> <h3 dir="auto">Environment info</h3> <p dir="auto">Operating System:</p> <p dir="auto">Installed version of CUDA and cuDNN:<br> (please attach the output of <code class="notranslate">ls -l /path/to/cuda/lib/libcud*</code>):</p> <p dir="auto">If installed from binary pip package, provide:</p> <ol dir="auto"> <li>A link to the pip package you installed:</li> <li>The output from <code class="notranslate">python -c "import tensorflow; print(tensorflow.__version__)"</code>.</li> </ol> <p dir="auto">If installed from source, provide</p> <ol dir="auto"> <li>The commit hash (<code class="notranslate">git rev-parse HEAD</code>)</li> <li>The output of <code class="notranslate">bazel version</code></li> </ol> <h3 dir="auto">If possible, provide a minimal reproducible example (We usually don't have time to read hundreds of lines of your code)</h3> <h3 dir="auto">What other attempted solutions have you tried?</h3> <h3 dir="auto">Logs or other output that would be helpful</h3> <p dir="auto">(If logs are large, please upload as attachment or provide link).</p>
<p dir="auto">I am not able to install CUDA 8.0 with Xcode 8.0 version. Everywhere i found the solution to downgrade the version of Xcode. Is there any other solution without downgrading the version of Xcode.</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/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> <p dir="auto">Visiting material-ui.com on the stock/default android browser running android 5.0.2 the drawer shouldn't be stuck open.</p> <h2 dir="auto">Current Behavior</h2> <p dir="auto">The drawer is stuck open. The rest of the page is clickable/scrollable and there's no overlay, but the drawer displays over the page.</p> <h2 dir="auto">Steps to Reproduce (for bugs)</h2> <ol dir="auto"> <li>Navigate to material-ui.com on the stock/default browser of an android phone OS &lt;= ~5</li> </ol> <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.19.4</td> </tr> <tr> <td>browser</td> <td>Android 5.0.2 Stock/Default</td> </tr> </tbody> </table>
<p dir="auto">Hi!<br> I am trying to override styles for BottomNavigationButton. Specifically the label. This is my code.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const styles = { selected: { color: &quot;#353535&quot; }, label: { color: &quot;#e2e2e2&quot;, }, }; class CustomBottomNavButton extends React.Component { static propTypes = { classes: PropTypes.object.isRequired, }; render() { console.log(Theme.typography.caption); const props = this.props; return &lt;BottomNavigationButton {...props} classes={{selected: props.classes.selected, label: props.classes.label, icon: props.classes.icon}} icon={props.icon} label={props.label}&gt; &lt;/BottomNavigationButton&gt;; } } export default withStyles(styles)(CustomBottomNavButton);"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">styles</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">selected</span>: <span class="pl-kos">{</span> <span class="pl-c1">color</span>: <span class="pl-s">"#353535"</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">label</span>: <span class="pl-kos">{</span> <span class="pl-c1">color</span>: <span class="pl-s">"#e2e2e2"</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-k">class</span> <span class="pl-v">CustomBottomNavButton</span> <span class="pl-k">extends</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-c1">Component</span> <span class="pl-kos">{</span> <span class="pl-k">static</span> <span class="pl-c1">propTypes</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">classes</span>: <span class="pl-v">PropTypes</span><span class="pl-kos">.</span><span class="pl-c1">object</span><span class="pl-kos">.</span><span class="pl-c1">isRequired</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-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-v">Theme</span><span class="pl-kos">.</span><span class="pl-c1">typography</span><span class="pl-kos">.</span><span class="pl-c1">caption</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">props</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">;</span> <span class="pl-k">return</span> <span class="pl-c1">&lt;</span><span class="pl-ent">BottomNavigationButton</span> <span class="pl-kos">{</span>...<span class="pl-s1">props</span><span class="pl-kos">}</span> <span class="pl-c1">classes</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-kos">{</span><span class="pl-c1">selected</span>: <span class="pl-s1">props</span><span class="pl-kos">.</span><span class="pl-c1">classes</span><span class="pl-kos">.</span><span class="pl-c1">selected</span><span class="pl-kos">,</span> <span class="pl-c1">label</span>: <span class="pl-s1">props</span><span class="pl-kos">.</span><span class="pl-c1">classes</span><span class="pl-kos">.</span><span class="pl-c1">label</span><span class="pl-kos">,</span> <span class="pl-c1">icon</span>: <span class="pl-s1">props</span><span class="pl-kos">.</span><span class="pl-c1">classes</span><span class="pl-kos">.</span><span class="pl-c1">icon</span><span class="pl-kos">}</span><span class="pl-kos">}</span> <span class="pl-c1">icon</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">props</span><span class="pl-kos">.</span><span class="pl-c1">icon</span><span class="pl-kos">}</span> <span class="pl-c1">label</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">props</span><span class="pl-kos">.</span><span class="pl-c1">label</span><span class="pl-kos">}</span><span class="pl-c1">&gt;</span> <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">BottomNavigationButton</span><span class="pl-c1">&gt;</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">withStyles</span><span class="pl-kos">(</span><span class="pl-s1">styles</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-v">CustomBottomNavButton</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/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">When Button is selected, it should have "selected" style, and when is not selected should have "label" style.</p> <h2 dir="auto">Current Behavior</h2> <p dir="auto">When Button is selected it should have "selected" style but it remains with "label". If I remove the color in label, then applies "selected". So, looks like selection it's not overriding the styles.</p> <p dir="auto">Same happen for any icon included. If "stroke" was defined before (in any part, svg itself, via another css..) selected styling won't work.</p> <h2 dir="auto">Steps to Reproduce (for bugs)</h2> <table role="table"> <thead> <tr> <th>Tech</th> <th>Version</th> </tr> </thead> <tbody> <tr> <td>Material-UI</td> <td>^1.0.0-beta.23</td> </tr> <tr> <td>React</td> <td>^16.2.0</td> </tr> <tr> <td>browser</td> <td>Mozilla, Chrome</td> </tr> </tbody> </table>
0
<p dir="auto">Use of wavelets is rapidly increasing for many applications in denoising, image compression, edge-detection, etc, it makes sense for OpenCV to add support. It should be every bit as useful as Fourier/spectral transforms, given that many applications involve the three processes above.</p>
<p dir="auto">Transferred from <a href="http://code.opencv.org/issues/2923" rel="nofollow">http://code.opencv.org/issues/2923</a></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="|| Ajay Viswanathan on 2013-03-26 20:48 || Priority: Normal || Affected: None || Category: imgproc, video || Tracker: Feature || Difficulty: None || PR: || Platform: None / None"><pre class="notranslate"><code class="notranslate">|| Ajay Viswanathan on 2013-03-26 20:48 || Priority: Normal || Affected: None || Category: imgproc, video || Tracker: Feature || Difficulty: None || PR: || Platform: None / None </code></pre></div> <h2 dir="auto">Discrete wavelet transform</h2> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="There should functions for Haar, DB-X series, 9/7 and all other kinds of transforms in the OpenCV libraries. They would be quite handy in image compression and transmission applications."><pre class="notranslate"><code class="notranslate">There should functions for Haar, DB-X series, 9/7 and all other kinds of transforms in the OpenCV libraries. They would be quite handy in image compression and transmission applications. </code></pre></div> <h2 dir="auto">History</h2> <h5 dir="auto">Vladislav Vinogradov on 2013-04-01 09:06</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Hello, Ajay Viswanathan. OpenCV is open source library. You can make your contribution to it. If you can implement this feature, submit a pull request (see [[How_to_contribute]])."><pre class="notranslate"><code class="notranslate">Hello, Ajay Viswanathan. OpenCV is open source library. You can make your contribution to it. If you can implement this feature, submit a pull request (see [[How_to_contribute]]). </code></pre></div> <h5 dir="auto">Rel Guzman Apaza on 2013-04-02 18:28</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Vladislav Vinogradov wrote: &gt; Hello, Ajay Viswanathan. &gt; &gt; OpenCV is open source library. &gt; You can make your contribution to it. If you can implement this feature, submit a pull request (see [[How_to_contribute]]). How large should be the code? https://github.com/Itseez/opencv/pull/4#issuecomment-7393721"><pre class="notranslate"><code class="notranslate">Vladislav Vinogradov wrote: &gt; Hello, Ajay Viswanathan. &gt; &gt; OpenCV is open source library. &gt; You can make your contribution to it. If you can implement this feature, submit a pull request (see [[How_to_contribute]]). How large should be the code? https://github.com/Itseez/opencv/pull/4#issuecomment-7393721 </code></pre></div> <h5 dir="auto">Rel Guzman Apaza on 2013-04-02 18:28</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Vladislav Vinogradov wrote: &gt; Hello, Ajay Viswanathan. &gt; &gt; OpenCV is open source library. &gt; You can make your contribution to it. If you can implement this feature, submit a pull request (see [[How_to_contribute]]). How large should be the code? [[https://github.com/Itseez/opencv/pull/4#issuecomment-7393721]]"><pre class="notranslate"><code class="notranslate">Vladislav Vinogradov wrote: &gt; Hello, Ajay Viswanathan. &gt; &gt; OpenCV is open source library. &gt; You can make your contribution to it. If you can implement this feature, submit a pull request (see [[How_to_contribute]]). How large should be the code? [[https://github.com/Itseez/opencv/pull/4#issuecomment-7393721]] </code></pre></div> <h5 dir="auto">Vladislav Vinogradov on 2013-04-03 05:44</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="First of all, new functionality must be useful for large number of applications."><pre class="notranslate"><code class="notranslate">First of all, new functionality must be useful for large number of applications. </code></pre></div> <h5 dir="auto">Vladislav Vinogradov on 2013-04-03 05:45</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- Category set to imgproc, video"><pre class="notranslate"><code class="notranslate">- Category set to imgproc, video </code></pre></div>
1
<h4 dir="auto">Summary</h4> <p dir="auto">In Vue3 / TypeScript project,<br> import { AxiosError } from 'axios';</p> <p dir="auto">Build shows warning:<br> Non-existent export 'AxiosError' is imported from node_modules/axios/index.js</p> <p dir="auto">Although there is only a build warning, any component (Vue) or TypeScript (ts) that includes this import fails to work.<br> Browser console (Dev-Tools) shows:</p> <p dir="auto">Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/axios.js?v=3226fa61' does not provide an export named 'AxiosError' (at auth-store.ts:2:17)</p> <h4 dir="auto">Environment</h4> <ul dir="auto"> <li>Axios Version 1.1.2</li> <li>Node.js Version v17.4.0</li> <li>OS: Windows 10</li> <li>Vite version: 3.1.7</li> </ul>
<h4 dir="auto">Describe the bug</h4> <p dir="auto"><code class="notranslate">AxiosHeaders</code>, <code class="notranslate">AxiosError</code>, <code class="notranslate">CanceledError</code> and <code class="notranslate">Axios</code> are "exported" in the type definitions <code class="notranslate">index.d.ts</code>, but not exported in the module.</p> <h4 dir="auto">To Reproduce</h4> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const { AxiosHeaders } = require('axios'); // Allowed by Typescript const headers = new AxiosHeaders({ 'name': 'value' }); // &lt;-- throws Error as AxiosHeaders is not actually exported"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-kos">{</span> AxiosHeaders <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">'axios'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Allowed by Typescript</span> <span class="pl-k">const</span> <span class="pl-s1">headers</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">AxiosHeaders</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-s">'name'</span>: <span class="pl-s">'value'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// &lt;-- throws Error as AxiosHeaders is not actually exported</span></pre></div> <h4 dir="auto">Expected behavior</h4> <p dir="auto"><del>Types are not exported, but only declared (<code class="notranslate">declare class</code> instead of <code class="notranslate">export class</code>).</del></p> <p dir="auto">Classes are exported and can be imported and used like so:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { AxiosError, AxiosHeaders, Axios, CanceledError } from 'axios'; new AxiosError(); new AxiosHeaders(); new Axios(); new CanceledError();"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">AxiosError</span><span class="pl-kos">,</span> <span class="pl-smi">AxiosHeaders</span><span class="pl-kos">,</span> <span class="pl-smi">Axios</span><span class="pl-kos">,</span> <span class="pl-smi">CanceledError</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'axios'</span><span class="pl-kos">;</span> <span class="pl-k">new</span> <span class="pl-smi">AxiosError</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">new</span> <span class="pl-smi">AxiosHeaders</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">new</span> <span class="pl-smi">Axios</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">new</span> <span class="pl-smi">CanceledError</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <h4 dir="auto">Environment</h4> <ul dir="auto"> <li>Axios Version 1.1.0</li> <li>Node.js Version 16.15.1</li> <li>OS: OSX 12.5</li> <li>Typescript 4.6.3 (any version)</li> <li>React 17</li> </ul> <h4 dir="auto">Additional context/Screenshots</h4> <p dir="auto">none</p>
1
<p dir="auto">Here is the sample illustrating the bug :</p> <p dir="auto"><a href="http://jsfiddle.net/mzQnF/" rel="nofollow">http://jsfiddle.net/mzQnF/</a><br> (just left-click to begin the camera animation)</p> <p dir="auto">The scene is composed of an half sphere illuminated with two point lights, red and blue.<br> A symmetry with the xy plane has been applied to the half sphere.</p> <p dir="auto">The sphere's normals are not inverted as expected.</p> <p dir="auto">Moreover, if doubleSided is activated, the illumination is not coherent, and the specular component is missing.</p>
<p dir="auto">Three.js at present includes a Shape/Text triangulation which was easy to implement but also needed several add-ons, eg. to decide between contours and holes and to remove those holes, and it had quite some issues concerning:</p> <ul dir="auto"> <li>holes in polygons ( <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="13703525" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/3386" data-hovercard-type="issue" data-hovercard-url="/mrdoob/three.js/issues/3386/hovercard" href="https://github.com/mrdoob/three.js/issues/3386">#3386</a>: Holes in contours causes triangulation failure (partial solution: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="26317338" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/4337" data-hovercard-type="pull_request" data-hovercard-url="/mrdoob/three.js/pull/4337/hovercard" href="https://github.com/mrdoob/three.js/pull/4337">#4337</a>); <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="9924561" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/2919" data-hovercard-type="issue" data-hovercard-url="/mrdoob/three.js/issues/2919/hovercard" href="https://github.com/mrdoob/three.js/issues/2919">#2919</a>: Triangulation fails for simple shape )</li> <li>the sequence of contour and hole polygons ( <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="26506499" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/4357" data-hovercard-type="pull_request" data-hovercard-url="/mrdoob/three.js/pull/4357/hovercard" href="https://github.com/mrdoob/three.js/pull/4357">#4357</a>: toShapes: independence of shape and hole specification order, ref. <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="13703525" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/3386" data-hovercard-type="issue" data-hovercard-url="/mrdoob/three.js/issues/3386/hovercard" href="https://github.com/mrdoob/three.js/issues/3386">#3386</a> )</li> <li>the winding order of contour and hole polygons ( <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="30422128" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/4626" data-hovercard-type="pull_request" data-hovercard-url="/mrdoob/three.js/pull/4626/hovercard" href="https://github.com/mrdoob/three.js/pull/4626">#4626</a>: toShapes: Bugfix; new optional parameter: noHoles; <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="29706210" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/4590" data-hovercard-type="issue" data-hovercard-url="/mrdoob/three.js/issues/4590/hovercard" href="https://github.com/mrdoob/three.js/issues/4590">#4590</a>: Text Triangulation Issues )</li> <li>and finally performance issues: ( <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="29788019" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/4594" data-hovercard-type="issue" data-hovercard-url="/mrdoob/three.js/issues/4594/hovercard" href="https://github.com/mrdoob/three.js/issues/4594">#4594</a>, first solution step <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="30403302" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/4623" data-hovercard-type="pull_request" data-hovercard-url="/mrdoob/three.js/pull/4623/hovercard" href="https://github.com/mrdoob/three.js/pull/4623">#4623</a> )</li> </ul> <p dir="auto">It seems to work correctly by now but is quite slow if there are many vertices or holes.</p> <p dir="auto">Instead of trying to improve the present code further, I created a new project <a href="https://github.com/jahting/pnltri.js">PnlTri.js</a>: <strong>Polygon Near-Linear Triangulation in JavaScript</strong></p> <ul dir="auto"> <li>implementation of Raimund Seidel's randomised polygon trapezoidation and triangulation,</li> <li>does not rely on polygon winding order and holes following on their contour,</li> <li>reasonably <strong>fast</strong>: A square with 25000 square holes (~100k vertices -&gt; ~150k triangles) takes less than 3 seconds on my old Laptop (Core 2 Duo T7200, 2 GHz) with Firefox 30.0,</li> <li>quite <strong>small</strong>: adds about 10k to three.min.js or about 2k to the gziped file, and it should be possible to further simplify some functions surrounding triangulation in Three.js,</li> <li>tested with all <em>difficult</em> data available to me in the Three.js examples and issues,</li> <li>rather robust: in the presence of incompatible input it should produce "wrong" output but not crash.</li> </ul> <p dir="auto">I also created a branch for <a href="https://github.com/jahting/three.js/tree/withPnltri">Three.js with PnlTri</a>, replacing the present mechanism.<br> So interested users of Three.js can test their data against it. More test data would be welcome.</p> <p dir="auto">The main <strong>drawback</strong> might be that this algorithm often produces rather long, slim triangles. I'm thinking about a post-processing step to improve on this in the future.<br> There is still some room to refactor PnlTri and reduce the code surrounding triangulation in Three.js.<br> The next major step for PnlTri will be to allow polygons with intersections which would also increase robustness further.</p> <p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mrdoob/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mrdoob">@mrdoob</a>: Is it small enough for integration into Three.js, or should it be left for people to combine them on their own ?</p>
0
<h3 dir="auto">System info</h3> <ul dir="auto"> <li>Playwright Version: v1.24.2</li> <li>Node version: 18.12.1</li> <li>Operating System: windows server 2019</li> <li>Browser: Chromium</li> </ul> <h3 dir="auto">Issue</h3> <p dir="auto">The download event is not triggered when I am using the machine to reach some internal site. If I open the chromium.exe manually, I can download the file with the same button clicked.</p> <p dir="auto">This issue only happens when I go to the internal sites, if I go to some public website and perform a button click download, the program works well. I have another server running the same node and playwright version with windows server 2016, which can download file no matter which website it is using the same program.</p> <p dir="auto">I would like to know is there something I configure playwright wrong or only a permission issue. As the code I am using, I only know that I perform a button click successfully and don't know if the download event emit or not.</p> <h3 dir="auto">Code Snippet</h3> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" const browser = await chromium.launch({ headless: true, args: [&quot;--no-sandbox&quot;], downloadsPath: path_to_data, executablePath: path.resolve( &quot;./node_modules/chromium/lib/chromium/chrome-win/chrome.exe&quot; ), }); const context = await browser.newContext({acceptDownloads: true }); const page = await context.newPage(); // some code here page.on(&quot;download&quot;, async (dl) =&gt; { const downloaded = await dl.path(); console.log(&quot;Download Finished&quot;); var real_file_name = startDate +&quot;_&quot;+ endDate; real_file_name = &quot;Download - &quot;+real_file_name.replace(/-/g, '')+&quot;.xlsx&quot;; renameSync(downloaded, `${path_to_data}/${real_file_name}`); console.log(&quot;Rename Finished&quot;); await browser.close(); success = true; }); await page.click('button:text(&quot;Export&quot;)', { force: true }); console.log(&quot;Start Downloading&quot;); await new Promise(resolve =&gt; setTimeout(resolve, 10000));"><pre class="notranslate"> <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">true</span><span class="pl-kos">,</span> <span class="pl-c1">args</span>: <span class="pl-kos">[</span><span class="pl-s">"--no-sandbox"</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">downloadsPath</span>: <span class="pl-s1">path_to_data</span><span class="pl-kos">,</span> <span class="pl-c1">executablePath</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span> <span class="pl-s">"./node_modules/chromium/lib/chromium/chrome-win/chrome.exe"</span> <span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">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-c1">acceptDownloads</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-k">const</span> <span class="pl-s1">page</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-kos">;</span> <span class="pl-c">// some code here</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">"download"</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-s1">dl</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">downloaded</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">dl</span><span class="pl-kos">.</span><span class="pl-en">path</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-s">"Download Finished"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">var</span> <span class="pl-s1">real_file_name</span> <span class="pl-c1">=</span> <span class="pl-s1">startDate</span> <span class="pl-c1">+</span><span class="pl-s">"_"</span><span class="pl-c1">+</span> <span class="pl-s1">endDate</span><span class="pl-kos">;</span> <span class="pl-s1">real_file_name</span> <span class="pl-c1">=</span> <span class="pl-s">"Download - "</span><span class="pl-c1">+</span><span class="pl-s1">real_file_name</span><span class="pl-kos">.</span><span class="pl-en">replace</span><span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span>-<span class="pl-c1">/</span>g</span><span class="pl-kos">,</span> <span class="pl-s">''</span><span class="pl-kos">)</span><span class="pl-c1">+</span><span class="pl-s">".xlsx"</span><span class="pl-kos">;</span> <span class="pl-en">renameSync</span><span class="pl-kos">(</span><span class="pl-s1">downloaded</span><span class="pl-kos">,</span> <span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">path_to_data</span><span class="pl-kos">}</span></span>/<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">real_file_name</span><span class="pl-kos">}</span></span>`</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">"Rename Finished"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">success</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">click</span><span class="pl-kos">(</span><span class="pl-s">'button:text("Export")'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">force</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-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"Start Downloading"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-k">new</span> <span class="pl-v">Promise</span><span class="pl-kos">(</span><span class="pl-s1">resolve</span> <span class="pl-c1">=&gt;</span> <span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-s1">resolve</span><span class="pl-kos">,</span> <span class="pl-c1">10000</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto"><strong>html</strong></p> <div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" &lt;div class=&quot;row form-group&quot;&gt; &lt;span class=&quot;col-3&quot;&gt;&lt;/span&gt; &lt;span class=&quot;col-3&quot;&gt; &lt;button class=&quot;btn btn-primary exportable&quot; onclick=&quot;printDownload()&quot;&gt;Download&lt;/button&gt; &lt;/span&gt; &lt;/div&gt; "><pre class="notranslate"> <span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">row form-group</span>"<span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">span</span> <span class="pl-c1">class</span>="<span class="pl-s">col-3</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">span</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">span</span> <span class="pl-c1">class</span>="<span class="pl-s">col-3</span>"<span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">button</span> <span class="pl-c1">class</span>="<span class="pl-s">btn btn-primary exportable</span>" <span class="pl-c1">onclick</span>="<span class="pl-s">printDownload()</span>"<span class="pl-kos">&gt;</span>Download<span class="pl-kos">&lt;/</span><span class="pl-ent">button</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;/</span><span class="pl-ent">span</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span></pre></div> <p dir="auto">When I run the internal site, the code will stop at Start Downloading and then end whten the timeout end, while when the code is run on another server, it will trigger the download event.</p>
<p dir="auto">Playwright trace is very helpful in debugging, it shows the dom snapshots as well.<br> But if my locator has issues, I'd like to have the capability of using query engine on the dom snapshot in <a href="https://trace.playwright.dev/" rel="nofollow">https://trace.playwright.dev/</a> (on the same browser instance where <a href="https://trace.playwright.dev/" rel="nofollow">https://trace.playwright.dev/</a> is running)</p> <p dir="auto">it will save time.</p> <p dir="auto">Currently I resort to Playwright Inspector / Codegen and replay my test up to that point.</p>
0
<p dir="auto"><code class="notranslate">torch::pickle_save</code> and <code class="notranslate">torch::pickle_load</code> have no docs, maybe <code class="notranslate">torch::save/load</code> should also be deprecated since they are more limited</p>
<p dir="auto">These APIs aren't going anywhere as far as I know, but <a href="https://pytorch.org/cppdocs/api/function_namespacetorch_1a55eb95ea00888978ee53f366ec875c62.html?highlight=pickle_save" rel="nofollow">they have no descriptions or usage instructions</a></p> <p dir="auto">They have some documentation here but that's nowhere on the website:<br> <a href="https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/serialization/pickle.h">https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/serialization/pickle.h</a></p> <p dir="auto">And some usages are in the tests but aren't very user-discoverable:</p> <ul dir="auto"> <li><a href="https://github.com/pytorch/pytorch/blob/master/test/cpp/api/jit.cpp#L120">https://github.com/pytorch/pytorch/blob/master/test/cpp/api/jit.cpp#L120</a></li> <li><a href="https://github.com/pytorch/pytorch/blob/master/test/cpp/jit/test_save_load.cpp#L121">https://github.com/pytorch/pytorch/blob/master/test/cpp/jit/test_save_load.cpp#L121</a></li> <li><a href="https://github.com/pytorch/pytorch/blob/master/test/cpp/jit/torch_python_test.cpp#L44-L54">https://github.com/pytorch/pytorch/blob/master/test/cpp/jit/torch_python_test.cpp#L44-L54</a></li> </ul> <p dir="auto">Tagging the JIT team to see if there are any plans for these APIs</p> <p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gmagogsfm/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gmagogsfm">@gmagogsfm</a></p>
1
<p dir="auto">When accessing multiple fields of a structured array, numpy fails to verify that all the fields exist. Instead, it will only return existing fields. If none exist, it return a strange object that has a dtype that is empty. Normally, creating an object with an empty dtype is not supposed to be possible (<code class="notranslate">zeros(shape=(5,), dtype=[])</code> results as expected in <code class="notranslate">TypeError: Empty data-type</code>), so this might actually be a dual bug.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [216]: A = numpy.empty(dtype=[(&quot;A&quot;, &quot;f4&quot;), (&quot;B&quot;, &quot;f8&quot;)], shape=(5,)) In [217]: A[[&quot;AA&quot;]] Out[217]: array([(), (), (), (), ()], dtype='{'names':[], 'formats':[], 'offsets':[], 'itemsize':12}') In [232]: A[[&quot;AA&quot;, &quot;B&quot;]] Out[232]: array([(0.0,), (0.0,), (0.0,), (0.0,), (0.0,)], dtype=[('B', '&lt;f8')])"><pre class="notranslate"><code class="notranslate">In [216]: A = numpy.empty(dtype=[("A", "f4"), ("B", "f8")], shape=(5,)) In [217]: A[["AA"]] Out[217]: array([(), (), (), (), ()], dtype='{'names':[], 'formats':[], 'offsets':[], 'itemsize':12}') In [232]: A[["AA", "B"]] Out[232]: array([(0.0,), (0.0,), (0.0,), (0.0,), (0.0,)], dtype=[('B', '&lt;f8')]) </code></pre></div>
<p dir="auto">When accessing multiple records with <code class="notranslate">arr[["field0", "field1",…]]</code>, using a non-existing field is silent:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; arr = numpy.array([(1, 2, 10), (3, 4, 10)], dtype=[('x', int), ('y', int), (&quot;z&quot;, int)]) &gt;&gt;&gt; arr[[&quot;lkjlkj&quot;]] array([(), ()], dtype='{'names':[], 'formats':[], 'offsets':[], 'itemsize':24}')"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; arr = numpy.array([(1, 2, 10), (3, 4, 10)], dtype=[('x', int), ('y', int), ("z", int)]) &gt;&gt;&gt; arr[["lkjlkj"]] array([(), ()], dtype='{'names':[], 'formats':[], 'offsets':[], 'itemsize':24}') </code></pre></div> <p dir="auto">This is inconsistent with accessing a single field:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; arr[&quot;lkjlkj&quot;] Traceback (most recent call last): File &quot;&lt;ipython-input-7-7a431ec24c6c&gt;&quot;, line 1, in &lt;module&gt; arr[&quot;lkjlkj&quot;] ValueError: field named lkjlkj not found"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; arr["lkjlkj"] Traceback (most recent call last): File "&lt;ipython-input-7-7a431ec24c6c&gt;", line 1, in &lt;module&gt; arr["lkjlkj"] ValueError: field named lkjlkj not found </code></pre></div> <p dir="auto">Furthermore, it creates error messages that can be harder to make sense of, like in:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="for (x, y_value) in arr[[&quot;x&quot;, &quot;y_valuf&quot;]]: # Note the typo in &quot;y_valuf&quot; …"><pre class="notranslate"><code class="notranslate">for (x, y_value) in arr[["x", "y_valuf"]]: # Note the typo in "y_valuf" … </code></pre></div> <p dir="auto">(ValueError: need more than 1 value to unpack).</p> <p dir="auto">I can't find any documentation on the current behavior either (it's not in <a href="http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html#record-access" rel="nofollow">http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html#record-access</a>).</p> <p dir="auto">I would suggest that non-existing fields raise an exception, for consistency/least-surprise and practicality reasons.</p>
1
<h3 dir="auto">Preflight Checklist</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li> </ul> <h3 dir="auto">Issue Details</h3> <ul dir="auto"> <li><strong>Electron Version:</strong> <ul dir="auto"> <li>9.0.0</li> </ul> </li> <li><strong>Operating System:</strong> <ul dir="auto"> <li>Windows 10 (19631.1)</li> </ul> </li> <li><strong>Last Known Working Electron version:</strong> <ul dir="auto"> <li>8.2.0</li> </ul> </li> </ul> <h3 dir="auto">Expected Behavior</h3> <p dir="auto">Electron to start</p> <h3 dir="auto">Actual Behavior</h3> <p dir="auto">Crashes in terminal with error number 2147483651</p> <h3 dir="auto">To Reproduce</h3> <p dir="auto">I'm not quite sure what's causing this as I've cloned the <code class="notranslate">electron-quick-start</code> repo and before that I followed the <code class="notranslate">quick-start</code> document to a T and I've set up plenty of Electron projects with no problems like this in the past. Weirdly enough, it's not working with my project or a new project, but electron <em>is</em> opening in a older (only by a month or two from now) Electron project of mine. Apparently it's at 8.2.0</p> <p dir="auto">Changed the blank skeleton apps Electron version to 8.2.0 and it worked. This might be a problem with the Windows version I'm using (Insider Preview), but I'm confused why 8.2.0 works.</p>
<p dir="auto">In relation to the following issue:-<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="200116506" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/8386" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/8386/hovercard" href="https://github.com/electron/electron/issues/8386">#8386</a></p> <p dir="auto">I can confirm that I am still experiencing the thead rendering issue when printing to PDF using win.webContents.printToPDF() despite the fact that I am using electron 1.8.4 and it having been stated this was rectified in 1.6 in the above issue. The following work around rectifies the issue, with the !important being required:-</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@media print { thead { display: table-row-group !important; } }"><pre class="notranslate"><code class="notranslate">@media print { thead { display: table-row-group !important; } } </code></pre></div> <p dir="auto">Platform win32-x64<br> Electron Version: 1.8.4.</p> <p dir="auto">Please advise.</p>
0
<p dir="auto">cf <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="10120999" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/2706" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/2706/hovercard" href="https://github.com/pandas-dev/pandas/issues/2706">#2706</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="# Your code here df = pandas.DataFrame({'a': [1, 10, 8, 11, -1], 'b': [1.0, 2.0, 3.0, 3.0, 4.0]}) df.nlargest(3, 'b') Result: a b 4 -1 4.0 2 8 3.0 3 11 3.0 2 8 3.0 3 11 3.0"><pre class="notranslate"><span class="pl-c"># Your code here</span> <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pandas</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">'a'</span>: [<span class="pl-c1">1</span>, <span class="pl-c1">10</span>, <span class="pl-c1">8</span>, <span class="pl-c1">11</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>], <span class="pl-s">'b'</span>: [<span class="pl-c1">1.0</span>, <span class="pl-c1">2.0</span>, <span class="pl-c1">3.0</span>, <span class="pl-c1">3.0</span>, <span class="pl-c1">4.0</span>]}) <span class="pl-s1">df</span>.<span class="pl-en">nlargest</span>(<span class="pl-c1">3</span>, <span class="pl-s">'b'</span>) <span class="pl-v">Result</span>: <span class="pl-s1">a</span> <span class="pl-s1">b</span> <span class="pl-c1">4</span> <span class="pl-c1">-</span><span class="pl-c1">1</span> <span class="pl-c1">4.0</span> <span class="pl-c1">2</span> <span class="pl-c1">8</span> <span class="pl-c1">3.0</span> <span class="pl-c1">3</span> <span class="pl-c1">11</span> <span class="pl-c1">3.0</span> <span class="pl-c1">2</span> <span class="pl-c1">8</span> <span class="pl-c1">3.0</span> <span class="pl-c1">3</span> <span class="pl-c1">11</span> <span class="pl-c1">3.0</span></pre></div> <h4 dir="auto">Problem description</h4> <p dir="auto">[this should explain <strong>why</strong> the current behaviour is a problem and why the expected output is a better solution.]</p> <p dir="auto">Duplicate values in column 'b' is not being handled correctly. The result is different than<br> what "df.sort_values('b', ascending=False).head(3)" produces.</p> <p dir="auto"><strong>Note</strong>: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!</p> <p dir="auto"><strong>Note</strong>: Many problems can be resolved by simply upgrading <code class="notranslate">pandas</code> to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check if <code class="notranslate">master</code> addresses this issue, but that is not necessary.</p> <p dir="auto">For documentation-related issues, you can check the latest versions of the docs on <code class="notranslate">master</code> here:</p> <p dir="auto"><a href="https://pandas-docs.github.io/pandas-docs-travis/" rel="nofollow">https://pandas-docs.github.io/pandas-docs-travis/</a></p> <p dir="auto">If the issue has not been resolved there, go ahead and file it in the issue tracker.</p> <h4 dir="auto">Expected Output</h4> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" a b"><pre class="notranslate"><code class="notranslate"> a b </code></pre></div> <p dir="auto">4 -1 4.0<br> 2 8 3.0<br> 3 11 3.0</p> <h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4> <h2 dir="auto">INSTALLED VERSIONS</h2> <p dir="auto">commit: None<br> python: 2.7.12.final.0<br> python-bits: 64<br> OS: Linux<br> OS-release: 4.3.5-smp-808.15.0.0<br> machine: x86_64<br> processor:<br> byteorder: little<br> LC_ALL: en_US.UTF-8<br> LANG: None<br> LOCALE: None.None</p> <p dir="auto">pandas: 0.19.2<br> nose: None<br> pip: None<br> setuptools: None<br> Cython: None<br> numpy: 1.11.1<br> scipy: 0.15.1<br> statsmodels: 0.6.1<br> xarray: None<br> IPython: 2.0.0<br> sphinx: None<br> patsy: 0.4.1<br> dateutil: 2.6.0<br> pytz: 2017.2<br> blosc: None<br> bottleneck: None<br> tables: 3.1.1<br> numexpr: 2.5<br> matplotlib: 1.5.2<br> openpyxl: None<br> xlrd: 0.9.3<br> xlwt: None<br> xlsxwriter: None<br> lxml: None<br> bs4: None<br> html5lib: 1.0b8<br> httplib2: 0.9.2<br> apiclient: 1.5.5<br> sqlalchemy: None<br> pymysql: None<br> psycopg2: None<br> jinja2: 2.8<br> boto: None<br> pandas_datareader: None</p> <p dir="auto">[paste the output of <code class="notranslate">pd.show_versions()</code> here below this line]</p>
0
<p dir="auto">Although I followed instruction, it still shows error notification about syntax?</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/12629852/7841687/a981cde4-04c8-11e5-80b1-aa539c49520f.png"><img src="https://cloud.githubusercontent.com/assets/12629852/7841687/a981cde4-04c8-11e5-80b1-aa539c49520f.png" alt="screenshot 2015-05-27 23 28 54" style="max-width: 100%;"></a></p>
<p dir="auto">This issue is to track Syntax error popping up in the challenges.</p>
1
<p dir="auto"><strong>Current behavior</strong></p> <p dir="auto">I have component with class bindings which look like:</p> <p dir="auto">&lt;foo class="class1 {{classFromProp1}}" [class.foo-class]="classFromProp2"&gt;<br> classFromProp2= true<br> when resizing screen classFromProp1 changes and foo-class gets lost.</p> <p dir="auto">this behavior works as expected if I use [ngClass]="{'foo-class': classFromProp2}"</p> <p dir="auto"><strong>Expected behavior</strong><br> should merge classes correctly</p> <ul dir="auto"> <li><strong>Angular version:</strong> 2.0.X<br> ~2.4.0</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 =&gt; search github for a similar issue or PR before submitting [ ] feature request [ ] support request =&gt; 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 =&gt; search github for a similar issue or PR before submitting [ ] feature request [ ] support request =&gt; 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">If an element has an interpolated class as well as a class that is bound to a component property, bound class is removed if the interpolated class value changes.</p> <p dir="auto">Take the following html as example:<br> <code class="notranslate">&lt;h2 class="existing-class {{compClass}}" [class.bound]="hasClass"&gt;Hello {{name}}&lt;/h2&gt;</code></p> <p dir="auto">Once the <code class="notranslate">compClass</code> property changes, the <code class="notranslate">bound</code> class is removed.</p> <p dir="auto"><strong>Expected behavior</strong></p> <p dir="auto">The expected behavior is that the class that is bound by a variable is unaffected by an interpolated class.</p> <p dir="auto">Thus, in the above example, if <code class="notranslate">hasClass</code> is true the element should have the following classes present "existing-class", "bound" and whatever the value of <code class="notranslate">compClass</code> is.</p> <p dir="auto">When <code class="notranslate">compClass</code> changes and <code class="notranslate">hasClass</code> is still true, the element should still have the "bound" class.</p> <p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong></p> <ol dir="auto"> <li>Create a component with a boolean and string property.</li> <li>Within the component template, add the string property as a interpolated string in an element's class attribute.</li> <li>Bind another class to the element with the boolean property (<code class="notranslate">[class.bound]="boolProp"</code>)</li> <li>Change the string property's value after a certain amount of time.</li> <li>The the class that is added with attribute binding is removed.</li> </ol> <p dir="auto">Or check out this <a href="http://plnkr.co/edit/McE9UyP3h07eMqS3EOag" rel="nofollow">plunker</a></p> <p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong></p> <p dir="auto">I think it makes sense to be able to change one class without effecting other classes on an element.</p> <p dir="auto"><strong>Please tell us about your environment:</strong></p> <ul dir="auto"> <li><strong>Angular version:</strong> 2.4.9 &amp;&amp; 4.0.0-rc.2</li> </ul> <ul dir="auto"> <li><strong>Browser:</strong> [Chromium 56 | Firefox 52]</li> </ul> <ul dir="auto"> <li> <p dir="auto"><strong>Language:</strong> [all | TypeScript X.X | ES6/7 | ES5]<br> Typescript 2.0.2 (with Angular 2.4.9)<br> Typescript 2.1.5 (with Angular 4.0.0-rc.2)</p> </li> <li> <p dir="auto"><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> =</p> </li> </ul>
1
<p dir="auto">Hello,</p> <p dir="auto">I am using seaborn 0.11.2 trying to plot some partial correlations using <code class="notranslate">regplot</code>. I have a dataframe for all of my data (x,y, and covariates), and a list of columne names (e.g. <code class="notranslate">covars=["Covar1","Covar2"..."CovarN"]</code>) that I want to pass into the <code class="notranslate">y_partial</code> argument. If I type I only pass in one name into the argument, the code runs. However, if I pass <code class="notranslate">y_partial = covars</code> to try to regress out all the covariates, I get the following error:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/om2/user/smeisler/anaconda3/envs/nipype/lib/python3.8/site-packages/seaborn/_decorators.py in inner_f(*args, **kwargs) 44 ) 45 kwargs.update({k: arg for k, arg in zip(sig.parameters, args)}) ---&gt; 46 return f(**kwargs) 47 return inner_f 48 /om2/user/smeisler/anaconda3/envs/nipype/lib/python3.8/site-packages/seaborn/regression.py in regplot(x, y, data, x_estimator, x_bins, x_ci, scatter, fit_reg, ci, n_boot, units, seed, order, logistic, lowess, robust, logx, x_partial, y_partial, truncate, dropna, x_jitter, y_jitter, label, color, marker, scatter_kws, line_kws, ax) 849 ): 850 --&gt; 851 plotter = _RegressionPlotter(x, y, data, x_estimator, x_bins, x_ci, 852 scatter, fit_reg, ci, n_boot, units, seed, 853 order, logistic, lowess, robust, logx, /om2/user/smeisler/anaconda3/envs/nipype/lib/python3.8/site-packages/seaborn/regression.py in __init__(self, x, y, data, x_estimator, x_bins, x_ci, scatter, fit_reg, ci, n_boot, units, seed, order, logistic, lowess, robust, logx, x_partial, y_partial, truncate, dropna, x_jitter, y_jitter, color, label) 112 # Drop null observations 113 if dropna: --&gt; 114 self.dropna(&quot;x&quot;, &quot;y&quot;, &quot;units&quot;, &quot;x_partial&quot;, &quot;y_partial&quot;) 115 116 # Regress nuisance variables out of the data /om2/user/smeisler/anaconda3/envs/nipype/lib/python3.8/site-packages/seaborn/regression.py in dropna(self, *vars) 60 vals = [getattr(self, var) for var in vars] 61 vals = [v for v in vals if v is not None] ---&gt; 62 not_na = np.all(np.column_stack([pd.notnull(v) for v in vals]), axis=1) 63 for var in vars: 64 val = getattr(self, var) &lt;__array_function__ internals&gt; in column_stack(*args, **kwargs) /om2/user/smeisler/anaconda3/envs/nipype/lib/python3.8/site-packages/numpy/lib/shape_base.py in column_stack(tup) 654 arr = array(arr, copy=False, subok=True, ndmin=2).T 655 arrays.append(arr) --&gt; 656 return _nx.concatenate(arrays, 1) 657 658 &lt;__array_function__ internals&gt; in concatenate(*args, **kwargs) ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 162 and the array at index 2 has size 4"><pre class="notranslate"><code class="notranslate">/om2/user/smeisler/anaconda3/envs/nipype/lib/python3.8/site-packages/seaborn/_decorators.py in inner_f(*args, **kwargs) 44 ) 45 kwargs.update({k: arg for k, arg in zip(sig.parameters, args)}) ---&gt; 46 return f(**kwargs) 47 return inner_f 48 /om2/user/smeisler/anaconda3/envs/nipype/lib/python3.8/site-packages/seaborn/regression.py in regplot(x, y, data, x_estimator, x_bins, x_ci, scatter, fit_reg, ci, n_boot, units, seed, order, logistic, lowess, robust, logx, x_partial, y_partial, truncate, dropna, x_jitter, y_jitter, label, color, marker, scatter_kws, line_kws, ax) 849 ): 850 --&gt; 851 plotter = _RegressionPlotter(x, y, data, x_estimator, x_bins, x_ci, 852 scatter, fit_reg, ci, n_boot, units, seed, 853 order, logistic, lowess, robust, logx, /om2/user/smeisler/anaconda3/envs/nipype/lib/python3.8/site-packages/seaborn/regression.py in __init__(self, x, y, data, x_estimator, x_bins, x_ci, scatter, fit_reg, ci, n_boot, units, seed, order, logistic, lowess, robust, logx, x_partial, y_partial, truncate, dropna, x_jitter, y_jitter, color, label) 112 # Drop null observations 113 if dropna: --&gt; 114 self.dropna("x", "y", "units", "x_partial", "y_partial") 115 116 # Regress nuisance variables out of the data /om2/user/smeisler/anaconda3/envs/nipype/lib/python3.8/site-packages/seaborn/regression.py in dropna(self, *vars) 60 vals = [getattr(self, var) for var in vars] 61 vals = [v for v in vals if v is not None] ---&gt; 62 not_na = np.all(np.column_stack([pd.notnull(v) for v in vals]), axis=1) 63 for var in vars: 64 val = getattr(self, var) &lt;__array_function__ internals&gt; in column_stack(*args, **kwargs) /om2/user/smeisler/anaconda3/envs/nipype/lib/python3.8/site-packages/numpy/lib/shape_base.py in column_stack(tup) 654 arr = array(arr, copy=False, subok=True, ndmin=2).T 655 arrays.append(arr) --&gt; 656 return _nx.concatenate(arrays, 1) 657 658 &lt;__array_function__ internals&gt; in concatenate(*args, **kwargs) ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 162 and the array at index 2 has size 4 </code></pre></div> <p dir="auto">Do you know how I could solve this problem?</p> <p dir="auto">Thank you,<br> Steven</p>
<p dir="auto">I'm plotting interaction effects with regplot. I want to take into account two confounding variables.<br> The documentation of regplot indicates the possibility of passing a list of string for x_partial.<br> {x, y}_partial : matrix or string(s) , optional<br> Matrix with same first dimension as <code class="notranslate">x</code>, or column name(s) in <code class="notranslate">data</code>.<br> These variables are treated as confounding and are removed from<br> the <code class="notranslate">x</code> or <code class="notranslate">y</code> variables before plotting.</p> <p dir="auto">However, I am a getting an error "ValueError: all the input array dimensions except for the concatenation axis must match exactly" in linearmodels.py/regplot</p> <p dir="auto">seaborn/linearmodels.pyc in regplot(x, y, data, x_estimator, x_bins, x_ci, scatter, fit_reg, ci, n_boot, units, order, logistic, lowess, robust, logx, x_partial, y_partial, truncate, dropna, x_jitter, y_jitter, xlabel, ylabel, label, color, marker, scatter_kws, line_kws, ax)<br> 1185 order, logistic, lowess, robust, logx,<br> 1186 x_partial, y_partial, truncate, dropna,<br> -&gt; 1187 x_jitter, y_jitter, color, label)</p> <p dir="auto">Is the feature not implemented or am I missing something here?</p> <p dir="auto">thank you</p>
1
<p dir="auto">First time opening the menu you can see 8 links clearly, but if you close the menu and open it again, all the links disappear.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/3a875835463503c6f06872ae640b0d14f45864f780d503159ed0852f9c1eebe3/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f333734313538322f313433363632322f31336436393966652d343135632d313165332d393230382d3563303362633362636161362e706e67"><img src="https://camo.githubusercontent.com/3a875835463503c6f06872ae640b0d14f45864f780d503159ed0852f9c1eebe3/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f333734313538322f313433363632322f31336436393966652d343135632d313165332d393230382d3563303362633362636161362e706e67" alt="screenshot_2013-10-30-10-05-58 copy" data-canonical-src="https://f.cloud.github.com/assets/3741582/1436622/13d699fe-415c-11e3-9208-5c03bc3bcaa6.png" style="max-width: 100%;"></a></p> <p dir="auto">This issue happens on Galaxy SIII Mini with Android Jelly Bean 4.1.2 + Chrome in portrait mode only. On the default browser and landscape view are ok.</p> <p dir="auto">I also got this problem on a Galaxy SII + CyanogenMod 10.2 (4.3) + Chrome.</p> <p dir="auto">The following link:</p> <p dir="auto"><a href="http://www.demodirectory.com" rel="nofollow">www.demodirectory.com</a></p> <p dir="auto">Any thoughts?</p>
<p dir="auto">How to reproduce:</p> <ol dir="auto"> <li>Open bootstrap [ http://getbootstrap.com/2.3.2/ ] or any website using bootstrap in chrome on mobile android in portrait mode.</li> <li>then click on menu to open, then close &amp; then click again to open</li> <li>this time the navigation is coming blank even thought the links are there and can be clicked but can't be seen</li> </ol> <p dir="auto">Works fine in landscape mode.</p> <p dir="auto">Screenshot:<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/adc8bb29943f163678f2bf820b8dd2c91d7b39f130ed5e9a23912a7c55be87c4/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f353731303835302f313335333132332f66356332323736652d333734302d313165332d393739662d3162646162663163336362632e6a7067"><img src="https://camo.githubusercontent.com/adc8bb29943f163678f2bf820b8dd2c91d7b39f130ed5e9a23912a7c55be87c4/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f353731303835302f313335333132332f66356332323736652d333734302d313165332d393739662d3162646162663163336362632e6a7067" alt="r858" data-canonical-src="https://f.cloud.github.com/assets/5710850/1353123/f5c2276e-3740-11e3-979f-1bdabf1c3cbc.jpg" style="max-width: 100%;"></a></p>
1
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li> </ul> <h3 dir="auto">Environment</h3> <ul dir="auto"> <li>Dubbo version: xxx</li> <li>Operating System version: xxx</li> <li>Java version: xxx</li> </ul> <h3 dir="auto">Steps to reproduce this issue</h3> <ol dir="auto"> <li>xxx</li> <li>xxx</li> <li>xxx</li> </ol> <p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p> <h3 dir="auto">Expected Result</h3> <p dir="auto">What do you expected from the above steps?</p> <h3 dir="auto">Actual Result</h3> <p dir="auto">What actually happens?</p> <p dir="auto">If there is an exception, please attach the exception trace:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here! </code></pre></div>
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li> </ul> <h3 dir="auto">Environment</h3> <ul dir="auto"> <li>Dubbo version: 2。6。5</li> <li>Operating System version: ubuntu</li> <li>Java version: 1.8</li> </ul> <h3 dir="auto">Steps to reproduce this issue</h3> <p dir="auto">hi, I have a requirement now, when a dubbo application is started, I need get the dubbo instance's ip, port and timestamp, then that message as the dubbo instance's unique key save to mysql ,but i have not a good idea to get that message,please tell me how to get the message ? thanks</p> <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"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=macromaniac" rel="nofollow">Andrey Karandey</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9377?redirect=false" rel="nofollow">SPR-9377</a></strong> and commented</p> <p dir="auto">Key generating has a weak hashing function. Next results are equal:</p> <p dir="auto">generate( object1,method1,new Integer( 109 ),new Integer( 434)));<br> generate( object1,method1,new Integer( 110 ),new Integer( 403)));</p> <p dir="auto">It was pity to catch it on production...</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="398156862" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14870" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14870/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14870">#14870</a> Cacheable key collision with DefaultKeyGenerator (<em><strong>"duplicates"</strong></em>)</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398116727" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13675" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13675/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13675">#13675</a> Improve DefaultKeyGenerator</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398156862" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14870" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14870/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14870">#14870</a> Cacheable key collision with DefaultKeyGenerator</li> </ul> <p dir="auto">3 votes, 4 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=bozho" rel="nofollow">Bozhidar Bozhanov</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9036?redirect=false" rel="nofollow">SPR-9036</a></strong> and commented</p> <p dir="auto">org.springframework.cache.interceptor.DefaultKeyGenerator is implemented by calculating the hashcode of all arguments. This is problematic in many cases:</p> <ul dir="auto"> <li>methods with similar signature - foo(int, String), foo(int, List) - if the 2nd argument is null they will get mixed</li> <li>methods with the same signature in different classes, using the same cache - they will get mixed</li> <li>is there a collision resolution mechanism? If not, things will randomly fail. Rarely, but they will. Imagine that the arguments of two distinct methods (that use the same cache region) evaluate to the same hashcode (not unlikely) - they will override each other's values, and possibly a ClassCastException will occur on retrieval</li> </ul> <p dir="auto">What is in the first place the reason to get the hashcodes? The underlying cache mechanism is a hashtable of some sort, so it will calculate the hash of the key anyway. But it will have a collision-resolution strategy, unlike the KeyGenerator.</p> <p dir="auto">I suggest:</p> <ul dir="auto"> <li>concatenating the string representations of primitives, and the hashcode of non-primitives.</li> <li>adding the class name and method name to the key</li> <li>optionally, where non-primitive values are used as keys, log a warning - this is usually wrong, as the hashcode will change even though the values inside the object are the same</li> </ul> <hr> <p dir="auto"><strong>Attachments:</strong></p> <ul dir="auto"> <li><a href="https://jira.spring.io/secure/attachment/20806/TestDefaultKeyGenerator.java" rel="nofollow">TestDefaultKeyGenerator.java</a> (<em>2.01 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="398156862" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14870" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14870/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14870">#14870</a> Cacheable key collision with DefaultKeyGenerator (<em><strong>"duplicates"</strong></em>)</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398156862" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14870" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14870/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14870">#14870</a> Cacheable key collision with DefaultKeyGenerator</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398118942" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14013" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14013/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14013">#14013</a> org.springframework.cache.interceptor.DefaultKeyGenerator has too weak hashing functionality</li> </ul> <p dir="auto">9 votes, 11 watchers</p>
1
<p dir="auto">Trying to create a numpy array from ctypes and ran into a problem which seems to be because of the <em>pack</em> attribute in ctypes. Anyone seen this before?</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import sys import ctypes import numpy as np print(sys.version) print(ctypes.__version__) print(np.__version__) class POINT(ctypes.Structure): _fields_ = [(&quot;x&quot;, ctypes.c_int), (&quot;y&quot;, ctypes.c_float)] class POINT_BUG(ctypes.Structure): _pack_ = 4 _fields_ = [(&quot;x&quot;, ctypes.c_int), (&quot;y&quot;, ctypes.c_float)] n = np.array((POINT*5)()) print(n) #This fails nb = np.array((POINT_BUG*5)())"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">sys</span> <span class="pl-k">import</span> <span class="pl-s1">ctypes</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-en">print</span>(<span class="pl-s1">sys</span>.<span class="pl-s1">version</span>) <span class="pl-en">print</span>(<span class="pl-s1">ctypes</span>.<span class="pl-s1">__version__</span>) <span class="pl-en">print</span>(<span class="pl-s1">np</span>.<span class="pl-s1">__version__</span>) <span class="pl-k">class</span> <span class="pl-v">POINT</span>(<span class="pl-s1">ctypes</span>.<span class="pl-v">Structure</span>): <span class="pl-s1">_fields_</span> <span class="pl-c1">=</span> [(<span class="pl-s">"x"</span>, <span class="pl-s1">ctypes</span>.<span class="pl-s1">c_int</span>), (<span class="pl-s">"y"</span>, <span class="pl-s1">ctypes</span>.<span class="pl-s1">c_float</span>)] <span class="pl-k">class</span> <span class="pl-v">POINT_BUG</span>(<span class="pl-s1">ctypes</span>.<span class="pl-v">Structure</span>): <span class="pl-s1">_pack_</span> <span class="pl-c1">=</span> <span class="pl-c1">4</span> <span class="pl-s1">_fields_</span> <span class="pl-c1">=</span> [(<span class="pl-s">"x"</span>, <span class="pl-s1">ctypes</span>.<span class="pl-s1">c_int</span>), (<span class="pl-s">"y"</span>, <span class="pl-s1">ctypes</span>.<span class="pl-s1">c_float</span>)] <span class="pl-s1">n</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>((<span class="pl-v">POINT</span><span class="pl-c1">*</span><span class="pl-c1">5</span>)()) <span class="pl-en">print</span>(<span class="pl-s1">n</span>) <span class="pl-c">#This fails</span> <span class="pl-s1">nb</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>((<span class="pl-v">POINT_BUG</span><span class="pl-c1">*</span><span class="pl-c1">5</span>)())</pre></div> <p dir="auto">Produces ouput:</p> <blockquote> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] 1.1.0 1.10.4 [(0, 0.0) (0, 0.0) (0, 0.0) (0, 0.0) (0, 0.0)] C:/Users/Mark/Desktop/bugreport.py:23: RuntimeWarning: Item size computed from the PEP 3118 buffer format string does not match the actual item size. (&quot;y&quot;, ctypes.c_float)] Traceback (most recent call last): File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt; File &quot;C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py&quot;, line 685, in runfile execfile(filename, namespace) File &quot;C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py&quot;, line 71, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc) File &quot;C:/Users/Mark/Desktop/bugreport.py&quot;, line 23, in &lt;module&gt; nb = np.array((POINT_BUG*5)()) TypeError: long() argument must be a string or a number, not 'POINT_BUG'"><pre class="notranslate"><code class="notranslate">2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] 1.1.0 1.10.4 [(0, 0.0) (0, 0.0) (0, 0.0) (0, 0.0) (0, 0.0)] C:/Users/Mark/Desktop/bugreport.py:23: RuntimeWarning: Item size computed from the PEP 3118 buffer format string does not match the actual item size. ("y", ctypes.c_float)] Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile execfile(filename, namespace) File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc) File "C:/Users/Mark/Desktop/bugreport.py", line 23, in &lt;module&gt; nb = np.array((POINT_BUG*5)()) TypeError: long() argument must be a string or a number, not 'POINT_BUG' </code></pre></div> </blockquote>
<p dir="auto">This seems like a bug inherited from ctypes, so maybe we need a workaround:</p> <p dir="auto">Start off with a very simple struct:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class foo(ctypes.Structure): _fields_ = [('a', ctypes.c_uint8), ('b', ctypes.c_uint32)] f = foo()"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-s1">foo</span>(<span class="pl-s1">ctypes</span>.<span class="pl-v">Structure</span>): <span class="pl-s1">_fields_</span> <span class="pl-c1">=</span> [(<span class="pl-s">'a'</span>, <span class="pl-s1">ctypes</span>.<span class="pl-s1">c_uint8</span>), (<span class="pl-s">'b'</span>, <span class="pl-s1">ctypes</span>.<span class="pl-s1">c_uint32</span>)] <span class="pl-s1">f</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span>()</pre></div> <p dir="auto">We'd expect this to insert padding, and it does:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; memoryview(f).itemsize # ok 8"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-en">memoryview</span>(<span class="pl-s1">f</span>).<span class="pl-s1">itemsize</span> <span class="pl-c"># ok</span> <span class="pl-c1">8</span></pre></div> <p dir="auto">But that padding doesn't show up in the format string:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; memoryview(f).format 'T{&lt;B:a:&lt;I:b:}'"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-en">memoryview</span>(<span class="pl-s1">f</span>).<span class="pl-s1">format</span> <span class="pl-s">'T{&lt;B:a:&lt;I:b:}'</span></pre></div> <p dir="auto">The docs for <code class="notranslate">struct</code> say that</p> <blockquote> <p dir="auto">No padding is added when using non-native size and alignment, e.g. with ‘&lt;’, ‘&gt;’ "</p> </blockquote> <p dir="auto">So this format has size 5, which contradicts <code class="notranslate">itemsize</code>.</p> <p dir="auto">Sure enough, we catch this in our PEP3118 parser:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; np.array(f) RuntimeWarning: Item size computed from the PEP 3118 buffer format string does not match the actual item size. Out[45]: array(&lt;__main__.foo object at 0x7f2715469bf8&gt;, dtype=object)"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>(<span class="pl-s1">f</span>) <span class="pl-v">RuntimeWarning</span>: <span class="pl-v">Item</span> <span class="pl-s1">size</span> <span class="pl-s1">computed</span> <span class="pl-k">from</span> <span class="pl-s1">the</span> <span class="pl-v">PEP</span> <span class="pl-c1">3118</span> <span class="pl-s1">buffer</span> <span class="pl-s1">format</span> <span class="pl-s1">string</span> <span class="pl-s1">does</span> <span class="pl-c1">not</span> <span class="pl-s1">match</span> <span class="pl-s1">the</span> <span class="pl-s1">actual</span> <span class="pl-s1">item</span> <span class="pl-s1">size</span>. <span class="pl-v">Out</span>[<span class="pl-c1">45</span>]: <span class="pl-s1">array</span>(<span class="pl-c1">&lt;</span><span class="pl-s1">__main__</span>.<span class="pl-s1">foo</span> <span class="pl-s1">object</span> <span class="pl-s1">at</span> <span class="pl-c1">0x7f2715469bf8</span><span class="pl-c1">&gt;</span>, <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">object</span>)</pre></div> <p dir="auto">I suspect there's already an issue for this - perhaps we need a PEP3118 tag.</p> <p dir="auto">The fix would be to special case <code class="notranslate">ctypes</code> objects in the array constructor, and not call <code class="notranslate">memoryview</code> on them because it doesn't actually work.</p> <hr> <p dir="auto">Worse yet, numpy doesn't stand a chance with an <em>unpadded</em> struct:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class foo(ctypes.Structure): _fields_ = [('a', ctypes.c_uint8), ('b', ctypes.c_uint32)] _pack_ = 1 f = foo()"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-s1">foo</span>(<span class="pl-s1">ctypes</span>.<span class="pl-v">Structure</span>): <span class="pl-s1">_fields_</span> <span class="pl-c1">=</span> [(<span class="pl-s">'a'</span>, <span class="pl-s1">ctypes</span>.<span class="pl-s1">c_uint8</span>), (<span class="pl-s">'b'</span>, <span class="pl-s1">ctypes</span>.<span class="pl-s1">c_uint32</span>)] <span class="pl-s1">_pack_</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span> <span class="pl-s1">f</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span>()</pre></div> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; memoryview(f).itemsize # ok 5 &gt;&gt;&gt; memoryview(f).format # WAT 'B'"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-en">memoryview</span>(<span class="pl-s1">f</span>).<span class="pl-s1">itemsize</span> <span class="pl-c"># ok</span> <span class="pl-c1">5</span> <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-en">memoryview</span>(<span class="pl-s1">f</span>).<span class="pl-s1">format</span> <span class="pl-c"># WAT</span> <span class="pl-s">'B'</span></pre></div>
1
<p dir="auto">Currently, the <code class="notranslate">sum</code> function use the element type (except for the boolean case) of the input array as result type. This is sometimes not a desirable choice:</p> <div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function mysum(R, x) s = zero(R) for v in x; s += v; end return s end julia&gt; x = uint8(rand(1:10, 50)); julia&gt; sum(x) 0x0000000000000122 # to prevent overflow julia&gt; mysum(Int, x) 290 julia&gt; a = rand(Float32, 10^6); julia&gt; sum(float64(a)) - sum(a) -0.018809685949236155 # to get higher accuracy julia&gt; sum(float64(a)) - mysum(0.0, a) 1.1641532182693481e-10"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">mysum</span>(R, x) s <span class="pl-k">=</span> <span class="pl-c1">zero</span>(R) <span class="pl-k">for</span> v <span class="pl-k">in</span> x; s <span class="pl-k">+=</span> v; <span class="pl-k">end</span> <span class="pl-k">return</span> s <span class="pl-k">end</span> julia<span class="pl-k">&gt;</span> x <span class="pl-k">=</span> <span class="pl-c1">uint8</span>(<span class="pl-c1">rand</span>(<span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">10</span>, <span class="pl-c1">50</span>)); julia<span class="pl-k">&gt;</span> <span class="pl-c1">sum</span>(x) <span class="pl-c1">0x0000000000000122</span> <span class="pl-c"><span class="pl-c">#</span> to prevent overflow</span> julia<span class="pl-k">&gt;</span> <span class="pl-c1">mysum</span>(Int, x) <span class="pl-c1">290</span> julia<span class="pl-k">&gt;</span> a <span class="pl-k">=</span> <span class="pl-c1">rand</span>(Float32, <span class="pl-c1">10</span><span class="pl-k">^</span><span class="pl-c1">6</span>); julia<span class="pl-k">&gt;</span> <span class="pl-c1">sum</span>(<span class="pl-c1">float64</span>(a)) <span class="pl-k">-</span> <span class="pl-c1">sum</span>(a) <span class="pl-k">-</span><span class="pl-c1">0.018809685949236155</span> <span class="pl-c"><span class="pl-c">#</span> to get higher accuracy</span> julia<span class="pl-k">&gt;</span> <span class="pl-c1">sum</span>(<span class="pl-c1">float64</span>(a)) <span class="pl-k">-</span> <span class="pl-c1">mysum</span>(<span class="pl-c1">0.0</span>, a) <span class="pl-c1">1.1641532182693481e-10</span></pre></div> <p dir="auto">My proposal is to add a method like <code class="notranslate">sum(R, x)</code> where <code class="notranslate">R</code> is the user-specifed type. This won't break any existing codes, but provide the user additional choices.</p>
<p dir="auto">Both the spec for <a href="https://github.github.com/gfm/#hard-line-breaks">Github Flavoured Markdown</a> and <a href="https://spec.commonmark.org/0.29/#hard-line-break" rel="nofollow">CommonMark</a> state:</p> <blockquote> <p dir="auto">A line break (not in a code span or HTML tag) that is preceded by two or more spaces and does not occur at the end of a block is parsed as a hard line break (rendered in HTML as a <br> tag):</p> </blockquote> <p dir="auto">But if you write such code in Julia, that new line is just replaced with a space; as if it were not preceded by two spaces in the source.</p> <div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; md&quot;foo bar&quot;.content 1-element Vector{Any}: Markdown.Paragraph(Any[&quot;foo bar&quot;])"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-s"><span class="pl-pds"><span class="pl-c1">md</span>"</span>foo</span> <span class="pl-s"> bar<span class="pl-pds">"</span></span><span class="pl-k">.</span>content <span class="pl-c1">1</span><span class="pl-k">-</span>element Vector{Any}<span class="pl-k">:</span> Markdown<span class="pl-k">.</span><span class="pl-c1">Paragraph</span>(Any[<span class="pl-s"><span class="pl-pds">"</span>foo bar<span class="pl-pds">"</span></span>])</pre></div> <p dir="auto">The correct output would be</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="1-element Vector{Any}: Markdown.Paragraph(Any[&quot;foo\nbar&quot;])"><pre class="notranslate"><code class="notranslate">1-element Vector{Any}: Markdown.Paragraph(Any["foo\nbar"]) </code></pre></div> <p dir="auto">This forces extra line breaks in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="778356984" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/39093" data-hovercard-type="pull_request" data-hovercard-url="/JuliaLang/julia/pull/39093/hovercard" href="https://github.com/JuliaLang/julia/pull/39093">#39093</a> as there is no way to have a linebreak without inserting a full blank line (i.e. making two <code class="notranslate">Markdown.Paragraphs</code>)</p>
0
<p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-add-borders-around-your-elements#?solution=%3Clink%20href%3D%22http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DLobster%22%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%3E%0A%3Cstyle%3E%0A%20%20.red-text%20%7B%0A%20%20%20%20color%3A%20red%3B%0A%20%20%7D%0A%0A%20%20h2%20%7B%0A%20%20%20%20font-family%3A%20Lobster%2C%20Monospace%3B%0A%20%20%7D%0A%0A%20%20p%20%7B%0A%20%20%20%20font-size%3A%2016px%3B%0A%20%20%20%20font-family%3A%20Monospace%3B%0A%20%20%7D%0A%0A%20%20.smaller-image%20%7B%0A%20%20%20%20width%3A%20100px%3B%0A%20%20%7D%0A%20%20.thick-green-border%20%7Bborder%3A%2010px%20solid%20green%3B%7D%0A%3C%2Fstyle%3E%0A%0A%3Ch2%20class%3D%22red-text%22%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%3Cimg%20class%3D%22smaller-image%20thick-green-border%22%20src%3D%22https%3A%2F%2Fbit.ly%2Ffcc-relaxing-cat%22%3E%0A%0A%3Cp%20class%3D%22red-text%22%3EKitty%20ipsum%20dolor%20sit%20amet%2C%20shed%20everywhere%20shed%20everywhere%20stretching%20attack%20your%20ankles%20chase%20the%20red%20dot%2C%20hairball%20run%20catnip%20eat%20the%20grass%20sniff.%3C%2Fp%3E%0A%3Cp%20class%3D%22red-text%22%3EPurr%20jump%20eat%20the%20grass%20rip%20the%20couch%20scratched%20sunbathe%2C%20shed%20everywhere%20rip%20the%20couch%20sleep%20in%20the%20sink%20fluffy%20fur%20catnip%20scratched.%3C%2Fp%3E%0A" rel="nofollow">Waypoint: Add Borders Around your Elements</a> has an issue.<br> User Agent is: <code class="notranslate">Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36</code>.<br> Please describe how to reproduce this issue, and include links to screenshots if possible.<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1360115/10397252/a861578e-6e74-11e5-870b-28e41435245d.png"><img width="1831" alt="screen shot 2015-10-09 at 10 55 43 am" src="https://cloud.githubusercontent.com/assets/1360115/10397252/a861578e-6e74-11e5-870b-28e41435245d.png" style="max-width: 100%;"></a></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="&lt;link href=&quot;http://fonts.googleapis.com/css?family=Lobster&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt; &lt;style&gt; .red-text { color: red; } h2 { font-family: Lobster, Monospace; } p { font-size: 16px; font-family: Monospace; } .smaller-image { width: 100px; } .thick-green-border {border: 10px solid green;} &lt;/style&gt; &lt;h2 class=&quot;red-text&quot;&gt;CatPhotoApp&lt;/h2&gt; &lt;img class=&quot;smaller-image thick-green-border&quot; src=&quot;https://bit.ly/fcc-relaxing-cat&quot;&gt; &lt;p class=&quot;red-text&quot;&gt;Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.&lt;/p&gt; &lt;p class=&quot;red-text&quot;&gt;Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.&lt;/p&gt; "><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">link</span> <span class="pl-c1">href</span>="<span class="pl-s">http://fonts.googleapis.com/css?family=Lobster</span>" <span class="pl-c1">rel</span>="<span class="pl-s">stylesheet</span>" <span class="pl-c1">type</span>="<span class="pl-s">text/css</span>"<span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">style</span><span class="pl-kos">&gt;</span> .<span class="pl-c1">red-text</span> { <span class="pl-c1">color</span><span class="pl-kos">:</span> red; } <span class="pl-ent">h2</span> { <span class="pl-c1">font-family</span><span class="pl-kos">:</span> Lobster<span class="pl-kos">,</span> Monospace; } <span class="pl-ent">p</span> { <span class="pl-c1">font-size</span><span class="pl-kos">:</span> <span class="pl-c1">16<span class="pl-smi">px</span></span>; <span class="pl-c1">font-family</span><span class="pl-kos">:</span> Monospace; } .<span class="pl-c1">smaller-image</span> { <span class="pl-c1">width</span><span class="pl-kos">:</span> <span class="pl-c1">100<span class="pl-smi">px</span></span>; } .<span class="pl-c1">thick-green-border</span> {<span class="pl-c1">border</span><span class="pl-kos">:</span> <span class="pl-c1">10<span class="pl-smi">px</span></span> solid green;} <span class="pl-kos">&lt;/</span><span class="pl-ent">style</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">h2</span> <span class="pl-c1">class</span>="<span class="pl-s">red-text</span>"<span class="pl-kos">&gt;</span>CatPhotoApp<span class="pl-kos">&lt;/</span><span class="pl-ent">h2</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">img</span> <span class="pl-c1">class</span>="<span class="pl-s">smaller-image thick-green-border</span>" <span class="pl-c1">src</span>="<span class="pl-s">https://bit.ly/fcc-relaxing-cat</span>"<span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">p</span> <span class="pl-c1">class</span>="<span class="pl-s">red-text</span>"<span class="pl-kos">&gt;</span>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.<span class="pl-kos">&lt;/</span><span class="pl-ent">p</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">p</span> <span class="pl-c1">class</span>="<span class="pl-s">red-text</span>"<span class="pl-kos">&gt;</span>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.<span class="pl-kos">&lt;/</span><span class="pl-ent">p</span><span class="pl-kos">&gt;</span></pre></div>
<p dir="auto">Challenge <a href="http://freecodecamp.com/challenges/waypoint-add-borders-around-your-elements" rel="nofollow">http://freecodecamp.com/challenges/waypoint-add-borders-around-your-elements</a> has an issue. "Give your image a border width of 10px doesn't work.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/589755355db80b2b5bf6cdc491c5d610e532d09c7608d3af7affbc40aee974ca/687474703a2f2f692e696d6775722e636f6d2f54635a366776372e706e67"><img src="https://camo.githubusercontent.com/589755355db80b2b5bf6cdc491c5d610e532d09c7608d3af7affbc40aee974ca/687474703a2f2f692e696d6775722e636f6d2f54635a366776372e706e67" data-canonical-src="http://i.imgur.com/TcZ6gv7.png" style="max-width: 100%;"></a></p>
1
<p dir="auto">Here is a very simple program which employs trait objects:</p> <p dir="auto"><code class="notranslate">c.rc</code>:</p> <div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#[crate_id = &quot;c#0.1&quot;]; #[crate_type = &quot;bin&quot;]; mod m1; mod m2;"><pre class="notranslate"><span class="pl-c1">#<span class="pl-kos">[</span>crate_id = <span class="pl-s">"c#0.1"</span><span class="pl-kos">]</span></span><span class="pl-kos">;</span> <span class="pl-c1">#<span class="pl-kos">[</span>crate_type = <span class="pl-s">"bin"</span><span class="pl-kos">]</span></span><span class="pl-kos">;</span> <span class="pl-k">mod</span> m1<span class="pl-kos">;</span> <span class="pl-k">mod</span> m2<span class="pl-kos">;</span></pre></div> <p dir="auto"><code class="notranslate">m1.rs</code>:</p> <div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use std::io; pub struct Container&lt;'a&gt; { priv reader: &amp;'a mut Reader } impl&lt;'a&gt; Container&lt;'a&gt; { pub fn wrap&lt;'s&gt;(reader: &amp;'s mut Reader) -&gt; Container&lt;'s&gt; { Container { reader: reader } } pub fn read_to(&amp;self, vec: &amp;mut [u8]) { self.reader.read(vec); } } pub fn for_stdin&lt;'a&gt;() -&gt; Container&lt;'a&gt; { let mut r = io::stdin(); Container::wrap(&amp;mut r as &amp;mut Reader) }"><pre class="notranslate"><span class="pl-k">use</span> std<span class="pl-kos">::</span>io<span class="pl-kos">;</span> <span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">Container</span><span class="pl-kos">&lt;</span><span class="pl-c1">'</span><span class="pl-ent">a</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span> priv <span class="pl-c1">reader</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-c1">'</span><span class="pl-ent">a</span> <span class="pl-k">mut</span> <span class="pl-smi">Reader</span> <span class="pl-kos">}</span> <span class="pl-k">impl</span><span class="pl-kos">&lt;</span><span class="pl-c1">'</span><span class="pl-ent">a</span><span class="pl-kos">&gt;</span> <span class="pl-smi">Container</span><span class="pl-kos">&lt;</span><span class="pl-c1">'</span><span class="pl-ent">a</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">pub</span> <span class="pl-k">fn</span> <span class="pl-en">wrap</span><span class="pl-kos">&lt;</span><span class="pl-c1">'</span><span class="pl-ent">s</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">reader</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-c1">'</span><span class="pl-ent">s</span> <span class="pl-k">mut</span> <span class="pl-smi">Reader</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">Container</span><span class="pl-kos">&lt;</span><span class="pl-c1">'</span><span class="pl-ent">s</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span> <span class="pl-smi">Container</span> <span class="pl-kos">{</span> <span class="pl-c1">reader</span><span class="pl-kos">:</span> reader <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">read_to</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span><span class="pl-smi">self</span><span class="pl-kos">,</span> <span class="pl-s1">vec</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-k">mut</span> <span class="pl-kos">[</span><span class="pl-smi">u8</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">self</span><span class="pl-kos">.</span><span class="pl-c1">reader</span><span class="pl-kos">.</span><span class="pl-en">read</span><span class="pl-kos">(</span>vec<span class="pl-kos">)</span><span class="pl-kos">;</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">for_stdin</span><span class="pl-kos">&lt;</span><span class="pl-c1">'</span><span class="pl-ent">a</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span> -&gt; <span class="pl-smi">Container</span><span class="pl-kos">&lt;</span><span class="pl-c1">'</span><span class="pl-ent">a</span><span class="pl-kos">&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">let</span> <span class="pl-k">mut</span> r = io<span class="pl-kos">::</span><span class="pl-en">stdin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-smi">Container</span><span class="pl-kos">::</span><span class="pl-en">wrap</span><span class="pl-kos">(</span><span class="pl-c1">&amp;</span><span class="pl-k">mut</span> r <span class="pl-k">as</span> <span class="pl-c1">&amp;</span><span class="pl-k">mut</span> <span class="pl-smi">Reader</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></pre></div> <p dir="auto"><code class="notranslate">m2.rs</code>:</p> <div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use std::vec; use m1; #[main] fn main() { let c = m1::for_stdin(); let mut v = vec::from_elem(10, 0u8); c.read_to(v.as_mut_slice()); }"><pre class="notranslate"><span class="pl-k">use</span> std<span class="pl-kos">::</span>vec<span class="pl-kos">;</span> <span class="pl-k">use</span> m1<span class="pl-kos">;</span> <span class="pl-c1">#<span class="pl-kos">[</span>main<span class="pl-kos">]</span></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-k">let</span> c = m1<span class="pl-kos">::</span><span class="pl-en">for_stdin</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">let</span> <span class="pl-k">mut</span> v = vec<span class="pl-kos">::</span><span class="pl-en">from_elem</span><span class="pl-kos">(</span><span class="pl-c1">10</span><span class="pl-kos">,</span> <span class="pl-c1">0u8</span><span class="pl-kos">)</span><span class="pl-kos">;</span> c<span class="pl-kos">.</span><span class="pl-en">read_to</span><span class="pl-kos">(</span>v<span class="pl-kos">.</span><span class="pl-en">as_mut_slice</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">When this program is compiled and run, it fails with segmentation fault:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="% rustc c.rc % ./c zsh: segmentation fault (core dumped) ./c"><pre class="notranslate"><code class="notranslate">% rustc c.rc % ./c zsh: segmentation fault (core dumped) ./c </code></pre></div> <p dir="auto">This program is not correct. You can see that <code class="notranslate">m1::for_stdin()</code> function produces a <code class="notranslate">Container&lt;'a, ...&gt;</code> for arbitrary lifetime <code class="notranslate">'a</code>, but the local variable <code class="notranslate">r</code> is valid only for <code class="notranslate">for_stdin()</code> body. A pointer to <code class="notranslate">r</code>, however, is saved to the <code class="notranslate">Container</code>, and when it is accessed inside <code class="notranslate">m2::main()</code>, a segmentation fault occurs. However, Rust still compiles it. I thought that borrowing checker should prevent this kind of errors.</p> <p dir="auto">BTW, I can write <code class="notranslate">&amp;mut r</code> or <code class="notranslate">&amp;mut r as &amp;mut Reader</code> and it will compile either way, but I thought that when going from plain pointers to trait objects I should always specify exact kind of trait object. Not sure that I'm right here thought.</p>
<p dir="auto">Currently obj constructors capture type parameters, but binds don't. Fix this.</p> <p dir="auto">(Possibly share more code with obj constructors? They're doing quite a bit of the same work, seems a shame to have so much duplication)</p>
0
<p dir="auto">Hi,</p> <p dir="auto">I am in the process of migrating our codebase to React 0.14.x. During this I encountered a problem, because of the fact that our client side uses <code class="notranslate">React.renderToStaticMarkup</code> to render React components and passing the results around as strings (I know, not ideal, but given what our codebase was previously, this is sadly needed for us in some cases).</p> <p dir="auto">However, given my understanding of the structural changes with <code class="notranslate">react</code> and <code class="notranslate">react-dom</code> packages, as I can tell, I am not supposed to simply call <code class="notranslate">React.renderToStaticMarkup</code> any more, and the API is not accessible from the <code class="notranslate">react-dom</code> package. I do not use webpack (yet!), so at the moment using <code class="notranslate">react-dom/server</code> is not appropriate for me.</p> <p dir="auto">What is the supported way (if any?) of calling <code class="notranslate">React.renderToStaticMarkup</code> in the browser, using the pre-built packages?</p>
<p dir="auto">We have some corner cases within our client-side application which requires <code class="notranslate">React.renderToString</code> functionality. In 0.14, this has been deprecated in favor of <code class="notranslate">ReactDOMServer.renderToString</code>. Unfortunately, the bower distribution does not include a way to reference <code class="notranslate">ReactDOMServer</code>.</p>
1
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface Promise&lt;T&gt; { then&lt;U&gt;(cb: (x: T) =&gt; Promise&lt;U&gt;): Promise&lt;U&gt;; } // Consider both orderings of the following overloads declare function testFunction(n: number): Promise&lt;number&gt;; declare function testFunction(s: string): Promise&lt;string&gt;; var numPromise: Promise&lt;number&gt;; var newPromise = numPromise.then(testFunction);"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">Promise</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-c1">then</span><span class="pl-c1">&lt;</span><span class="pl-smi">U</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">cb</span>: <span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">T</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi">U</span><span class="pl-kos">&gt;</span><span class="pl-kos">)</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi">U</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-c">// Consider both orderings of the following overloads</span> <span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">testFunction</span><span class="pl-kos">(</span><span class="pl-s1">n</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi">number</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span> <span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">testFunction</span><span class="pl-kos">(</span><span class="pl-s1">s</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi">string</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span> <span class="pl-k">var</span> <span class="pl-s1">numPromise</span>: <span class="pl-smi">Promise</span><span class="pl-kos">&lt;</span><span class="pl-smi">number</span><span class="pl-kos">&gt;</span><span class="pl-kos">;</span> <span class="pl-k">var</span> <span class="pl-s1">newPromise</span> <span class="pl-c1">=</span> <span class="pl-s1">numPromise</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-s1">testFunction</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">In the old compiler, with either ordering of the overloads, newPromise had type <code class="notranslate">Promise&lt;{}&gt;</code>.<br> In the new compiler, if the number signature comes first, we get an error. If the string signature comes first, newPromise is of type <code class="notranslate">Promise&lt;number&gt;</code>! This is very inconsistent.<br> We have based this on the notion that the last overload will always be more general than the preceding overloads. However, with disjoint overloads, we are essentially giving the last one undue priority. The rule of thumb is that in a call, the first overload has priority, so giving the last one priority when passing a callback seems really unintuitive.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface Opts { url: string; } declare function doit(url: string): number; declare function doit(opts: Opts): boolean; declare function call&lt;T, U&gt;(fn: (arg: T) =&gt; U, arg: T): U; var n: number = call(doit, 'here'); var b: boolean = call(doit, { url: 'here' });"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">Opts</span> <span class="pl-kos">{</span> <span class="pl-c1">url</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">doit</span><span class="pl-kos">(</span><span class="pl-s1">url</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span> <span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">doit</span><span class="pl-kos">(</span><span class="pl-s1">opts</span>: <span class="pl-smi">Opts</span><span class="pl-kos">)</span>: <span class="pl-smi">boolean</span><span class="pl-kos">;</span> <span class="pl-k">declare</span> <span class="pl-k">function</span> <span class="pl-s1">call</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">,</span> <span class="pl-smi">U</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-s1">fn</span>: <span class="pl-kos">(</span><span class="pl-s1">arg</span>: <span class="pl-smi">T</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">U</span><span class="pl-kos">,</span> <span class="pl-s1">arg</span>: <span class="pl-smi">T</span><span class="pl-kos">)</span>: <span class="pl-smi">U</span><span class="pl-kos">;</span> <span class="pl-k">var</span> <span class="pl-s1">n</span>: <span class="pl-smi">number</span> <span class="pl-c1">=</span> <span class="pl-en">call</span><span class="pl-kos">(</span><span class="pl-s1">doit</span><span class="pl-kos">,</span> <span class="pl-s">'here'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">var</span> <span class="pl-s1">b</span>: <span class="pl-smi">boolean</span> <span class="pl-c1">=</span> <span class="pl-en">call</span><span class="pl-kos">(</span><span class="pl-s1">doit</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">url</span>: <span class="pl-s">'here'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">In 1.4.1.0 this snippet errors out with</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test.ts(8,17): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'Opts' is not a valid type argument because it is not a supertype of candidate 'string'."><pre class="notranslate"><code class="notranslate">test.ts(8,17): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'Opts' is not a valid type argument because it is not a supertype of candidate 'string'. </code></pre></div> <p dir="auto">changing line 8 to <code class="notranslate">... = call&lt;string, number&gt;(doit, 'here');</code> successfully compiles as expected.</p> <p dir="auto">While playing around with this I noticed that while 1.3.0.0 would allow the <code class="notranslate">call(doit, 'here')</code> invocation it was still choosing the second overload of <code class="notranslate">doit</code> resulting in a return type of <code class="notranslate">boolean</code> and causing a compile error on the assignment. I'm glad 1.4.1.0 is now catching this error case, but it seems like inference of the type parameters should be entirely possible here.</p>
1
<h1 dir="auto">Environment</h1> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Platform ServicePack Version VersionString -------- ----------- ------- ------------- Win32NT 10.0.18995.0 Microsoft Windows NT 10.0.18995.0 Windows Terminal version (if applicable): nightly build from Oct 3 Any other software?"><pre lang="none" class="notranslate"><code class="notranslate">Platform ServicePack Version VersionString -------- ----------- ------- ------------- Win32NT 10.0.18995.0 Microsoft Windows NT 10.0.18995.0 Windows Terminal version (if applicable): nightly build from Oct 3 Any other software? </code></pre></div> <h1 dir="auto">Steps to reproduce</h1> <p dir="auto">Add another profile in the json. Drop down shows too many.</p> <h1 dir="auto">Expected behavior</h1> <p dir="auto">The list of profiles in the drop down should match the profiles.json</p> <h1 dir="auto">Actual behavior</h1> <p dir="auto">An extra entry is in the list. There is no profile 5. What's strange is that when I launch that bogus profile, it doesn't look like the one I set up:</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1427284/66160679-a5ee0380-e5f8-11e9-8c73-a6de1bb67d57.png"><img src="https://user-images.githubusercontent.com/1427284/66160679-a5ee0380-e5f8-11e9-8c73-a6de1bb67d57.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto">The "real" profile for Windows PowerShell looks like this:</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1427284/66160708-b605e300-e5f8-11e9-9714-3db2c21a5164.png"><img src="https://user-images.githubusercontent.com/1427284/66160708-b605e300-e5f8-11e9-9714-3db2c21a5164.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto">Here's the profile list as shown by Terminal. Note the extra bogus profile that's not in the profiles.json</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1427284/66160411-15172800-e5f8-11e9-8f2c-d0721964bad7.png"><img src="https://user-images.githubusercontent.com/1427284/66160411-15172800-e5f8-11e9-8f2c-d0721964bad7.png" alt="image" style="max-width: 100%;"></a></p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{ &quot;$schema&quot;: &quot;https://aka.ms/terminal-profiles-schema&quot;, &quot;globals&quot; : { &quot;alwaysShowTabs&quot; : true, &quot;defaultProfile&quot; : &quot;{5fa4ec8f-b1ff-4d94-b239-1321ccccc69b}&quot;, &quot;initialCols&quot; : 120, &quot;initialRows&quot; : 40, &quot;keybindings&quot; : [ { &quot;command&quot; : &quot;closeTab&quot;, &quot;keys&quot; : [ &quot;ctrl+w&quot; ] }, { &quot;command&quot; : &quot;newTab&quot;, &quot;keys&quot; : [ &quot;ctrl+t&quot; ] }, { &quot;command&quot; : &quot;newTabProfile0&quot;, &quot;keys&quot; : [ &quot;ctrl+shift+1&quot; ] }, { &quot;command&quot; : &quot;newTabProfile1&quot;, &quot;keys&quot; : [ &quot;ctrl+shift+2&quot; ] }, { &quot;command&quot; : &quot;newTabProfile2&quot;, &quot;keys&quot; : [ &quot;ctrl+shift+3&quot; ] }, { &quot;command&quot; : &quot;newTabProfile3&quot;, &quot;keys&quot; : [ &quot;ctrl+shift+4&quot; ] }, { &quot;command&quot; : &quot;newTabProfile4&quot;, &quot;keys&quot; : [ &quot;ctrl+shift+5&quot; ] }, { &quot;command&quot; : &quot;newTabProfile5&quot;, &quot;keys&quot; : [ &quot;ctrl+shift+6&quot; ] }, { &quot;command&quot; : &quot;newTabProfile6&quot;, &quot;keys&quot; : [ &quot;ctrl+shift+7&quot; ] }, { &quot;command&quot; : &quot;newTabProfile7&quot;, &quot;keys&quot; : [ &quot;ctrl+shift+8&quot; ] }, { &quot;command&quot; : &quot;newTabProfile8&quot;, &quot;keys&quot; : [ &quot;ctrl+shift+9&quot; ] }, { &quot;command&quot; : &quot;nextTab&quot;, &quot;keys&quot; : [ &quot;ctrl+tab&quot; ] }, { &quot;command&quot; : &quot;prevTab&quot;, &quot;keys&quot; : [ &quot;ctrl+shift+tab&quot; ] }, { &quot;command&quot; : &quot;scrollDown&quot;, &quot;keys&quot; : [ &quot;ctrl+shift+down&quot; ] }, { &quot;command&quot; : &quot;scrollDownPage&quot;, &quot;keys&quot; : [ &quot;ctrl+shift+pgdn&quot; ] }, { &quot;command&quot; : &quot;scrollUp&quot;, &quot;keys&quot; : [ &quot;ctrl+shift+up&quot; ] }, { &quot;command&quot; : &quot;scrollUpPage&quot;, &quot;keys&quot; : [ &quot;ctrl+shift+pgup&quot; ] }, { &quot;command&quot; : &quot;switchToTab0&quot;, &quot;keys&quot; : [ &quot;alt+1&quot; ] }, { &quot;command&quot; : &quot;switchToTab1&quot;, &quot;keys&quot; : [ &quot;alt+2&quot; ] }, { &quot;command&quot; : &quot;switchToTab2&quot;, &quot;keys&quot; : [ &quot;alt+3&quot; ] }, { &quot;command&quot; : &quot;switchToTab3&quot;, &quot;keys&quot; : [ &quot;alt+4&quot; ] }, { &quot;command&quot; : &quot;switchToTab4&quot;, &quot;keys&quot; : [ &quot;alt+5&quot; ] }, { &quot;command&quot; : &quot;switchToTab5&quot;, &quot;keys&quot; : [ &quot;alt+6&quot; ] }, { &quot;command&quot; : &quot;switchToTab6&quot;, &quot;keys&quot; : [ &quot;alt+7&quot; ] }, { &quot;command&quot; : &quot;switchToTab7&quot;, &quot;keys&quot; : [ &quot;alt+8&quot; ] }, { &quot;command&quot; : &quot;switchToTab8&quot;, &quot;keys&quot; : [ &quot;alt+9&quot; ] } ], &quot;requestedTheme&quot; : &quot;system&quot;, &quot;showTabsInTitlebar&quot; : true, &quot;showTerminalTitleInTitlebar&quot; : true, &quot;wordDelimiters&quot; : &quot; ./\\()\&quot;'-:,.;&lt;&gt;~!@#$%^&amp;*|+=[]{}~?\u2502&quot; }, &quot;profiles&quot;: [ { &quot;acrylicOpacity&quot;: 0.75, &quot;background&quot;: &quot;#2E3436&quot;, &quot;closeOnExit&quot;: true, &quot;colorScheme&quot;: &quot;Ubuntu (Brad)&quot;, &quot;commandline&quot;: &quot;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe&quot;, &quot;cursorColor&quot;: &quot;#B5BBAE&quot;, &quot;cursorShape&quot;: &quot;bar&quot;, &quot;fontFace&quot;: &quot;UbuntuMono NF&quot;, &quot;fontSize&quot;: 10, &quot;guid&quot;: &quot;{5fa4ec8f-b1ff-4d94-b239-1321ccccc69a}&quot;, &quot;historySize&quot;: 9001, &quot;icon&quot;: &quot;ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png&quot;, &quot;name&quot;: &quot;Windows PowerShell&quot;, &quot;padding&quot;: &quot;0, 0, 0, 0&quot;, &quot;snapOnInput&quot;: true, &quot;startingDirectory&quot;: &quot;d:\\dev&quot;, &quot;useAcrylic&quot;: true }, { &quot;acrylicOpacity&quot;: 0.75, &quot;closeOnExit&quot;: true, &quot;colorScheme&quot;: &quot;Campbell&quot;, &quot;commandline&quot;: &quot;cmd.exe&quot;, &quot;cursorColor&quot;: &quot;#FFFFFF&quot;, &quot;cursorShape&quot;: &quot;bar&quot;, &quot;fontFace&quot;: &quot;Consolas&quot;, &quot;fontSize&quot;: 10, &quot;guid&quot;: &quot;{0caa0dad-35be-5f56-a8ff-afceeeaa6101}&quot;, &quot;historySize&quot;: 9001, &quot;icon&quot;: &quot;ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png&quot;, &quot;name&quot;: &quot;cmd&quot;, &quot;padding&quot;: &quot;0, 0, 0, 0&quot;, &quot;snapOnInput&quot;: true, &quot;startingDirectory&quot;: &quot;d:\\dev&quot;, &quot;useAcrylic&quot;: true }, { &quot;acrylicOpacity&quot;: 0.5, &quot;closeOnExit&quot;: true, &quot;colorScheme&quot;: &quot;Campbell&quot;, &quot;commandline&quot;: &quot;wsl.exe -d Ubuntu&quot;, &quot;cursorColor&quot;: &quot;#FFFFFF&quot;, &quot;cursorShape&quot;: &quot;bar&quot;, &quot;fontFace&quot;: &quot;Consolas&quot;, &quot;fontSize&quot;: 10, &quot;guid&quot;: &quot;{2c4de342-38b7-51cf-b940-2309a097f518}&quot;, &quot;historySize&quot;: 9001, &quot;icon&quot;: &quot;ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png&quot;, &quot;name&quot;: &quot;Ubuntu&quot;, &quot;padding&quot;: &quot;0, 0, 0, 0&quot;, &quot;snapOnInput&quot;: true, &quot;startingDirectory&quot;: &quot;d:\\dev&quot;, &quot;useAcrylic&quot;: false }, { &quot;acrylicOpacity&quot;: 0.75, &quot;background&quot;: &quot;#2E3436&quot;, &quot;closeOnExit&quot;: true, &quot;colorScheme&quot;: &quot;Ubuntu (Brad)&quot;, &quot;commandline&quot;: &quot;pwsh.exe&quot;, &quot;cursorColor&quot;: &quot;#B5BBAE&quot;, &quot;cursorShape&quot;: &quot;bar&quot;, &quot;fontFace&quot;: &quot;UbuntuMono NF&quot;, &quot;fontSize&quot;: 10, &quot;guid&quot;: &quot;{5fa4ec8f-b1ff-4d94-b239-1321ccccc69b}&quot;, &quot;historySize&quot;: 9001, &quot;icon&quot;: &quot;ms-appx:///ProfileIcons/{574e775e-4f2a-5b96-ac1e-a2962a402336}.png&quot;, &quot;name&quot;: &quot;PowerShell Core&quot;, &quot;padding&quot;: &quot;0, 0, 0, 0&quot;, &quot;snapOnInput&quot;: true, &quot;startingDirectory&quot;: &quot;d:\\dev&quot;, &quot;useAcrylic&quot;: true } ], &quot;schemes&quot; : [ { &quot;background&quot; : &quot;#2E3436&quot;, &quot;black&quot; : &quot;#2E3436&quot;, &quot;blue&quot; : &quot;#3465A4&quot;, &quot;brightBlack&quot; : &quot;#696B67&quot;, &quot;brightBlue&quot; : &quot;#729FCF&quot;, &quot;brightCyan&quot; : &quot;#34E2E2&quot;, &quot;brightGreen&quot; : &quot;#8AE234&quot;, &quot;brightPurple&quot; : &quot;#AD7FA8&quot;, &quot;brightRed&quot; : &quot;#F49797&quot;, &quot;brightWhite&quot; : &quot;#FBFBFB&quot;, &quot;brightYellow&quot; : &quot;#FCE94F&quot;, &quot;cyan&quot; : &quot;#06989A&quot;, &quot;foreground&quot; : &quot;#B5BBAE&quot;, &quot;green&quot; : &quot;#4E9A06&quot;, &quot;name&quot; : &quot;Ubuntu (Brad)&quot;, &quot;purple&quot; : &quot;#75507B&quot;, &quot;red&quot; : &quot;#AE5E5E&quot;, &quot;white&quot; : &quot;#B5BBAE&quot;, &quot;yellow&quot; : &quot;#C4A000&quot; }, { &quot;background&quot; : &quot;#0C0C0C&quot;, &quot;black&quot; : &quot;#0C0C0C&quot;, &quot;blue&quot; : &quot;#0037DA&quot;, &quot;brightBlack&quot; : &quot;#767676&quot;, &quot;brightBlue&quot; : &quot;#3B78FF&quot;, &quot;brightCyan&quot; : &quot;#61D6D6&quot;, &quot;brightGreen&quot; : &quot;#16C60C&quot;, &quot;brightPurple&quot; : &quot;#B4009E&quot;, &quot;brightRed&quot; : &quot;#E74856&quot;, &quot;brightWhite&quot; : &quot;#F2F2F2&quot;, &quot;brightYellow&quot; : &quot;#F9F1A5&quot;, &quot;cyan&quot; : &quot;#3A96DD&quot;, &quot;foreground&quot; : &quot;#F2F2F2&quot;, &quot;green&quot; : &quot;#13A10E&quot;, &quot;name&quot; : &quot;Campbell&quot;, &quot;purple&quot; : &quot;#881798&quot;, &quot;red&quot; : &quot;#C50F1F&quot;, &quot;white&quot; : &quot;#CCCCCC&quot;, &quot;yellow&quot; : &quot;#C19C00&quot; }, { &quot;background&quot; : &quot;#282C34&quot;, &quot;black&quot; : &quot;#282C34&quot;, &quot;blue&quot; : &quot;#61AFEF&quot;, &quot;brightBlack&quot; : &quot;#5A6374&quot;, &quot;brightBlue&quot; : &quot;#61AFEF&quot;, &quot;brightCyan&quot; : &quot;#56B6C2&quot;, &quot;brightGreen&quot; : &quot;#98C379&quot;, &quot;brightPurple&quot; : &quot;#C678DD&quot;, &quot;brightRed&quot; : &quot;#E06C75&quot;, &quot;brightWhite&quot; : &quot;#DCDFE4&quot;, &quot;brightYellow&quot; : &quot;#E5C07B&quot;, &quot;cyan&quot; : &quot;#56B6C2&quot;, &quot;foreground&quot; : &quot;#DCDFE4&quot;, &quot;green&quot; : &quot;#98C379&quot;, &quot;name&quot; : &quot;One Half Dark&quot;, &quot;purple&quot; : &quot;#C678DD&quot;, &quot;red&quot; : &quot;#E06C75&quot;, &quot;white&quot; : &quot;#DCDFE4&quot;, &quot;yellow&quot; : &quot;#E5C07B&quot; }, { &quot;background&quot; : &quot;#FAFAFA&quot;, &quot;black&quot; : &quot;#383A42&quot;, &quot;blue&quot; : &quot;#0184BC&quot;, &quot;brightBlack&quot; : &quot;#4F525D&quot;, &quot;brightBlue&quot; : &quot;#61AFEF&quot;, &quot;brightCyan&quot; : &quot;#56B5C1&quot;, &quot;brightGreen&quot; : &quot;#98C379&quot;, &quot;brightPurple&quot; : &quot;#C577DD&quot;, &quot;brightRed&quot; : &quot;#DF6C75&quot;, &quot;brightWhite&quot; : &quot;#FFFFFF&quot;, &quot;brightYellow&quot; : &quot;#E4C07A&quot;, &quot;cyan&quot; : &quot;#0997B3&quot;, &quot;foreground&quot; : &quot;#383A42&quot;, &quot;green&quot; : &quot;#50A14F&quot;, &quot;name&quot; : &quot;One Half Light&quot;, &quot;purple&quot; : &quot;#A626A4&quot;, &quot;red&quot; : &quot;#E45649&quot;, &quot;white&quot; : &quot;#FAFAFA&quot;, &quot;yellow&quot; : &quot;#C18301&quot; }, { &quot;background&quot; : &quot;#073642&quot;, &quot;black&quot; : &quot;#073642&quot;, &quot;blue&quot; : &quot;#268BD2&quot;, &quot;brightBlack&quot; : &quot;#002B36&quot;, &quot;brightBlue&quot; : &quot;#839496&quot;, &quot;brightCyan&quot; : &quot;#93A1A1&quot;, &quot;brightGreen&quot; : &quot;#586E75&quot;, &quot;brightPurple&quot; : &quot;#6C71C4&quot;, &quot;brightRed&quot; : &quot;#CB4B16&quot;, &quot;brightWhite&quot; : &quot;#FDF6E3&quot;, &quot;brightYellow&quot; : &quot;#657B83&quot;, &quot;cyan&quot; : &quot;#2AA198&quot;, &quot;foreground&quot; : &quot;#FDF6E3&quot;, &quot;green&quot; : &quot;#859900&quot;, &quot;name&quot; : &quot;Solarized Dark&quot;, &quot;purple&quot; : &quot;#D33682&quot;, &quot;red&quot; : &quot;#D30102&quot;, &quot;white&quot; : &quot;#EEE8D5&quot;, &quot;yellow&quot; : &quot;#B58900&quot; }, { &quot;background&quot; : &quot;#FDF6E3&quot;, &quot;black&quot; : &quot;#073642&quot;, &quot;blue&quot; : &quot;#268BD2&quot;, &quot;brightBlack&quot; : &quot;#002B36&quot;, &quot;brightBlue&quot; : &quot;#839496&quot;, &quot;brightCyan&quot; : &quot;#93A1A1&quot;, &quot;brightGreen&quot; : &quot;#586E75&quot;, &quot;brightPurple&quot; : &quot;#6C71C4&quot;, &quot;brightRed&quot; : &quot;#CB4B16&quot;, &quot;brightWhite&quot; : &quot;#FDF6E3&quot;, &quot;brightYellow&quot; : &quot;#657B83&quot;, &quot;cyan&quot; : &quot;#2AA198&quot;, &quot;foreground&quot; : &quot;#073642&quot;, &quot;green&quot; : &quot;#859900&quot;, &quot;name&quot; : &quot;Solarized Light&quot;, &quot;purple&quot; : &quot;#D33682&quot;, &quot;red&quot; : &quot;#D30102&quot;, &quot;white&quot; : &quot;#EEE8D5&quot;, &quot;yellow&quot; : &quot;#B58900&quot; } ] }"><pre class="notranslate">{ <span class="pl-ent">"$schema"</span>: <span class="pl-s"><span class="pl-pds">"</span>https://aka.ms/terminal-profiles-schema<span class="pl-pds">"</span></span>, <span class="pl-ent">"globals"</span> : { <span class="pl-ent">"alwaysShowTabs"</span> : <span class="pl-c1">true</span>, <span class="pl-ent">"defaultProfile"</span> : <span class="pl-s"><span class="pl-pds">"</span>{5fa4ec8f-b1ff-4d94-b239-1321ccccc69b}<span class="pl-pds">"</span></span>, <span class="pl-ent">"initialCols"</span> : <span class="pl-c1">120</span>, <span class="pl-ent">"initialRows"</span> : <span class="pl-c1">40</span>, <span class="pl-ent">"keybindings"</span> : [ { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>closeTab<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+w<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>newTab<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+t<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>newTabProfile0<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+shift+1<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>newTabProfile1<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+shift+2<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>newTabProfile2<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+shift+3<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>newTabProfile3<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+shift+4<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>newTabProfile4<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+shift+5<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>newTabProfile5<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+shift+6<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>newTabProfile6<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+shift+7<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>newTabProfile7<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+shift+8<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>newTabProfile8<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+shift+9<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>nextTab<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+tab<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>prevTab<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+shift+tab<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>scrollDown<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+shift+down<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>scrollDownPage<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+shift+pgdn<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>scrollUp<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+shift+up<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>scrollUpPage<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>ctrl+shift+pgup<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>switchToTab0<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>alt+1<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>switchToTab1<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>alt+2<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>switchToTab2<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>alt+3<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>switchToTab3<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>alt+4<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>switchToTab4<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>alt+5<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>switchToTab5<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>alt+6<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>switchToTab6<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>alt+7<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>switchToTab7<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>alt+8<span class="pl-pds">"</span></span> ] }, { <span class="pl-ent">"command"</span> : <span class="pl-s"><span class="pl-pds">"</span>switchToTab8<span class="pl-pds">"</span></span>, <span class="pl-ent">"keys"</span> : [ <span class="pl-s"><span class="pl-pds">"</span>alt+9<span class="pl-pds">"</span></span> ] } ], <span class="pl-ent">"requestedTheme"</span> : <span class="pl-s"><span class="pl-pds">"</span>system<span class="pl-pds">"</span></span>, <span class="pl-ent">"showTabsInTitlebar"</span> : <span class="pl-c1">true</span>, <span class="pl-ent">"showTerminalTitleInTitlebar"</span> : <span class="pl-c1">true</span>, <span class="pl-ent">"wordDelimiters"</span> : <span class="pl-s"><span class="pl-pds">"</span> ./<span class="pl-cce">\\</span>()<span class="pl-cce">\"</span>'-:,.;&lt;&gt;~!@#$%^&amp;*|+=[]{}~?<span class="pl-cce">\u2502</span><span class="pl-pds">"</span></span> }, <span class="pl-ent">"profiles"</span>: [ { <span class="pl-ent">"acrylicOpacity"</span>: <span class="pl-c1">0.75</span>, <span class="pl-ent">"background"</span>: <span class="pl-s"><span class="pl-pds">"</span>#2E3436<span class="pl-pds">"</span></span>, <span class="pl-ent">"closeOnExit"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"colorScheme"</span>: <span class="pl-s"><span class="pl-pds">"</span>Ubuntu (Brad)<span class="pl-pds">"</span></span>, <span class="pl-ent">"commandline"</span>: <span class="pl-s"><span class="pl-pds">"</span>C:<span class="pl-cce">\\</span>Windows<span class="pl-cce">\\</span>System32<span class="pl-cce">\\</span>WindowsPowerShell<span class="pl-cce">\\</span>v1.0<span class="pl-cce">\\</span>powershell.exe<span class="pl-pds">"</span></span>, <span class="pl-ent">"cursorColor"</span>: <span class="pl-s"><span class="pl-pds">"</span>#B5BBAE<span class="pl-pds">"</span></span>, <span class="pl-ent">"cursorShape"</span>: <span class="pl-s"><span class="pl-pds">"</span>bar<span class="pl-pds">"</span></span>, <span class="pl-ent">"fontFace"</span>: <span class="pl-s"><span class="pl-pds">"</span>UbuntuMono NF<span class="pl-pds">"</span></span>, <span class="pl-ent">"fontSize"</span>: <span class="pl-c1">10</span>, <span class="pl-ent">"guid"</span>: <span class="pl-s"><span class="pl-pds">"</span>{5fa4ec8f-b1ff-4d94-b239-1321ccccc69a}<span class="pl-pds">"</span></span>, <span class="pl-ent">"historySize"</span>: <span class="pl-c1">9001</span>, <span class="pl-ent">"icon"</span>: <span class="pl-s"><span class="pl-pds">"</span>ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png<span class="pl-pds">"</span></span>, <span class="pl-ent">"name"</span>: <span class="pl-s"><span class="pl-pds">"</span>Windows PowerShell<span class="pl-pds">"</span></span>, <span class="pl-ent">"padding"</span>: <span class="pl-s"><span class="pl-pds">"</span>0, 0, 0, 0<span class="pl-pds">"</span></span>, <span class="pl-ent">"snapOnInput"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"startingDirectory"</span>: <span class="pl-s"><span class="pl-pds">"</span>d:<span class="pl-cce">\\</span>dev<span class="pl-pds">"</span></span>, <span class="pl-ent">"useAcrylic"</span>: <span class="pl-c1">true</span> }, { <span class="pl-ent">"acrylicOpacity"</span>: <span class="pl-c1">0.75</span>, <span class="pl-ent">"closeOnExit"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"colorScheme"</span>: <span class="pl-s"><span class="pl-pds">"</span>Campbell<span class="pl-pds">"</span></span>, <span class="pl-ent">"commandline"</span>: <span class="pl-s"><span class="pl-pds">"</span>cmd.exe<span class="pl-pds">"</span></span>, <span class="pl-ent">"cursorColor"</span>: <span class="pl-s"><span class="pl-pds">"</span>#FFFFFF<span class="pl-pds">"</span></span>, <span class="pl-ent">"cursorShape"</span>: <span class="pl-s"><span class="pl-pds">"</span>bar<span class="pl-pds">"</span></span>, <span class="pl-ent">"fontFace"</span>: <span class="pl-s"><span class="pl-pds">"</span>Consolas<span class="pl-pds">"</span></span>, <span class="pl-ent">"fontSize"</span>: <span class="pl-c1">10</span>, <span class="pl-ent">"guid"</span>: <span class="pl-s"><span class="pl-pds">"</span>{0caa0dad-35be-5f56-a8ff-afceeeaa6101}<span class="pl-pds">"</span></span>, <span class="pl-ent">"historySize"</span>: <span class="pl-c1">9001</span>, <span class="pl-ent">"icon"</span>: <span class="pl-s"><span class="pl-pds">"</span>ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png<span class="pl-pds">"</span></span>, <span class="pl-ent">"name"</span>: <span class="pl-s"><span class="pl-pds">"</span>cmd<span class="pl-pds">"</span></span>, <span class="pl-ent">"padding"</span>: <span class="pl-s"><span class="pl-pds">"</span>0, 0, 0, 0<span class="pl-pds">"</span></span>, <span class="pl-ent">"snapOnInput"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"startingDirectory"</span>: <span class="pl-s"><span class="pl-pds">"</span>d:<span class="pl-cce">\\</span>dev<span class="pl-pds">"</span></span>, <span class="pl-ent">"useAcrylic"</span>: <span class="pl-c1">true</span> }, { <span class="pl-ent">"acrylicOpacity"</span>: <span class="pl-c1">0.5</span>, <span class="pl-ent">"closeOnExit"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"colorScheme"</span>: <span class="pl-s"><span class="pl-pds">"</span>Campbell<span class="pl-pds">"</span></span>, <span class="pl-ent">"commandline"</span>: <span class="pl-s"><span class="pl-pds">"</span>wsl.exe -d Ubuntu<span class="pl-pds">"</span></span>, <span class="pl-ent">"cursorColor"</span>: <span class="pl-s"><span class="pl-pds">"</span>#FFFFFF<span class="pl-pds">"</span></span>, <span class="pl-ent">"cursorShape"</span>: <span class="pl-s"><span class="pl-pds">"</span>bar<span class="pl-pds">"</span></span>, <span class="pl-ent">"fontFace"</span>: <span class="pl-s"><span class="pl-pds">"</span>Consolas<span class="pl-pds">"</span></span>, <span class="pl-ent">"fontSize"</span>: <span class="pl-c1">10</span>, <span class="pl-ent">"guid"</span>: <span class="pl-s"><span class="pl-pds">"</span>{2c4de342-38b7-51cf-b940-2309a097f518}<span class="pl-pds">"</span></span>, <span class="pl-ent">"historySize"</span>: <span class="pl-c1">9001</span>, <span class="pl-ent">"icon"</span>: <span class="pl-s"><span class="pl-pds">"</span>ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png<span class="pl-pds">"</span></span>, <span class="pl-ent">"name"</span>: <span class="pl-s"><span class="pl-pds">"</span>Ubuntu<span class="pl-pds">"</span></span>, <span class="pl-ent">"padding"</span>: <span class="pl-s"><span class="pl-pds">"</span>0, 0, 0, 0<span class="pl-pds">"</span></span>, <span class="pl-ent">"snapOnInput"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"startingDirectory"</span>: <span class="pl-s"><span class="pl-pds">"</span>d:<span class="pl-cce">\\</span>dev<span class="pl-pds">"</span></span>, <span class="pl-ent">"useAcrylic"</span>: <span class="pl-c1">false</span> }, { <span class="pl-ent">"acrylicOpacity"</span>: <span class="pl-c1">0.75</span>, <span class="pl-ent">"background"</span>: <span class="pl-s"><span class="pl-pds">"</span>#2E3436<span class="pl-pds">"</span></span>, <span class="pl-ent">"closeOnExit"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"colorScheme"</span>: <span class="pl-s"><span class="pl-pds">"</span>Ubuntu (Brad)<span class="pl-pds">"</span></span>, <span class="pl-ent">"commandline"</span>: <span class="pl-s"><span class="pl-pds">"</span>pwsh.exe<span class="pl-pds">"</span></span>, <span class="pl-ent">"cursorColor"</span>: <span class="pl-s"><span class="pl-pds">"</span>#B5BBAE<span class="pl-pds">"</span></span>, <span class="pl-ent">"cursorShape"</span>: <span class="pl-s"><span class="pl-pds">"</span>bar<span class="pl-pds">"</span></span>, <span class="pl-ent">"fontFace"</span>: <span class="pl-s"><span class="pl-pds">"</span>UbuntuMono NF<span class="pl-pds">"</span></span>, <span class="pl-ent">"fontSize"</span>: <span class="pl-c1">10</span>, <span class="pl-ent">"guid"</span>: <span class="pl-s"><span class="pl-pds">"</span>{5fa4ec8f-b1ff-4d94-b239-1321ccccc69b}<span class="pl-pds">"</span></span>, <span class="pl-ent">"historySize"</span>: <span class="pl-c1">9001</span>, <span class="pl-ent">"icon"</span>: <span class="pl-s"><span class="pl-pds">"</span>ms-appx:///ProfileIcons/{574e775e-4f2a-5b96-ac1e-a2962a402336}.png<span class="pl-pds">"</span></span>, <span class="pl-ent">"name"</span>: <span class="pl-s"><span class="pl-pds">"</span>PowerShell Core<span class="pl-pds">"</span></span>, <span class="pl-ent">"padding"</span>: <span class="pl-s"><span class="pl-pds">"</span>0, 0, 0, 0<span class="pl-pds">"</span></span>, <span class="pl-ent">"snapOnInput"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"startingDirectory"</span>: <span class="pl-s"><span class="pl-pds">"</span>d:<span class="pl-cce">\\</span>dev<span class="pl-pds">"</span></span>, <span class="pl-ent">"useAcrylic"</span>: <span class="pl-c1">true</span> } ], <span class="pl-ent">"schemes"</span> : [ { <span class="pl-ent">"background"</span> : <span class="pl-s"><span class="pl-pds">"</span>#2E3436<span class="pl-pds">"</span></span>, <span class="pl-ent">"black"</span> : <span class="pl-s"><span class="pl-pds">"</span>#2E3436<span class="pl-pds">"</span></span>, <span class="pl-ent">"blue"</span> : <span class="pl-s"><span class="pl-pds">"</span>#3465A4<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightBlack"</span> : <span class="pl-s"><span class="pl-pds">"</span>#696B67<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightBlue"</span> : <span class="pl-s"><span class="pl-pds">"</span>#729FCF<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightCyan"</span> : <span class="pl-s"><span class="pl-pds">"</span>#34E2E2<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightGreen"</span> : <span class="pl-s"><span class="pl-pds">"</span>#8AE234<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightPurple"</span> : <span class="pl-s"><span class="pl-pds">"</span>#AD7FA8<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightRed"</span> : <span class="pl-s"><span class="pl-pds">"</span>#F49797<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightWhite"</span> : <span class="pl-s"><span class="pl-pds">"</span>#FBFBFB<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightYellow"</span> : <span class="pl-s"><span class="pl-pds">"</span>#FCE94F<span class="pl-pds">"</span></span>, <span class="pl-ent">"cyan"</span> : <span class="pl-s"><span class="pl-pds">"</span>#06989A<span class="pl-pds">"</span></span>, <span class="pl-ent">"foreground"</span> : <span class="pl-s"><span class="pl-pds">"</span>#B5BBAE<span class="pl-pds">"</span></span>, <span class="pl-ent">"green"</span> : <span class="pl-s"><span class="pl-pds">"</span>#4E9A06<span class="pl-pds">"</span></span>, <span class="pl-ent">"name"</span> : <span class="pl-s"><span class="pl-pds">"</span>Ubuntu (Brad)<span class="pl-pds">"</span></span>, <span class="pl-ent">"purple"</span> : <span class="pl-s"><span class="pl-pds">"</span>#75507B<span class="pl-pds">"</span></span>, <span class="pl-ent">"red"</span> : <span class="pl-s"><span class="pl-pds">"</span>#AE5E5E<span class="pl-pds">"</span></span>, <span class="pl-ent">"white"</span> : <span class="pl-s"><span class="pl-pds">"</span>#B5BBAE<span class="pl-pds">"</span></span>, <span class="pl-ent">"yellow"</span> : <span class="pl-s"><span class="pl-pds">"</span>#C4A000<span class="pl-pds">"</span></span> }, { <span class="pl-ent">"background"</span> : <span class="pl-s"><span class="pl-pds">"</span>#0C0C0C<span class="pl-pds">"</span></span>, <span class="pl-ent">"black"</span> : <span class="pl-s"><span class="pl-pds">"</span>#0C0C0C<span class="pl-pds">"</span></span>, <span class="pl-ent">"blue"</span> : <span class="pl-s"><span class="pl-pds">"</span>#0037DA<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightBlack"</span> : <span class="pl-s"><span class="pl-pds">"</span>#767676<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightBlue"</span> : <span class="pl-s"><span class="pl-pds">"</span>#3B78FF<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightCyan"</span> : <span class="pl-s"><span class="pl-pds">"</span>#61D6D6<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightGreen"</span> : <span class="pl-s"><span class="pl-pds">"</span>#16C60C<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightPurple"</span> : <span class="pl-s"><span class="pl-pds">"</span>#B4009E<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightRed"</span> : <span class="pl-s"><span class="pl-pds">"</span>#E74856<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightWhite"</span> : <span class="pl-s"><span class="pl-pds">"</span>#F2F2F2<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightYellow"</span> : <span class="pl-s"><span class="pl-pds">"</span>#F9F1A5<span class="pl-pds">"</span></span>, <span class="pl-ent">"cyan"</span> : <span class="pl-s"><span class="pl-pds">"</span>#3A96DD<span class="pl-pds">"</span></span>, <span class="pl-ent">"foreground"</span> : <span class="pl-s"><span class="pl-pds">"</span>#F2F2F2<span class="pl-pds">"</span></span>, <span class="pl-ent">"green"</span> : <span class="pl-s"><span class="pl-pds">"</span>#13A10E<span class="pl-pds">"</span></span>, <span class="pl-ent">"name"</span> : <span class="pl-s"><span class="pl-pds">"</span>Campbell<span class="pl-pds">"</span></span>, <span class="pl-ent">"purple"</span> : <span class="pl-s"><span class="pl-pds">"</span>#881798<span class="pl-pds">"</span></span>, <span class="pl-ent">"red"</span> : <span class="pl-s"><span class="pl-pds">"</span>#C50F1F<span class="pl-pds">"</span></span>, <span class="pl-ent">"white"</span> : <span class="pl-s"><span class="pl-pds">"</span>#CCCCCC<span class="pl-pds">"</span></span>, <span class="pl-ent">"yellow"</span> : <span class="pl-s"><span class="pl-pds">"</span>#C19C00<span class="pl-pds">"</span></span> }, { <span class="pl-ent">"background"</span> : <span class="pl-s"><span class="pl-pds">"</span>#282C34<span class="pl-pds">"</span></span>, <span class="pl-ent">"black"</span> : <span class="pl-s"><span class="pl-pds">"</span>#282C34<span class="pl-pds">"</span></span>, <span class="pl-ent">"blue"</span> : <span class="pl-s"><span class="pl-pds">"</span>#61AFEF<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightBlack"</span> : <span class="pl-s"><span class="pl-pds">"</span>#5A6374<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightBlue"</span> : <span class="pl-s"><span class="pl-pds">"</span>#61AFEF<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightCyan"</span> : <span class="pl-s"><span class="pl-pds">"</span>#56B6C2<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightGreen"</span> : <span class="pl-s"><span class="pl-pds">"</span>#98C379<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightPurple"</span> : <span class="pl-s"><span class="pl-pds">"</span>#C678DD<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightRed"</span> : <span class="pl-s"><span class="pl-pds">"</span>#E06C75<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightWhite"</span> : <span class="pl-s"><span class="pl-pds">"</span>#DCDFE4<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightYellow"</span> : <span class="pl-s"><span class="pl-pds">"</span>#E5C07B<span class="pl-pds">"</span></span>, <span class="pl-ent">"cyan"</span> : <span class="pl-s"><span class="pl-pds">"</span>#56B6C2<span class="pl-pds">"</span></span>, <span class="pl-ent">"foreground"</span> : <span class="pl-s"><span class="pl-pds">"</span>#DCDFE4<span class="pl-pds">"</span></span>, <span class="pl-ent">"green"</span> : <span class="pl-s"><span class="pl-pds">"</span>#98C379<span class="pl-pds">"</span></span>, <span class="pl-ent">"name"</span> : <span class="pl-s"><span class="pl-pds">"</span>One Half Dark<span class="pl-pds">"</span></span>, <span class="pl-ent">"purple"</span> : <span class="pl-s"><span class="pl-pds">"</span>#C678DD<span class="pl-pds">"</span></span>, <span class="pl-ent">"red"</span> : <span class="pl-s"><span class="pl-pds">"</span>#E06C75<span class="pl-pds">"</span></span>, <span class="pl-ent">"white"</span> : <span class="pl-s"><span class="pl-pds">"</span>#DCDFE4<span class="pl-pds">"</span></span>, <span class="pl-ent">"yellow"</span> : <span class="pl-s"><span class="pl-pds">"</span>#E5C07B<span class="pl-pds">"</span></span> }, { <span class="pl-ent">"background"</span> : <span class="pl-s"><span class="pl-pds">"</span>#FAFAFA<span class="pl-pds">"</span></span>, <span class="pl-ent">"black"</span> : <span class="pl-s"><span class="pl-pds">"</span>#383A42<span class="pl-pds">"</span></span>, <span class="pl-ent">"blue"</span> : <span class="pl-s"><span class="pl-pds">"</span>#0184BC<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightBlack"</span> : <span class="pl-s"><span class="pl-pds">"</span>#4F525D<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightBlue"</span> : <span class="pl-s"><span class="pl-pds">"</span>#61AFEF<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightCyan"</span> : <span class="pl-s"><span class="pl-pds">"</span>#56B5C1<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightGreen"</span> : <span class="pl-s"><span class="pl-pds">"</span>#98C379<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightPurple"</span> : <span class="pl-s"><span class="pl-pds">"</span>#C577DD<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightRed"</span> : <span class="pl-s"><span class="pl-pds">"</span>#DF6C75<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightWhite"</span> : <span class="pl-s"><span class="pl-pds">"</span>#FFFFFF<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightYellow"</span> : <span class="pl-s"><span class="pl-pds">"</span>#E4C07A<span class="pl-pds">"</span></span>, <span class="pl-ent">"cyan"</span> : <span class="pl-s"><span class="pl-pds">"</span>#0997B3<span class="pl-pds">"</span></span>, <span class="pl-ent">"foreground"</span> : <span class="pl-s"><span class="pl-pds">"</span>#383A42<span class="pl-pds">"</span></span>, <span class="pl-ent">"green"</span> : <span class="pl-s"><span class="pl-pds">"</span>#50A14F<span class="pl-pds">"</span></span>, <span class="pl-ent">"name"</span> : <span class="pl-s"><span class="pl-pds">"</span>One Half Light<span class="pl-pds">"</span></span>, <span class="pl-ent">"purple"</span> : <span class="pl-s"><span class="pl-pds">"</span>#A626A4<span class="pl-pds">"</span></span>, <span class="pl-ent">"red"</span> : <span class="pl-s"><span class="pl-pds">"</span>#E45649<span class="pl-pds">"</span></span>, <span class="pl-ent">"white"</span> : <span class="pl-s"><span class="pl-pds">"</span>#FAFAFA<span class="pl-pds">"</span></span>, <span class="pl-ent">"yellow"</span> : <span class="pl-s"><span class="pl-pds">"</span>#C18301<span class="pl-pds">"</span></span> }, { <span class="pl-ent">"background"</span> : <span class="pl-s"><span class="pl-pds">"</span>#073642<span class="pl-pds">"</span></span>, <span class="pl-ent">"black"</span> : <span class="pl-s"><span class="pl-pds">"</span>#073642<span class="pl-pds">"</span></span>, <span class="pl-ent">"blue"</span> : <span class="pl-s"><span class="pl-pds">"</span>#268BD2<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightBlack"</span> : <span class="pl-s"><span class="pl-pds">"</span>#002B36<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightBlue"</span> : <span class="pl-s"><span class="pl-pds">"</span>#839496<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightCyan"</span> : <span class="pl-s"><span class="pl-pds">"</span>#93A1A1<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightGreen"</span> : <span class="pl-s"><span class="pl-pds">"</span>#586E75<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightPurple"</span> : <span class="pl-s"><span class="pl-pds">"</span>#6C71C4<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightRed"</span> : <span class="pl-s"><span class="pl-pds">"</span>#CB4B16<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightWhite"</span> : <span class="pl-s"><span class="pl-pds">"</span>#FDF6E3<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightYellow"</span> : <span class="pl-s"><span class="pl-pds">"</span>#657B83<span class="pl-pds">"</span></span>, <span class="pl-ent">"cyan"</span> : <span class="pl-s"><span class="pl-pds">"</span>#2AA198<span class="pl-pds">"</span></span>, <span class="pl-ent">"foreground"</span> : <span class="pl-s"><span class="pl-pds">"</span>#FDF6E3<span class="pl-pds">"</span></span>, <span class="pl-ent">"green"</span> : <span class="pl-s"><span class="pl-pds">"</span>#859900<span class="pl-pds">"</span></span>, <span class="pl-ent">"name"</span> : <span class="pl-s"><span class="pl-pds">"</span>Solarized Dark<span class="pl-pds">"</span></span>, <span class="pl-ent">"purple"</span> : <span class="pl-s"><span class="pl-pds">"</span>#D33682<span class="pl-pds">"</span></span>, <span class="pl-ent">"red"</span> : <span class="pl-s"><span class="pl-pds">"</span>#D30102<span class="pl-pds">"</span></span>, <span class="pl-ent">"white"</span> : <span class="pl-s"><span class="pl-pds">"</span>#EEE8D5<span class="pl-pds">"</span></span>, <span class="pl-ent">"yellow"</span> : <span class="pl-s"><span class="pl-pds">"</span>#B58900<span class="pl-pds">"</span></span> }, { <span class="pl-ent">"background"</span> : <span class="pl-s"><span class="pl-pds">"</span>#FDF6E3<span class="pl-pds">"</span></span>, <span class="pl-ent">"black"</span> : <span class="pl-s"><span class="pl-pds">"</span>#073642<span class="pl-pds">"</span></span>, <span class="pl-ent">"blue"</span> : <span class="pl-s"><span class="pl-pds">"</span>#268BD2<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightBlack"</span> : <span class="pl-s"><span class="pl-pds">"</span>#002B36<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightBlue"</span> : <span class="pl-s"><span class="pl-pds">"</span>#839496<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightCyan"</span> : <span class="pl-s"><span class="pl-pds">"</span>#93A1A1<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightGreen"</span> : <span class="pl-s"><span class="pl-pds">"</span>#586E75<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightPurple"</span> : <span class="pl-s"><span class="pl-pds">"</span>#6C71C4<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightRed"</span> : <span class="pl-s"><span class="pl-pds">"</span>#CB4B16<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightWhite"</span> : <span class="pl-s"><span class="pl-pds">"</span>#FDF6E3<span class="pl-pds">"</span></span>, <span class="pl-ent">"brightYellow"</span> : <span class="pl-s"><span class="pl-pds">"</span>#657B83<span class="pl-pds">"</span></span>, <span class="pl-ent">"cyan"</span> : <span class="pl-s"><span class="pl-pds">"</span>#2AA198<span class="pl-pds">"</span></span>, <span class="pl-ent">"foreground"</span> : <span class="pl-s"><span class="pl-pds">"</span>#073642<span class="pl-pds">"</span></span>, <span class="pl-ent">"green"</span> : <span class="pl-s"><span class="pl-pds">"</span>#859900<span class="pl-pds">"</span></span>, <span class="pl-ent">"name"</span> : <span class="pl-s"><span class="pl-pds">"</span>Solarized Light<span class="pl-pds">"</span></span>, <span class="pl-ent">"purple"</span> : <span class="pl-s"><span class="pl-pds">"</span>#D33682<span class="pl-pds">"</span></span>, <span class="pl-ent">"red"</span> : <span class="pl-s"><span class="pl-pds">"</span>#D30102<span class="pl-pds">"</span></span>, <span class="pl-ent">"white"</span> : <span class="pl-s"><span class="pl-pds">"</span>#EEE8D5<span class="pl-pds">"</span></span>, <span class="pl-ent">"yellow"</span> : <span class="pl-s"><span class="pl-pds">"</span>#B58900<span class="pl-pds">"</span></span> } ] }</pre></div>
<h1 dir="auto">Environment</h1> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: Version 10.0.18362.239 Windows Terminal version (if applicable): 0.3.2142.0 Any other software? WSL, Ubuntu 1804 from Windows Store"><pre class="notranslate"><code class="notranslate">Windows build number: Version 10.0.18362.239 Windows Terminal version (if applicable): 0.3.2142.0 Any other software? WSL, Ubuntu 1804 from Windows Store </code></pre></div> <h1 dir="auto">Steps to reproduce</h1> <ul dir="auto"> <li> <p dir="auto">Have WSL setup already</p> </li> <li> <p dir="auto">Install Ubuntu 18.04 from windows store</p> </li> <li> <p dir="auto">Have the following two profiles from sample json into <code class="notranslate">profiles.json</code></p> </li> <li> <p dir="auto">In <code class="notranslate">cmd</code> run <code class="notranslate">wsl -s Ubuntu-18.04</code> to set it as default.</p> </li> <li> <p dir="auto">In cmd, run <code class="notranslate">wsl</code> and observe that you are in Ubuntu 18.04</p> </li> <li> <p dir="auto">Open Terminal Preview, open a tab representing the Ubuntu 18.04 profile</p> </li> <li> <p dir="auto">Observe you are in Legacy WSL</p> </li> <li> <p dir="auto">In Legacy WSL, run <code class="notranslate">bash.exe</code> or <code class="notranslate">wsl.exe</code></p> </li> <li> <p dir="auto">Observe you are now in Ubuntu 18.04</p> </li> <li></li> </ul> <h3 dir="auto">Sample json</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" { &quot;acrylicOpacity&quot; : 0.80000001192092896, &quot;closeOnExit&quot; : true, &quot;colorScheme&quot; : &quot;Campbell&quot;, &quot;commandline&quot; : &quot;wsl.exe -d Legacy&quot;, &quot;cursorColor&quot; : &quot;#FFFFFF&quot;, &quot;cursorShape&quot; : &quot;bar&quot;, &quot;fontFace&quot; : &quot;Hack&quot;, &quot;fontSize&quot; : 10, &quot;guid&quot; : &quot;{6e9fa4d2-a4aa-562d-b1fa-0789dc1f83d7}&quot;, &quot;historySize&quot; : 9001, &quot;icon&quot; : &quot;ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png&quot;, &quot;name&quot; : &quot;WSL Bash&quot;, &quot;name&quot; : &quot;Ubuntu (WSL)&quot;, &quot;padding&quot; : &quot;0, 0, 0, 0&quot;, &quot;snapOnInput&quot; : true, &quot;useAcrylic&quot; : true }, { &quot;acrylicOpacity&quot; : 0.80000001192092896, &quot;closeOnExit&quot; : true, &quot;colorScheme&quot; : &quot;Campbell&quot;, &quot;commandline&quot; : &quot;wsl.exe -d Ubuntu-18.04&quot;, &quot;cursorColor&quot; : &quot;#FFFFFF&quot;, &quot;cursorShape&quot; : &quot;bar&quot;, &quot;fontFace&quot; : &quot;Hack&quot;, &quot;fontSize&quot; : 10, &quot;guid&quot; : &quot;{6e9fa4d2-a4aa-562d-b1fa-0789dc1f83d7}&quot;, &quot;historySize&quot; : 9001, &quot;icon&quot; : &quot;ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png&quot;, &quot;name&quot; : &quot;WSL Bash&quot;, &quot;tabTitle&quot; : &quot;Ubuntu 18.04 (WSL)&quot;, &quot;padding&quot; : &quot;0, 0, 0, 0&quot;, &quot;snapOnInput&quot; : true, &quot;useAcrylic&quot; : true }"><pre class="notranslate"><code class="notranslate"> { "acrylicOpacity" : 0.80000001192092896, "closeOnExit" : true, "colorScheme" : "Campbell", "commandline" : "wsl.exe -d Legacy", "cursorColor" : "#FFFFFF", "cursorShape" : "bar", "fontFace" : "Hack", "fontSize" : 10, "guid" : "{6e9fa4d2-a4aa-562d-b1fa-0789dc1f83d7}", "historySize" : 9001, "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png", "name" : "WSL Bash", "name" : "Ubuntu (WSL)", "padding" : "0, 0, 0, 0", "snapOnInput" : true, "useAcrylic" : true }, { "acrylicOpacity" : 0.80000001192092896, "closeOnExit" : true, "colorScheme" : "Campbell", "commandline" : "wsl.exe -d Ubuntu-18.04", "cursorColor" : "#FFFFFF", "cursorShape" : "bar", "fontFace" : "Hack", "fontSize" : 10, "guid" : "{6e9fa4d2-a4aa-562d-b1fa-0789dc1f83d7}", "historySize" : 9001, "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png", "name" : "WSL Bash", "tabTitle" : "Ubuntu 18.04 (WSL)", "padding" : "0, 0, 0, 0", "snapOnInput" : true, "useAcrylic" : true } </code></pre></div> <h1 dir="auto">Expected behavior</h1> <p dir="auto">If you launch <code class="notranslate">wsl</code> from <code class="notranslate">cmd</code>, <code class="notranslate">powershell</code> or a <code class="notranslate">wsl</code> instance you have certain controls. You can use the <code class="notranslate">-l</code> flag to list your wsl instances, <code class="notranslate">-d</code> to launch one by name and <code class="notranslate">-s</code> to set a specific instance as the default.</p> <p dir="auto">If you launch this command from any commandline instance you have available, Linux or NT, it behaves as you expect.</p> <p dir="auto">I expect Terminal's <code class="notranslate">profiles.json</code> to respect these commandline flags and behave as if it is actually launching a subshell of the instance I choose to launch.</p> <p dir="auto">Hypothetically able to launch certain terminal applications directly from the <code class="notranslate">commandline</code> key.</p> <h1 dir="auto">Actual behavior</h1> <p dir="auto">If you launch this command from the "commandline" key in the <code class="notranslate">profiles.json</code> wsl will always run legacy, regardless as to whether you <code class="notranslate">-s</code> set the default and launch <code class="notranslate">bash.exe</code> or <code class="notranslate">wsl.exe</code> or if you include <code class="notranslate">-d</code> in the commandline key and manually select your desired distribution.</p> <h2 dir="auto">Note</h2> <p dir="auto">I did search and see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="461580282" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/1674" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/1674/hovercard" href="https://github.com/microsoft/terminal/issues/1674">#1674</a> read through it and determine that this bug is of a more specific nature as to the behavior of the Windows terminal than that issue and I believe it is of a different scope.</p>
0
<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"> 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/puneetar/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/puneetar">@puneetar</a></li> </ul> </li> </ul> <p dir="auto">The recent update of the Express types break all my apps because <code class="notranslate">express.Response</code> obviously no longer has any accessible properties. Example: <a href="https://circleci.com/gh/manuelbieh/react-ssr-setup/104" rel="nofollow">https://circleci.com/gh/manuelbieh/react-ssr-setup/104</a></p> <p dir="auto">Not sure if I might be using it incorrectly but since I also only see one tiny test with a very specific testcase (sending <code class="notranslate">json()</code> as response) I think there's a chance that this is a bug.</p>
<p dir="auto">If you know how to fix the issue, make a pull request instead.</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/express</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/borisyankov/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/borisyankov">@borisyankov</a>, <a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/CMUH/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/CMUH">@CMUH</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rockwyc992/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rockwyc992">@rockwyc992</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/OliverJAsh/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/OliverJAsh">@OliverJAsh</a></li> </ul> </li> </ul> <p dir="auto">My builds are throwing the following errors after upgrades to latest version of the @types/express package:</p> <p dir="auto"><code class="notranslate">Property 'headers' does not exist on type 'Request&lt;any&gt;'</code></p> <p dir="auto"><code class="notranslate">Property 'query' does not exist on type 'Request&lt;any&gt;'</code></p> <p dir="auto"><code class="notranslate">Property 'body' does not exist on type 'Request&lt;any&gt;'</code></p> <p dir="auto">We have changed nothing on our end. I also noticed that my TS environment, when I open up the index.d.ts of @types/express shows the following errors:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="`express-serve-static-core` has no exported member 'ParamsDictionary' `express-serve-static-core` has no exported member 'Params' `express-serve-static-core` has no exported member 'Params'"><pre class="notranslate"><code class="notranslate">`express-serve-static-core` has no exported member 'ParamsDictionary' `express-serve-static-core` has no exported member 'Params' `express-serve-static-core` has no exported member 'Params' </code></pre></div> <p dir="auto">Some kind of breaking change seems to have been introduced, and I cannot seem to find any guidelines on how to address.</p>
1
<p dir="auto">When doing some math works in pandas, the rolling function is very useful, such as pd.rolling().mean() or<br> pd.rolling().max().<br> Here is my problem: when I want to get a time-series rank in a Series or a column in DataFrame, there is no function like pd.rolling().rank(). Is there any function can work as pd.rolling().rank() ?</p>
<p dir="auto">xref SO issue <a href="http://stackoverflow.com/questions/29391787/rolling-argmax-in-pandas/29423104#29423104" rel="nofollow">here</a></p> <p dir="auto">Im looking to set the rolling rank on a dataframe. Having posted, discussed and analysed the code it looks like the suggested way would be to use the pandas Series.rank function as an argument in rolling_apply. However on large datasets the performance is particularly poor. I have tried different implementations and using bottlenecks rank method orders of magnitude faster, but that only offers the average option for ties. It is also still some way off the performance of rolling_mean. I have previously implemented a rolling rank function which monitors changes on a moving window (in a similar way to algos.roll_mean I believe) rather that recalculating the rank from scratch on each window. Below is an example to highlight the performance, it should be possible to implement a rolling rank with comparable performance to rolling_mean.</p> <p dir="auto">python: 2.7.3<br> pandas: 0.15.2<br> scipy: 0.10.1<br> bottleneck: 0.7.0</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="rollWindow = 240 df = pd.DataFrame(np.random.randn(100000,4), columns=list('ABCD'), index=pd.date_range('1/1/2000', periods=100000, freq='1H')) df.iloc[-3:-1]['A'] = 7.5 df.iloc[-1]['A'] = 5.5 df[&quot;SER_RK&quot;] = pd.rolling_apply(df[&quot;A&quot;], rollWindow, rollingRankOnSeries) #28.9secs (allows competition/min ranking for ties) df[&quot;SCIPY_RK&quot;] = pd.rolling_apply(df[&quot;A&quot;], rollWindow, rollingRankSciPy) #70.89secs (allows competition/min ranking for ties) df[&quot;BNECK_RK&quot;] = pd.rolling_apply(df[&quot;A&quot;], rollWindow, rollingRankBottleneck) #3.64secs (only provides average ranking for ties) df[&quot;ASRT_RK&quot;] = pd.rolling_apply(df[&quot;A&quot;], rollWindow, rollingRankArgSort) #3.56secs (only provides competition/min ranking for ties, not necessarily correct result) df[&quot;MEAN&quot;] = pd.rolling_mean(df['A'], window=rollWindow) #0.008secs def rollingRankOnSeries (array): s = pd.Series(array) return s.rank(method='min', ascending=False)[len(s)-1] def rollingRankSciPy (array): return array.size + 1 - sc.rankdata(array)[-1] def rollingRankBottleneck (array): return array.size + 1 - bd.rankdata(array)[-1] def rollingRankArgSort (array): return array.size - array.argsort().argsort()[-1] ```python I think this is likely to be a common request for users looking to use pandas for analysis on large datasets and thought it would be a useful addition to the pandas moving statistics/moments suite?"><pre class="notranslate"><span class="pl-s1">rollWindow</span> <span class="pl-c1">=</span> <span class="pl-c1">240</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-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">randn</span>(<span class="pl-c1">100000</span>,<span class="pl-c1">4</span>), <span class="pl-s1">columns</span><span class="pl-c1">=</span><span class="pl-en">list</span>(<span class="pl-s">'ABCD'</span>), <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-s1">pd</span>.<span class="pl-en">date_range</span>(<span class="pl-s">'1/1/2000'</span>, <span class="pl-s1">periods</span><span class="pl-c1">=</span><span class="pl-c1">100000</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'1H'</span>)) <span class="pl-s1">df</span>.<span class="pl-s1">iloc</span>[<span class="pl-c1">-</span><span class="pl-c1">3</span>:<span class="pl-c1">-</span><span class="pl-c1">1</span>][<span class="pl-s">'A'</span>] <span class="pl-c1">=</span> <span class="pl-c1">7.5</span> <span class="pl-s1">df</span>.<span class="pl-s1">iloc</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>][<span class="pl-s">'A'</span>] <span class="pl-c1">=</span> <span class="pl-c1">5.5</span> <span class="pl-s1">df</span>[<span class="pl-s">"SER_RK"</span>] <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">rolling_apply</span>(<span class="pl-s1">df</span>[<span class="pl-s">"A"</span>], <span class="pl-s1">rollWindow</span>, <span class="pl-s1">rollingRankOnSeries</span>) <span class="pl-c">#28.9secs (allows competition/min ranking for ties)</span> <span class="pl-s1">df</span>[<span class="pl-s">"SCIPY_RK"</span>] <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">rolling_apply</span>(<span class="pl-s1">df</span>[<span class="pl-s">"A"</span>], <span class="pl-s1">rollWindow</span>, <span class="pl-s1">rollingRankSciPy</span>) <span class="pl-c">#70.89secs (allows competition/min ranking for ties)</span> <span class="pl-s1">df</span>[<span class="pl-s">"BNECK_RK"</span>] <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">rolling_apply</span>(<span class="pl-s1">df</span>[<span class="pl-s">"A"</span>], <span class="pl-s1">rollWindow</span>, <span class="pl-s1">rollingRankBottleneck</span>) <span class="pl-c">#3.64secs (only provides average ranking for ties)</span> <span class="pl-s1">df</span>[<span class="pl-s">"ASRT_RK"</span>] <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">rolling_apply</span>(<span class="pl-s1">df</span>[<span class="pl-s">"A"</span>], <span class="pl-s1">rollWindow</span>, <span class="pl-s1">rollingRankArgSort</span>) <span class="pl-c">#3.56secs (only provides competition/min ranking for ties, not necessarily correct result)</span> <span class="pl-s1">df</span>[<span class="pl-s">"MEAN"</span>] <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">rolling_mean</span>(<span class="pl-s1">df</span>[<span class="pl-s">'A'</span>], <span class="pl-s1">window</span><span class="pl-c1">=</span><span class="pl-s1">rollWindow</span>) <span class="pl-c">#0.008secs</span> <span class="pl-k">def</span> <span class="pl-en">rollingRankOnSeries</span> (<span class="pl-s1">array</span>): <span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>(<span class="pl-s1">array</span>) <span class="pl-k">return</span> <span class="pl-s1">s</span>.<span class="pl-en">rank</span>(<span class="pl-s1">method</span><span class="pl-c1">=</span><span class="pl-s">'min'</span>, <span class="pl-s1">ascending</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)[<span class="pl-en">len</span>(<span class="pl-s1">s</span>)<span class="pl-c1">-</span><span class="pl-c1">1</span>] <span class="pl-k">def</span> <span class="pl-en">rollingRankSciPy</span> (<span class="pl-s1">array</span>): <span class="pl-k">return</span> <span class="pl-s1">array</span>.<span class="pl-s1">size</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span> <span class="pl-c1">-</span> <span class="pl-s1">sc</span>.<span class="pl-en">rankdata</span>(<span class="pl-s1">array</span>)[<span class="pl-c1">-</span><span class="pl-c1">1</span>] <span class="pl-k">def</span> <span class="pl-en">rollingRankBottleneck</span> (<span class="pl-s1">array</span>): <span class="pl-k">return</span> <span class="pl-s1">array</span>.<span class="pl-s1">size</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span> <span class="pl-c1">-</span> <span class="pl-s1">bd</span>.<span class="pl-en">rankdata</span>(<span class="pl-s1">array</span>)[<span class="pl-c1">-</span><span class="pl-c1">1</span>] <span class="pl-k">def</span> <span class="pl-en">rollingRankArgSort</span> (<span class="pl-s1">array</span>): <span class="pl-k">return</span> <span class="pl-s1">array</span>.<span class="pl-s1">size</span> <span class="pl-c1">-</span> <span class="pl-s1">array</span>.<span class="pl-en">argsort</span>().<span class="pl-en">argsort</span>()[<span class="pl-c1">-</span><span class="pl-c1">1</span>] <span class="pl-s">``</span>`<span class="pl-s1">python</span> <span class="pl-v">I</span> <span class="pl-s1">think</span> <span class="pl-s1">this</span> <span class="pl-c1">is</span> <span class="pl-s1">likely</span> <span class="pl-s1">to</span> <span class="pl-s1">be</span> <span class="pl-s1">a</span> <span class="pl-s1">common</span> <span class="pl-s1">request</span> <span class="pl-s1">for</span> <span class="pl-s1">users</span> <span class="pl-s1">looking</span> <span class="pl-s1">to</span> <span class="pl-s1">use</span> <span class="pl-s1">pandas</span> <span class="pl-s1">for</span> <span class="pl-s1">analysis</span> <span class="pl-s1">on</span> <span class="pl-s1">large</span> <span class="pl-s1">datasets</span> <span class="pl-c1">and</span> <span class="pl-s1">thought</span> <span class="pl-s1">it</span> <span class="pl-s1">would</span> <span class="pl-s1">be</span> <span class="pl-s1">a</span> <span class="pl-s1">useful</span> <span class="pl-s1">addition</span> <span class="pl-s1">to</span> <span class="pl-s1">the</span> <span class="pl-s1">pandas</span> <span class="pl-s1">moving</span> <span class="pl-s1">statistics</span><span class="pl-c1">/</span><span class="pl-s1">moments</span> <span class="pl-s1">suite</span>?</pre></div>
1
<p dir="auto">While testing the class_weight parameter in several estimators to investigate <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="8682377" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/1411" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/1411/hovercard" href="https://github.com/scikit-learn/scikit-learn/issues/1411">#1411</a>, I noticed that the parameter doesn't work as I would expect in RidgeClassifier either.<br> Maybe this is some misunderstanding on my part or some regularization issue, but if I have noisy labels, I would have expected to be be able to move the decision boundary.</p> <p dir="auto">This is not the case as illustrated in <a href="http://nbviewer.ipython.org/4369742/" rel="nofollow">this notebook</a></p> <p dir="auto">Any input would be appreciated.</p>
<p dir="auto">When using the <code class="notranslate">sklearn.decomposition.PCA</code> class with <code class="notranslate">n_components='mle'</code> when svd_solver='auto' the following line will attempt to evaluate <code class="notranslate">n_components</code> as a numeric type. An additional safety check is necessary.</p> <h1 dir="auto">Error</h1> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="--------------------------------------------------------------------------- TypeError Traceback (most recent call last) &lt;ipython-input-22-26ffe206b6e0&gt; in &lt;module&gt;() ----&gt; 1 model = PCA(n_components='mle').fit(X_tr) ~/.conda/envs/Science3/lib/python3.6/site-packages/sklearn/decomposition/pca.py in fit(self, X, y) 327 Returns the instance itself. 328 &quot;&quot;&quot; --&gt; 329 self._fit(X) 330 return self 331 ~/.conda/envs/Science3/lib/python3.6/site-packages/sklearn/decomposition/pca.py in _fit(self, X) 382 if max(X.shape) &lt;= 500: 383 svd_solver = 'full' --&gt; 384 elif n_components &gt;= 1 and n_components &lt; .8 * min(X.shape): 385 svd_solver = 'randomized' 386 # This is also the case of n_components in (0,1) TypeError: '&gt;=' not supported between instances of 'str' and 'int'"><pre class="notranslate"><code class="notranslate">--------------------------------------------------------------------------- TypeError Traceback (most recent call last) &lt;ipython-input-22-26ffe206b6e0&gt; in &lt;module&gt;() ----&gt; 1 model = PCA(n_components='mle').fit(X_tr) ~/.conda/envs/Science3/lib/python3.6/site-packages/sklearn/decomposition/pca.py in fit(self, X, y) 327 Returns the instance itself. 328 """ --&gt; 329 self._fit(X) 330 return self 331 ~/.conda/envs/Science3/lib/python3.6/site-packages/sklearn/decomposition/pca.py in _fit(self, X) 382 if max(X.shape) &lt;= 500: 383 svd_solver = 'full' --&gt; 384 elif n_components &gt;= 1 and n_components &lt; .8 * min(X.shape): 385 svd_solver = 'randomized' 386 # This is also the case of n_components in (0,1) TypeError: '&gt;=' not supported between instances of 'str' and 'int' </code></pre></div> <h1 dir="auto">Solution</h1> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# Handle svd_solver if n_components == 'mle': self.svd_solver = 'full' svd_solver = self.svd_solver if svd_solver == 'auto': # Small problem, just call full PCA if max(X.shape) &lt;= 500: svd_solver = 'full' elif n_components &gt;= 1 and n_components &lt; .8 * min(X.shape): svd_solver = 'randomized' # This is also the case of n_components in (0,1) else: svd_solver = 'full'"><pre class="notranslate"><code class="notranslate"># Handle svd_solver if n_components == 'mle': self.svd_solver = 'full' svd_solver = self.svd_solver if svd_solver == 'auto': # Small problem, just call full PCA if max(X.shape) &lt;= 500: svd_solver = 'full' elif n_components &gt;= 1 and n_components &lt; .8 * min(X.shape): svd_solver = 'randomized' # This is also the case of n_components in (0,1) else: svd_solver = 'full' </code></pre></div> <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/scikit-learn/scikit-learn/blob/a24c8b464d094d2c468a16ea9f8bf8d42d949f84/sklearn/decomposition/pca.py#L384">scikit-learn/sklearn/decomposition/pca.py</a> </p> <p class="mb-0 color-fg-muted"> Line 384 in <a data-pjax="true" class="commit-tease-sha" href="/scikit-learn/scikit-learn/commit/a24c8b464d094d2c468a16ea9f8bf8d42d949f84">a24c8b4</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="L384" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="384"></td> <td id="LC384" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">elif</span> <span class="pl-s1">n_components</span> <span class="pl-c1">&gt;=</span> <span class="pl-c1">1</span> <span class="pl-c1">and</span> <span class="pl-s1">n_components</span> <span class="pl-c1">&lt;</span> <span class="pl-c1">.8</span> <span class="pl-c1">*</span> <span class="pl-en">min</span>(<span class="pl-v">X</span>.<span class="pl-s1">shape</span>): </td> </tr> </tbody></table> </div> </div> <p></p>
0
<p dir="auto">I get this crash in the release version of the app and I can't find the cause since the stack trace apparently doesn't help this much</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="E/flutter ( 7686): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception: E/flutter ( 7686): TFA Error: #lib5::WebApiClient::loginWithEmailAndPassword E/flutter ( 7686): #0 WebApiClient.loginWithEmailAndPassword (package:redux/data/web_api_client.dart:0) E/flutter ( 7686): #1 AppRepository.loginWith (package:redux/data/app_repository.dart:52) E/flutter ( 7686): &lt;asynchronous suspension&gt; E/flutter ( 7686): #2 LoginMiddleware.handle (package:redux/middleware/login.dart:27) E/flutter ( 7686): &lt;asynchronous suspension&gt; E/flutter ( 7686): #3 MiddlewareBuilder.add.&lt;anonymous closure&gt; (package:built_redux/src/middleware.dart:37) E/flutter ( 7686): #4 MiddlewareBuilder.build.&lt;anonymous closure&gt;.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:built_redux/src/middleware.dart:53) E/flutter ( 7686): #5 ActionDispatcher.call (package:built_redux/src/action.dart:32) E/flutter ( 7686): #6 new AuthViewModel.initialized.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:redux/containers/auth_connector.dart:29) E/flutter ( 7686): #7 LoginButton.build.&lt;anonymous closure&gt;.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:redux/presentation/login/login_button.dart:45) E/flutter ( 7686): #8 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:478) E/flutter ( 7686): #9 _InkResponseState.build.&lt;anonymous closure&gt; (package:flutter/src/material/ink_well.dart:530) E/flutter ( 7686): #10 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102) E/flutter ( 7686): #11 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:161) E/flutter ( 7686): #12 TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:123) E/flutter ( 7686): #13 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156) E/flutter ( 7686): #14 _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:147) E/flutter ( 7686): #15 _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:121) E/flutter ( 7686): #16 _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:101) E/flutter ( 7686): #17 _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:64) E/flutter ( 7686): #18 _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:48) E/flutter ( 7686): #19 _invoke1 (dart:ui/hooks.dart:134) E/flutter ( 7686): #20 _dispatchPointerDataPacket (dart:ui/hooks.dart:91)"><pre class="notranslate"><code class="notranslate">E/flutter ( 7686): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception: E/flutter ( 7686): TFA Error: #lib5::WebApiClient::loginWithEmailAndPassword E/flutter ( 7686): #0 WebApiClient.loginWithEmailAndPassword (package:redux/data/web_api_client.dart:0) E/flutter ( 7686): #1 AppRepository.loginWith (package:redux/data/app_repository.dart:52) E/flutter ( 7686): &lt;asynchronous suspension&gt; E/flutter ( 7686): #2 LoginMiddleware.handle (package:redux/middleware/login.dart:27) E/flutter ( 7686): &lt;asynchronous suspension&gt; E/flutter ( 7686): #3 MiddlewareBuilder.add.&lt;anonymous closure&gt; (package:built_redux/src/middleware.dart:37) E/flutter ( 7686): #4 MiddlewareBuilder.build.&lt;anonymous closure&gt;.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:built_redux/src/middleware.dart:53) E/flutter ( 7686): #5 ActionDispatcher.call (package:built_redux/src/action.dart:32) E/flutter ( 7686): #6 new AuthViewModel.initialized.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:redux/containers/auth_connector.dart:29) E/flutter ( 7686): #7 LoginButton.build.&lt;anonymous closure&gt;.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:redux/presentation/login/login_button.dart:45) E/flutter ( 7686): #8 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:478) E/flutter ( 7686): #9 _InkResponseState.build.&lt;anonymous closure&gt; (package:flutter/src/material/ink_well.dart:530) E/flutter ( 7686): #10 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102) E/flutter ( 7686): #11 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:161) E/flutter ( 7686): #12 TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:123) E/flutter ( 7686): #13 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156) E/flutter ( 7686): #14 _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:147) E/flutter ( 7686): #15 _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:121) E/flutter ( 7686): #16 _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:101) E/flutter ( 7686): #17 _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:64) E/flutter ( 7686): #18 _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:48) E/flutter ( 7686): #19 _invoke1 (dart:ui/hooks.dart:134) E/flutter ( 7686): #20 _dispatchPointerDataPacket (dart:ui/hooks.dart:91) </code></pre></div>
<h2 dir="auto">Steps to Reproduce</h2> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(dart2) $ flutter run --release Initializing gradle... 0.8s Resolving dependencies... 1.5s Launching lib/main.dart on Pixel XL in release mode... Running 'gradlew assembleRelease'... Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) compiler message: file:///Users/zoechi/dart/customers/lookatyou/lookatmybaby/timeago.dart/lib/src/i18/messages_all.dart:20:24: Error: The top level function has type '() → dynamic' that isn't of expected type '() → dart.async::Fute&lt;dynamic&gt;'. compiler message: Change the type of the function or the context in which it is used. compiler message: 'en_short': en_short.loadLibrary, compiler message: ^ compiler message: file:///Users/zoechi/dart/customers/lookatyou/lookatmybaby/timeago.dart/lib/src/i18/messages_all.dart:21:12: Error: The top level function has type '() → dynamic' that isn't of expected type '() → dart.async::Fute&lt;dynamic&gt;'. compiler message: Change the type of the function or the context in which it is used. compiler message: 'es': es.loadLibrary, compiler message: ^ compiler message: file:///Users/zoechi/dart/customers/lookatyou/lookatmybaby/timeago.dart/lib/src/i18/messages_all.dart:22:24: Error: The top level function has type '() → dynamic' that isn't of expected type '() → dart.async::Fute&lt;dynamic&gt;'. compiler message: Change the type of the function or the context in which it is used. compiler message: 'es_short': es_short.loadLibrary, compiler message: ^ compiler message: file:///Users/zoechi/dart/customers/lookatyou/lookatmybaby/timeago.dart/lib/src/i18/messages_all.dart:23:12: Error: The top level function has type '() → dynamic' that isn't of expected type '() → dart.async::Fute&lt;dynamic&gt;'. compiler message: Change the type of the function or the context in which it is used. compiler message: 'fr': fr.loadLibrary, compiler message: ^ compiler message: file:///Users/zoechi/dart/customers/lookatyou/lookatmybaby/timeago.dart/lib/src/i18/messages_all.dart:24:12: Error: The top level function has type '() → dynamic' that isn't of expected type '() → dart.async::Fute&lt;dynamic&gt;'. compiler message: Change the type of the function or the context in which it is used. compiler message: 'ja': ja.loadLibrary, compiler message: ^ compiler message: file:///Users/zoechi/dart/customers/lookatyou/lookatmybaby/timeago.dart/lib/src/i18/messages_all.dart:25:18: Error: The top level function has type '() → dynamic' that isn't of expected type '() → dart.async::Fute&lt;dynamic&gt;'. compiler message: Change the type of the function or the context in which it is used. compiler message: 'zh_CN': zh_cn.loadLibrary, compiler message: ^ compiler message: file:///Users/zoechi/dart/customers/lookatyou/lookatmybaby/timeago.dart/lib/src/i18/messages_all.dart:26:12: Error: The top level function has type '() → dynamic' that isn't of expected type '() → dart.async::Fute&lt;dynamic&gt;'. compiler message: Change the type of the function or the context in which it is used. compiler message: 'zh': zh.loadLibrary compiler message: ^ Built build/app/outputs/apk/release/app-release.apk (14.5MB). Installing build/app/outputs/apk/app.apk... 10.9s To repeat this help message, press &quot;h&quot;. To quit, press &quot;q&quot;. I/FlutterActivityDelegate(17171): onResume setting current activity to this"><pre class="notranslate"><code class="notranslate">(dart2) $ flutter run --release Initializing gradle... 0.8s Resolving dependencies... 1.5s Launching lib/main.dart on Pixel XL in release mode... Running 'gradlew assembleRelease'... Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection) compiler message: file:///Users/zoechi/dart/customers/lookatyou/lookatmybaby/timeago.dart/lib/src/i18/messages_all.dart:20:24: Error: The top level function has type '() → dynamic' that isn't of expected type '() → dart.async::Fute&lt;dynamic&gt;'. compiler message: Change the type of the function or the context in which it is used. compiler message: 'en_short': en_short.loadLibrary, compiler message: ^ compiler message: file:///Users/zoechi/dart/customers/lookatyou/lookatmybaby/timeago.dart/lib/src/i18/messages_all.dart:21:12: Error: The top level function has type '() → dynamic' that isn't of expected type '() → dart.async::Fute&lt;dynamic&gt;'. compiler message: Change the type of the function or the context in which it is used. compiler message: 'es': es.loadLibrary, compiler message: ^ compiler message: file:///Users/zoechi/dart/customers/lookatyou/lookatmybaby/timeago.dart/lib/src/i18/messages_all.dart:22:24: Error: The top level function has type '() → dynamic' that isn't of expected type '() → dart.async::Fute&lt;dynamic&gt;'. compiler message: Change the type of the function or the context in which it is used. compiler message: 'es_short': es_short.loadLibrary, compiler message: ^ compiler message: file:///Users/zoechi/dart/customers/lookatyou/lookatmybaby/timeago.dart/lib/src/i18/messages_all.dart:23:12: Error: The top level function has type '() → dynamic' that isn't of expected type '() → dart.async::Fute&lt;dynamic&gt;'. compiler message: Change the type of the function or the context in which it is used. compiler message: 'fr': fr.loadLibrary, compiler message: ^ compiler message: file:///Users/zoechi/dart/customers/lookatyou/lookatmybaby/timeago.dart/lib/src/i18/messages_all.dart:24:12: Error: The top level function has type '() → dynamic' that isn't of expected type '() → dart.async::Fute&lt;dynamic&gt;'. compiler message: Change the type of the function or the context in which it is used. compiler message: 'ja': ja.loadLibrary, compiler message: ^ compiler message: file:///Users/zoechi/dart/customers/lookatyou/lookatmybaby/timeago.dart/lib/src/i18/messages_all.dart:25:18: Error: The top level function has type '() → dynamic' that isn't of expected type '() → dart.async::Fute&lt;dynamic&gt;'. compiler message: Change the type of the function or the context in which it is used. compiler message: 'zh_CN': zh_cn.loadLibrary, compiler message: ^ compiler message: file:///Users/zoechi/dart/customers/lookatyou/lookatmybaby/timeago.dart/lib/src/i18/messages_all.dart:26:12: Error: The top level function has type '() → dynamic' that isn't of expected type '() → dart.async::Fute&lt;dynamic&gt;'. compiler message: Change the type of the function or the context in which it is used. compiler message: 'zh': zh.loadLibrary compiler message: ^ Built build/app/outputs/apk/release/app-release.apk (14.5MB). Installing build/app/outputs/apk/app.apk... 10.9s To repeat this help message, press "h". To quit, press "q". I/FlutterActivityDelegate(17171): onResume setting current activity to this </code></pre></div> <p dir="auto">The intl errors are reported in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="306811625" data-permission-text="Title is private" data-url="https://github.com/dart-lang/sdk/issues/32604" data-hovercard-type="issue" data-hovercard-url="/dart-lang/sdk/issues/32604/hovercard" href="https://github.com/dart-lang/sdk/issues/32604">dart-lang/sdk#32604</a>, but they don't cause issues in debug mode</p> <h2 dir="auto">Logs</h2> <p dir="auto">Run your application with <code class="notranslate">flutter run</code> and attach all the log output.</p> <p dir="auto">Run <code class="notranslate">flutter analyze</code> and attach any output of that command also.</p> <h2 dir="auto">Flutter Doctor</h2> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(dart2) $ flutter doctor -v [✓] Flutter (Channel dev, v0.2.2-pre.7, on Mac OS X 10.13.3 17D102, locale en-AT) • Flutter version 0.2.2-pre.7 at /Users/zoechi/flutter/flutter • Framework revision c0d1eb7513 (2 hours ago), 2018-04-03 12:52:53 +0200 • Engine revision c903c217a1 • Dart version 2.0.0-dev.43.0.flutter-52afcba357 [✓] Android toolchain - develop for Android devices (Android SDK 27.0.3) • Android SDK at /usr/local/opt/android-sdk • Android NDK at /usr/local/opt/android-sdk/ndk-bundle • Platform android-27, build-tools 27.0.3 • ANDROID_HOME = /usr/local/opt/android-sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01) • All Android licenses accepted. [✓] iOS toolchain - develop for iOS devices (Xcode 9.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 9.3, Build version 9E145 • ios-deploy 1.9.2 • CocoaPods version 1.4.0 [✓] Android Studio (version 3.1) • Android Studio at /Applications/Android Studio.app/Contents • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01) [✓] IntelliJ IDEA Ultimate Edition (version 2017.3.4) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin version 22.2.2 • Dart plugin version 173.4548.30 [✓] Connected devices (1 available) • Pixel XL • HT69V0203649 • android-arm64 • Android 8.1.0 (API 27) • No issues found!"><pre class="notranslate"><code class="notranslate">(dart2) $ flutter doctor -v [✓] Flutter (Channel dev, v0.2.2-pre.7, on Mac OS X 10.13.3 17D102, locale en-AT) • Flutter version 0.2.2-pre.7 at /Users/zoechi/flutter/flutter • Framework revision c0d1eb7513 (2 hours ago), 2018-04-03 12:52:53 +0200 • Engine revision c903c217a1 • Dart version 2.0.0-dev.43.0.flutter-52afcba357 [✓] Android toolchain - develop for Android devices (Android SDK 27.0.3) • Android SDK at /usr/local/opt/android-sdk • Android NDK at /usr/local/opt/android-sdk/ndk-bundle • Platform android-27, build-tools 27.0.3 • ANDROID_HOME = /usr/local/opt/android-sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01) • All Android licenses accepted. [✓] iOS toolchain - develop for iOS devices (Xcode 9.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 9.3, Build version 9E145 • ios-deploy 1.9.2 • CocoaPods version 1.4.0 [✓] Android Studio (version 3.1) • Android Studio at /Applications/Android Studio.app/Contents • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01) [✓] IntelliJ IDEA Ultimate Edition (version 2017.3.4) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin version 22.2.2 • Dart plugin version 173.4548.30 [✓] Connected devices (1 available) • Pixel XL • HT69V0203649 • android-arm64 • Android 8.1.0 (API 27) • No issues found! </code></pre></div> <blockquote> <p dir="auto">For more information about diagnosing and reporting Flutter bugs, please see <a href="https://flutter.io/bug-reports/" rel="nofollow">https://flutter.io/bug-reports/</a>.</p> </blockquote>
1
<h3 dir="auto">Version</h3> <p dir="auto">2.4.2</p> <h3 dir="auto">Reproduction link</h3> <p dir="auto"><a href="https://jsfiddle.net/1madr5ze/" rel="nofollow">https://jsfiddle.net/1madr5ze/</a><br> Although putting it into <code class="notranslate">data</code> works: <a href="https://jsfiddle.net/t1t4teeo/" rel="nofollow">https://jsfiddle.net/t1t4teeo/</a></p> <h3 dir="auto">Steps to reproduce</h3> <p dir="auto">Declare a prop for the root application instance.<br> Pass the prop to the <code class="notranslate">&lt;div&gt;</code> that represents the root of the app.</p> <h3 dir="auto">What is expected?</h3> <p dir="auto">The root app should have the props data.</p> <h3 dir="auto">What is actually happening?</h3> <p dir="auto">The props data isn't showing up.</p>
<h3 dir="auto">Version</h3> <p dir="auto">2.5.17</p> <h3 dir="auto">Reproduction link</h3> <p dir="auto"><a href="https://jsfiddle.net/eywraw8t/319255/" rel="nofollow">https://jsfiddle.net/eywraw8t/319255/</a></p> <h3 dir="auto">Steps to reproduce</h3> <ol dir="auto"> <li>generate an input field with a dynamic type</li> <li>open project in IE10</li> <li>open console</li> </ol> <h3 dir="auto">What is expected?</h3> <p dir="auto">Working radio / checkboxes</p> <h3 dir="auto">What is actually happening?</h3> <p dir="auto">JS error in IE10<br> SCRIPT1046: Multiple definitions of a property not allowed in strict mode</p> <p dir="auto">domProps:{value:e.value,value:t.model}</p>
0
<p dir="auto">To help us understand and resolve your issue please check that you have provided<br> the information below.</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Matplotlib version, Python version and Platform (Windows, OSX, Linux ...)<br> osx, linux. Matloplib version 1.5.3. Python version 3.5.2</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> How did you install Matplotlib and Python (pip, anaconda, from source ...)<br> anaconda (osx/linux), macports (osx)</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> If possible please supply a <a href="http://sscce.org/" rel="nofollow">Short, Self Contained, Correct, Example</a><br> that demonstrates the issue i.e a small piece of code which reproduces the issue<br> and can be run with out any other (or as few as possible) external dependencies.<br> Enclosed</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> If this is an image generation bug attach a screenshot demonstrating the issue.<br> Attached</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> If this is a regression (Used to work in an earlier version of Matplotlib), please<br> note where it used to work.<br> N/A</li> </ul> <p dir="auto">==<br> When plotting numpy's maskedarray with plot(), I could not see some data points.<br> A simple code follows. If I savefig() to png file, it works. If I savefig() to pdf (or eps) file, it does not.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt import numpy as np arr = np.array([1, 5, -3, -3, 5, -3, -3, 2, -3, -3, 7, -3, -3, 2]) arrm = np.ma.masked_less(arr, 0) plt.figure() plt.plot(arrm, 'o') plt.savefig('a.png') plt.savefig('a.pdf')"><pre class="notranslate"><code class="notranslate">import matplotlib.pyplot as plt import numpy as np arr = np.array([1, 5, -3, -3, 5, -3, -3, 2, -3, -3, 7, -3, -3, 2]) arrm = np.ma.masked_less(arr, 0) plt.figure() plt.plot(arrm, 'o') plt.savefig('a.png') plt.savefig('a.pdf') </code></pre></div> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6485215/20787595/ff72490c-b7ac-11e6-8f05-0965d0591648.png"><img src="https://cloud.githubusercontent.com/assets/6485215/20787595/ff72490c-b7ac-11e6-8f05-0965d0591648.png" alt="a" style="max-width: 100%;"></a><br> <a href="https://github.com/matplotlib/matplotlib/files/624078/a.pdf">a.pdf</a></p>
<p dir="auto">Dear developers,<br> when plotting single points surrounded by np.nan values, points are shown in a regular plot, but are omitted when saved via pdf backend. Minimal example:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np import matplotlib.pyplot as plt a = np.array([1,np.nan,2,np.nan,3,3.5,4]) plt.plot(a, marker='o') plt.show()"><pre class="notranslate"><code class="notranslate">import numpy as np import matplotlib.pyplot as plt a = np.array([1,np.nan,2,np.nan,3,3.5,4]) plt.plot(a, marker='o') plt.show() </code></pre></div> <p dir="auto">generates a perfect plot with the 5 points shown:</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/17202381/19445433/881a8df0-9494-11e6-853f-893cd63f80f7.png"><img src="https://cloud.githubusercontent.com/assets/17202381/19445433/881a8df0-9494-11e6-853f-893cd63f80f7.png" alt="foo1" style="max-width: 100%;"></a></p> <p dir="auto">but directly saving it via pdf backend omitts the values isolated by np.nans:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np import matplotlib.pyplot as plt import matplotlib.backends.backend_pdf as pdf a = np.array([1,np.nan,2,np.nan,3,3.5,4]) fig1 = plt.figure() sub = fig1.add_subplot(1,1,1) sub.plot(a,marker='o') pp1 = pdf.PdfPages('foo.pdf') fig1.savefig(pp1, format='pdf') pp1.close()"><pre class="notranslate"><code class="notranslate">import numpy as np import matplotlib.pyplot as plt import matplotlib.backends.backend_pdf as pdf a = np.array([1,np.nan,2,np.nan,3,3.5,4]) fig1 = plt.figure() sub = fig1.add_subplot(1,1,1) sub.plot(a,marker='o') pp1 = pdf.PdfPages('foo.pdf') fig1.savefig(pp1, format='pdf') pp1.close() </code></pre></div> <p dir="auto">like so:</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/17202381/19445554/0130e8d8-9495-11e6-9a31-a6b70719b87d.png"><img src="https://cloud.githubusercontent.com/assets/17202381/19445554/0130e8d8-9495-11e6-9a31-a6b70719b87d.png" alt="foo2" style="max-width: 100%;"></a></p> <p dir="auto">I would be glad for any help.</p> <p dir="auto">System:<br> Ubuntu 14.02<br> Python 2.7.6<br> Numpy 1.11.2<br> Matplotlib 1.5.3</p>
1
<p dir="auto">From 2020.20.04 9pm msi</p> <p dir="auto">Description: A .NET Core application failed.<br> Application: PowerLauncher.exe<br> Path: C:\Program Files\PowerToys\modules\launcher\PowerLauncher.exe<br> Message: Error:<br> An assembly specified in the application dependencies manifest (PowerLauncher.deps.json) was not found:<br> package: 'PropertyChanged.Fody', version: '3.2.7'<br> path: 'lib/netstandard1.0/PropertyChanged.dll'</p>
<p dir="auto">From 2020.20.04 9pm msi</p> <p dir="auto">Description: A .NET Core application failed.<br> Application: PowerLauncher.exe<br> Path: C:\Program Files\PowerToys\modules\launcher\PowerLauncher.exe<br> Message: Error:<br> An assembly specified in the application dependencies manifest (PowerLauncher.deps.json) was not found:<br> package: 'PropertyChanged.Fody', version: '3.2.7'<br> path: 'lib/netstandard1.0/PropertyChanged.dll'</p>
1
<h4 dir="auto">Code Sample</h4> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="df = Dataframe(numpy.zeros(10000,10000)) random_fill_df(df, num_elements=20) df = df.to_sparse(fill_value=0) timeit.timeit('df.loc[[23, 45, 65, 67],:]', globals=globals(), number=10)"><pre class="notranslate"><span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-v">Dataframe</span>(<span class="pl-s1">numpy</span>.<span class="pl-en">zeros</span>(<span class="pl-c1">10000</span>,<span class="pl-c1">10000</span>)) <span class="pl-en">random_fill_df</span>(<span class="pl-s1">df</span>, <span class="pl-s1">num_elements</span><span class="pl-c1">=</span><span class="pl-c1">20</span>) <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-en">to_sparse</span>(<span class="pl-s1">fill_value</span><span class="pl-c1">=</span><span class="pl-c1">0</span>) <span class="pl-s1">timeit</span>.<span class="pl-en">timeit</span>(<span class="pl-s">'df.loc[[23, 45, 65, 67],:]'</span>, <span class="pl-s1">globals</span><span class="pl-c1">=</span><span class="pl-en">globals</span>(), <span class="pl-s1">number</span><span class="pl-c1">=</span><span class="pl-c1">10</span>)</pre></div> <h4 dir="auto">Problem description</h4> <p dir="auto">The reason why row slicing takes so long is because a sparse dataframe a bunch of sparse series. Column slicing is several order of magnitude faster but row slicing is very poor. The sparse dataframe doesn't take advantage of the scipy sparse matrix library which is even faster (both column and row).</p> <h4 dir="auto">Expected Output</h4> <p dir="auto">In case data is stored as a scipy sparse matrix (as well) inside dataframe object, the slicing operations can be improved, by several orders of magnitude.</p> <p dir="auto">I propose that data be stored as a sparse matrix as well in the dataframe object.</p> <h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4> <details> <p dir="auto">pandas: 0.20.3<br> pytest: None<br> pip: 9.0.1<br> setuptools: 36.2.0<br> Cython: None<br> numpy: 1.13.1<br> scipy: 0.19.1<br> xarray: None<br> IPython: None<br> sphinx: None<br> patsy: None<br> dateutil: 2.6.1<br> pytz: 2017.2<br> blosc: None<br> bottleneck: 1.2.1<br> tables: None<br> numexpr: 2.6.2<br> feather: None<br> matplotlib: 2.0.2<br> openpyxl: None<br> xlrd: None<br> xlwt: None<br> xlsxwriter: None<br> lxml: None<br> bs4: 4.6.0<br> html5lib: 0.999999999<br> sqlalchemy: None<br> pymysql: None<br> psycopg2: None<br> jinja2: None<br> s3fs: None<br> pandas_gbq: None<br> pandas_datareader: None</p> </details>
<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]: df = pd.DataFrame([[1, 0, 0],[0,0,0]]) # non sparse In [19]: %time df.loc[0] CPU times: user 367 µs, sys: 14 µs, total: 381 µs Wall time: 374 µs Out[19]: 0 1 1 0 2 0 Name: 0, dtype: int64 In [20]: %time df.loc[[0]] CPU times: user 808 µs, sys: 57 µs, total: 865 µs Wall time: 827 µs Out[20]: 0 1 2 0 1 0 0 In [3]: df = df.to_sparse() # sparse In [5]: %time df.loc[0] CPU times: user 429 µs, sys: 14 µs, total: 443 µs Wall time: 436 µs Out[5]: 0 1.0 1 0.0 2 0.0 Name: 0, dtype: float64 BlockIndex Block locations: array([0], dtype=int32) Block lengths: array([3], dtype=int32) In [6]: %time df.loc[[0]] CPU times: user 4.07 ms, sys: 406 µs, total: 4.48 ms Wall time: 6.16 ms Out[6]: 0 1 2 0 1.0 0.0 0.0 "><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">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>([[<span class="pl-c1">1</span>, <span class="pl-c1">0</span>, <span class="pl-c1">0</span>],[<span class="pl-c1">0</span>,<span class="pl-c1">0</span>,<span class="pl-c1">0</span>]]) <span class="pl-c"># non sparse</span> <span class="pl-v">In</span> [<span class="pl-c1">19</span>]: <span class="pl-c1">%</span><span class="pl-s1">time</span> <span class="pl-s1">df</span>.<span class="pl-s1">loc</span>[<span class="pl-c1">0</span>] <span class="pl-v">CPU</span> <span class="pl-s1">times</span>: <span class="pl-s1">user</span> <span class="pl-c1">367</span> <span class="pl-s1">µs</span>, <span class="pl-s1">sys</span>: <span class="pl-c1">14</span> <span class="pl-s1">µs</span>, <span class="pl-s1">total</span>: <span class="pl-c1">381</span> <span class="pl-s1">µs</span> <span class="pl-v">Wall</span> <span class="pl-s1">time</span>: <span class="pl-c1">374</span> <span class="pl-s1">µs</span> <span class="pl-v">Out</span>[<span class="pl-c1">19</span>]: <span class="pl-c1">0</span> <span class="pl-c1">1</span> <span class="pl-c1">1</span> <span class="pl-c1">0</span> <span class="pl-c1">2</span> <span class="pl-c1">0</span> <span class="pl-v">Name</span>: <span class="pl-c1">0</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span> <span class="pl-v">In</span> [<span class="pl-c1">20</span>]: <span class="pl-c1">%</span><span class="pl-s1">time</span> <span class="pl-s1">df</span>.<span class="pl-s1">loc</span>[[<span class="pl-c1">0</span>]] <span class="pl-v">CPU</span> <span class="pl-s1">times</span>: <span class="pl-s1">user</span> <span class="pl-c1">808</span> <span class="pl-s1">µs</span>, <span class="pl-s1">sys</span>: <span class="pl-c1">57</span> <span class="pl-s1">µs</span>, <span class="pl-s1">total</span>: <span class="pl-c1">865</span> <span class="pl-s1">µs</span> <span class="pl-v">Wall</span> <span class="pl-s1">time</span>: <span class="pl-c1">827</span> <span class="pl-s1">µs</span> <span class="pl-v">Out</span>[<span class="pl-c1">20</span>]: <span class="pl-c1">0</span> <span class="pl-c1">1</span> <span class="pl-c1">2</span> <span class="pl-c1">0</span> <span class="pl-c1">1</span> <span class="pl-c1">0</span> <span class="pl-c1">0</span> <span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-en">to_sparse</span>() <span class="pl-c"># sparse</span> <span class="pl-v">In</span> [<span class="pl-c1">5</span>]: <span class="pl-c1">%</span><span class="pl-s1">time</span> <span class="pl-s1">df</span>.<span class="pl-s1">loc</span>[<span class="pl-c1">0</span>] <span class="pl-v">CPU</span> <span class="pl-s1">times</span>: <span class="pl-s1">user</span> <span class="pl-c1">429</span> <span class="pl-s1">µs</span>, <span class="pl-s1">sys</span>: <span class="pl-c1">14</span> <span class="pl-s1">µs</span>, <span class="pl-s1">total</span>: <span class="pl-c1">443</span> <span class="pl-s1">µs</span> <span class="pl-v">Wall</span> <span class="pl-s1">time</span>: <span class="pl-c1">436</span> <span class="pl-s1">µs</span> <span class="pl-v">Out</span>[<span class="pl-c1">5</span>]: <span class="pl-c1">0</span> <span class="pl-c1">1.0</span> <span class="pl-c1">1</span> <span class="pl-c1">0.0</span> <span class="pl-c1">2</span> <span class="pl-c1">0.0</span> <span class="pl-v">Name</span>: <span class="pl-c1">0</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">float64</span> <span class="pl-v">BlockIndex</span> <span class="pl-v">Block</span> <span class="pl-s1">locations</span>: <span class="pl-en">array</span>([<span class="pl-c1">0</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">int32</span>) <span class="pl-v">Block</span> <span class="pl-s1">lengths</span>: <span class="pl-en">array</span>([<span class="pl-c1">3</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">int32</span>) <span class="pl-v">In</span> [<span class="pl-c1">6</span>]: <span class="pl-c1">%</span><span class="pl-s1">time</span> <span class="pl-s1">df</span>.<span class="pl-s1">loc</span>[[<span class="pl-c1">0</span>]] <span class="pl-v">CPU</span> <span class="pl-s1">times</span>: <span class="pl-s1">user</span> <span class="pl-c1">4.07</span> <span class="pl-s1">ms</span>, <span class="pl-s1">sys</span>: <span class="pl-c1">406</span> <span class="pl-s1">µs</span>, <span class="pl-s1">total</span>: <span class="pl-c1">4.48</span> <span class="pl-s1">ms</span> <span class="pl-v">Wall</span> <span class="pl-s1">time</span>: <span class="pl-c1">6.16</span> <span class="pl-s1">ms</span> <span class="pl-v">Out</span>[<span class="pl-c1">6</span>]: <span class="pl-c1">0</span> <span class="pl-c1">1</span> <span class="pl-c1">2</span> <span class="pl-c1">0</span> <span class="pl-c1">1.0</span> <span class="pl-c1">0.0</span> <span class="pl-c1">0.0</span></pre></div> <p dir="auto">It seems in SparseDataFrame, selecting as dataframe, the time increased much more than it does in DataFrame, I would expect it runs faster(on my 1m x 500 SparseDataFrame it takes seconds for the loc operation)</p> <details> ## INSTALLED VERSIONS <p dir="auto">commit: None<br> python: 3.5.1.final.0<br> python-bits: 64<br> OS: Darwin<br> OS-release: 15.6.0<br> machine: x86_64<br> processor: i386<br> byteorder: little<br> LC_ALL: en_GB.UTF-8<br> LANG: en_GB.UTF-8</p> <p dir="auto">pandas: 0.18.1<br> nose: None<br> pip: 8.1.2<br> setuptools: 24.0.2<br> Cython: None<br> numpy: 1.11.0<br> scipy: 0.17.1<br> statsmodels: None<br> xarray: None<br> IPython: 5.0.0<br> sphinx: None<br> patsy: None<br> dateutil: 2.5.3<br> pytz: 2016.4<br> blosc: None<br> bottleneck: None<br> tables: None<br> numexpr: 2.6.1<br> matplotlib: 1.5.1<br> openpyxl: None<br> xlrd: None<br> xlwt: None<br> xlsxwriter: None<br> lxml: None<br> bs4: None<br> html5lib: None<br> httplib2: None<br> apiclient: None<br> sqlalchemy: 1.0.13<br> pymysql: None<br> psycopg2: 2.6.1 (dt dec pq3 ext lo64)<br> jinja2: None<br> boto: None<br> pandas_datareader: None</p> </details>
1