question_id int64 37.6M 73.2M | input_text stringlengths 88 52.4k | output_text stringlengths 37 35.6k | title stringlengths 15 150 | tags stringlengths 1 107 | q_score int64 -19 397 | view_count int64 3 879k | answer_count int64 1 21 | accepted_answer_id int64 37.6M 73.8M | answer_id int64 37.6M 73.8M | a_score int64 -5 1.29k | is_accepted bool 1
class | creation_date stringlengths 20 24 | input_text_instruct stringlengths 251 52.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
44,088,460 | Interval datatype in Pandas - find midpoint, left, center etc<p>In pandas 20.1, with the interval type, is it possible to find the midpoint, left or center values in a series.</p>
<p><strong>For example:</strong></p>
<ol>
<li><p>Create an interval datatype column, and perform some aggregation calculations over these ... | <p>So <code>pd.cut()</code> actually creates a <code>CategoricalIndex</code>, with an <code>IntervalIndex</code> as the categories.</p>
<pre><code>In [13]: df = pd.DataFrame({'month': [1, 1, 2, 2], 'distances': range(4), 'value': range(4)})
In [14]: df
Out[14]:
distances month value
0 0 1 0
1... | Interval datatype in Pandas - find midpoint, left, center etc | python|pandas|intervals | 17 | 18,433 | 2 | 44,088,970 | 44,088,970 | 16 | true | 2017-05-20T16:44:28.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Interval datatype in Pandas - find midpoint, left, center etc<p>In pandas 20.1, with the interval type, is it possible to find the midpoint, left or center v... |
44,107,544 | 'respond_to?' versus 'defined?'<p>If I want to check whether a method with a given name is defined, which is better to use, <code>respond_to?</code>, or <code>defined?</code>?</p>
<p>From the point of view of efficiency, there can be an argument for using <code>defined?</code> because <code>defined?</code> is a built ... | <blockquote>
<p>If I want to check whether a method with a given name is defined, which is better to use, <code>respond_to?</code>, or <code>defined?</code>?</p>
</blockquote>
<p>Neither. Use <a href="http://ruby-doc.org/core/Module.html#method-i-method_defined-3F" rel="noreferrer"><code>Module#method_defined?</code... | 'respond_to?' versus 'defined?' | ruby|methods|metaprogramming | 9 | 2,372 | 2 | 44,109,008 | 44,109,008 | 16 | true | 2017-05-22T07:55:57.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
'respond_to?' versus 'defined?'<p>If I want to check whether a method with a given name is defined, which is better to use, <code>respond_to?</code>, or <cod... |
44,158,954 | EMR Spark - TransportClient: Failed to send RPC<p>I'm getting this error, I tried to increase memory on cluster instances and in the executor and driver parameters without success.</p>
<pre><code>17/05/07 23:17:07 ERROR TransportClient: Failed to send RPC 6465703946954088562 to ip-172-30-12-164.eu-central-1.compute.in... | <p>Finally I resolved the problem. It was due to insufficient disk space. One column of hadoop logs showed:</p>
<p>Hadoop YARN: 1/1 local-dirs are bad: /var/lib/hadoop-yarn/cache/yarn/nm-local-dir; 1/1 log-dirs are bad: /var/log/hadoop-yarn/containers</p>
<p>Googling it I found <a href="http://gethue.com/hadoop-yarn-... | EMR Spark - TransportClient: Failed to send RPC | apache-spark|hadoop-yarn|emr | 17 | 22,853 | 2 | 44,159,281 | 44,159,281 | 16 | true | 2017-05-24T12:51:41.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
EMR Spark - TransportClient: Failed to send RPC<p>I'm getting this error, I tried to increase memory on cluster instances and in the executor and driver para... |
43,951,564 | AND operator in @Profile annotation<p>I have this configuration class in my Spring Boot appl. v1.5.3.RELEASE</p>
<pre><code>@Configuration
@Profile("dev && cub")
@PropertySource("file:///${user.home}/.cub/application-dev.properties")
public class CubDevelopmentConfig {
..
}
</code></pre>
<p>and this property ... | <p>Use the array form of the <code>value()</code> method of the annotation to specify multiple values.<br>
That is :
<code>@Profile({"dev", "cub"})</code> </p>
<p>Nevertheless, this configuration don't mean that both "dev" and "cub" profiles are required.<br>
The presence of at least one of them validates the conditi... | AND operator in @Profile annotation | java|spring|spring-mvc|spring-boot | 8 | 5,961 | 1 | 43,951,678 | 43,951,678 | 17 | true | 2017-05-13T09:38:00.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AND operator in @Profile annotation<p>I have this configuration class in my Spring Boot appl. v1.5.3.RELEASE</p>
<pre><code>@Configuration
@Profile("dev &am... |
43,967,489 | Could not get unknown property 'repositoryUrl' for project<p>I have a project employing React-Native. I'm <a href="https://facebook.github.io/react-native/docs/android-building-from-source.html" rel="nofollow noreferrer">building the RN module from source</a>, so my project has the ReactAndroid module as a dependency.<... | <p>Well, this turned out interesting.</p>
<h1>The reason</h1>
<p>The error pointed to the this line at the React-Native module's <code>release.gradle</code>:</p>
<pre><code>def getRepositoryUrl() {
return hasProperty('repositoryUrl') ? property('repositoryUrl') : 'https://oss.sonatype.org/service/local/staging/dep... | Could not get unknown property 'repositoryUrl' for project | android|android-studio|gradle|react-native|android-gradle-plugin | 8 | 6,940 | 2 | 43,967,490 | 43,967,490 | 17 | true | 2017-05-14T18:32:18.850Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Could not get unknown property 'repositoryUrl' for project<p>I have a project employing React-Native. I'm <a href="https://facebook.github.io/react-native/do... |
44,067,027 | error X3000: Illegal character in shader file<p>I pasted a line of shader code from SO and now my project refuses to work.</p>
<ul>
<li><p>I removed the tainted line of code.</p></li>
<li><p>I've re-written the shader multiple times from scratch using VS, Notepad and Notepad++ as suggested on the <a href="http://answe... | <p>It was an encoding problem. When I pasted the line of code it somehow made my compiler treat every text file as UNICODE instead of ASCII. This caused the problem.<br>
The solution was opening the shader file in Visual Studio and go to <br>
<strong>File->Save as->Save with Encoding</strong> and then choose the correc... | error X3000: Illegal character in shader file | character-encoding|shader|directx-11 | 8 | 4,645 | 1 | 44,072,379 | 44,072,379 | 17 | true | 2017-05-19T09:59:57.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
error X3000: Illegal character in shader file<p>I pasted a line of shader code from SO and now my project refuses to work.</p>
<ul>
<li><p>I removed the tai... |
44,052,586 | Visual Studio 2017 Angular 4 Templates<p>I am looking for a good Angular 4 template for Visual Studio 2017. Or what is the best template to use and the way to proceed? This will be for a Angular 4 SPA web page.</p> | <p><code>SPA</code> templates have now been updated for <code>Angular4</code>. You can follow <a href="https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/" rel="noreferrer">this</a> article.</p> | Visual Studio 2017 Angular 4 Templates | angular|visual-studio|spa-template | 8 | 31,541 | 4 | 44,095,839 | 44,095,839 | 17 | true | 2017-05-18T15:56:34.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Visual Studio 2017 Angular 4 Templates<p>I am looking for a good Angular 4 template for Visual Studio 2017. Or what is the best template to use and the way ... |
44,104,241 | postgreSQL error initdb: command not found<p>i was installing postgresql on ubuntu using linuxbrew:</p>
<pre><code>brew install postgresql
</code></pre>
<p>it seems to work fine but after that because i was installing PostgreSQL for the first time i tried creating a database:</p>
<pre><code>initdb /usr/local/var/pos... | <p>run <code>locate initdb</code> it should give you the list to chose. smth like:</p>
<pre><code>MacBook-Air:~ vao$ locate initdb
/usr/local/Cellar/postgresql/9.5.3/bin/initdb
/usr/local/Cellar/postgresql/9.5.3/share/doc/postgresql/html/app-initdb.html
/usr/local/Cellar/postgresql/9.5.3/share/man/man1/initdb.1
/usr/l... | postgreSQL error initdb: command not found | database|postgresql|ubuntu | 17 | 53,068 | 5 | 44,106,963 | 44,106,963 | 17 | true | 2017-05-22T03:31:22.987Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
postgreSQL error initdb: command not found<p>i was installing postgresql on ubuntu using linuxbrew:</p>
<pre><code>brew install postgresql
</code></pre>
<p... |
44,140,502 | why the Elm Architecture is called TEA?<p>I've seen this <code>TEA</code> acronym (?!) in many places all over the web - means elm architecture - but i don't understand <strong>what each initial stands for.</strong> Thanks.</p> | <p>It just stands for <em><strong>T</strong>he <strong>E</strong>lm <strong>A</strong>rchitecture</em></p> | why the Elm Architecture is called TEA? | elm|elm-architecture | 7 | 828 | 2 | 44,140,555 | 44,140,555 | 17 | true | 2017-05-23T16:37:36.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
why the Elm Architecture is called TEA?<p>I've seen this <code>TEA</code> acronym (?!) in many places all over the web - means elm architecture - but i don't... |
44,143,294 | Flask - how to read request.files['image'] as base64?<p>I'm using Python Flask as my backend and faced a little problem.
In the frontend application I have a form that contains an image upload feature. </p>
<p>In the backend I refer a variable to the image with
<code>image = request.files['image']</code></p>
<p>That... | <p>Basically you need to read it as a stream and then convert it to base64 format.
Check the following answer:</p>
<p><a href="https://stackoverflow.com/questions/3715493/encoding-an-image-file-with-base64">Encoding an image file with base64</a></p>
<p>The solution shoud look like this:</p>
<pre><code>import base64
... | Flask - how to read request.files['image'] as base64? | python|forms|flask|base64 | 12 | 15,636 | 1 | 44,145,787 | 44,145,787 | 17 | true | 2017-05-23T19:17:42.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flask - how to read request.files['image'] as base64?<p>I'm using Python Flask as my backend and faced a little problem.
In the frontend application I have a... |
44,224,227 | .attr vs .classed in D3.js<p>In d3, when is it appropriate to use</p>
<pre><code>d3.select("foo").attr('class', 'bar');
</code></pre>
<p>as opposed to</p>
<pre><code>d3.select("foo").classed('bar', true);
</code></pre>
<p>?</p>
<p>Is one recommended or expected to be deprecated? What is industry standard?</p> | <p>I think the <code>classed</code> is a kind of conditional check for example:
To add a class, the second parameter to classed must be true, as in this code:</p>
<pre><code> d3.selectAll(".bar")
.classed("my-selector", true);
</code></pre>
<p>To remove a class, the second parameter to classed mus... | .attr vs .classed in D3.js | javascript|d3.js | 23 | 14,342 | 2 | 44,224,276 | 44,224,276 | 17 | true | 2017-05-28T05:46:36.973Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
.attr vs .classed in D3.js<p>In d3, when is it appropriate to use</p>
<pre><code>d3.select("foo").attr('class', 'bar');
</code></pre>
<p>as opposed to</p>
... |
44,251,135 | Cannot convert undefined or null to object redux<p>I'm using Redux to make a simple store and unfortunately it's throwing this error: </p>
<pre><code> Cannot convert undefined or null to object
</code></pre>
<p>The browser points to the line of importing Redux </p>
<pre><code>import * as redux from "redux"
</code></... | <p>That error is thrown as in your reducer you are trying to spread a non existent property on the state object</p>
<pre><code>...state.polls,
</code></pre>
<p>To be able to do so you have to define the shape of your initial state as </p>
<pre><code>const initialState = {
polls: [],
};
</code></pre>
<p>Full wor... | Cannot convert undefined or null to object redux | javascript|reactjs|redux|react-redux | 8 | 15,157 | 2 | 44,251,410 | 44,251,410 | 17 | true | 2017-05-29T22:50:40.110Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot convert undefined or null to object redux<p>I'm using Redux to make a simple store and unfortunately it's throwing this error: </p>
<pre><code> Canno... |
44,353,516 | Get keys of pandas.Series.value_counts<p>I use <code>pandas.Series.value_counts</code> to count gender of users. But I also need to get the keys of a result to draw a plot and use keys as a label of the plot.</p>
<p>For example the result of <code>data.gender.value_counts()</code> is:</p>
<pre><code>female 6700
m... | <p>Demo:</p>
<pre><code>In [165]: s
Out[165]:
female 6700
male 6194
brand 5942
unknown 1117
Name: value_counts, dtype: int64
In [166]: s.index.tolist()
Out[166]: ['female', 'male', 'brand', 'unknown']
</code></pre>
<p>Plot:</p>
<pre><code>In [169]: s.plot.bar(rot=0)
Out[169]: <matplotlib.axes._... | Get keys of pandas.Series.value_counts | python|pandas | 10 | 12,080 | 3 | 44,353,538 | 44,353,538 | 17 | true | 2017-06-04T11:22:40.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get keys of pandas.Series.value_counts<p>I use <code>pandas.Series.value_counts</code> to count gender of users. But I also need to get the keys of a result ... |
44,058,355 | PowerQuery: How can I concatenate grouped values?<p>If I have the following table (shown in the image below), how can I write a grouped query that would concatenate the grouped results?</p>
<p><a href="https://i.stack.imgur.com/FwYeH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/FwYeH.png" alt="InputTable"... | <p>If your table is Source, and if NumberColumn has the number type, then this will work:</p>
<p><code>= Table.Group(Source, {"LetterColumn"}, {{"Column", each Text.Combine(List.Transform(_[NumberColumn], (x) => Number.ToText(x)), ","), type text}})</code></p>
<p><code>Table.Group</code> does a group by operation,... | PowerQuery: How can I concatenate grouped values? | excel|group-by|powerquery|excel-2016|m | 31 | 29,490 | 2 | 44,058,650 | 44,058,650 | 18 | true | 2017-05-18T21:53:59.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PowerQuery: How can I concatenate grouped values?<p>If I have the following table (shown in the image below), how can I write a grouped query that would conc... |
44,074,629 | Hostlistener does not respond to arrow keys<p>I have an angular 2 component and in the middle of that I listen for keys:</p>
<pre><code> @HostListener('document:keypress', ['$event'])
handleKeyboardEvent(event: KeyboardEvent) {
console.log(event);
}
</code></pre>
<p>I'm not getting any notification of arro... | <p>You'd need to use <code>keydown</code> for arrow keys.</p>
<pre><code>@HostListener('document:keydown', ['$event'])
handleKeyboardEvent(event: KeyboardEvent) {
console.log(event);
}
</code></pre>
<p>keypress event represents a character being typed, and arrows are not characters so they won't trigger key... | Hostlistener does not respond to arrow keys | angular | 8 | 5,653 | 1 | 44,074,707 | 44,074,707 | 18 | true | 2017-05-19T16:15:24.040Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Hostlistener does not respond to arrow keys<p>I have an angular 2 component and in the middle of that I listen for keys:</p>
<pre><code> @HostListener('doc... |
44,206,827 | Why do ports need to be specified twice separated by a colon?<p>A lot of times, I see ports described twice with a colon like in this Docker Compose file from the <a href="https://docs.docker.com/compose/networking/" rel="noreferrer">Docker Networking in Compose</a> page:</p>
<pre><code>version: "3"
services:
web:
... | <p>The first port is host's port and the second is the remote port (i.e: in the container). That expression bounds the remote port to the local port.</p>
<p>In the example you map container's 8080 port to host's 8080 port, but it's perfectly normal to use different ports (e.g: 48080:8080)</p> | Why do ports need to be specified twice separated by a colon? | networking|docker|port|docker-compose | 23 | 4,652 | 2 | 44,206,890 | 44,206,890 | 18 | true | 2017-05-26T17:05:59.803Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why do ports need to be specified twice separated by a colon?<p>A lot of times, I see ports described twice with a colon like in this Docker Compose file fro... |
44,120,875 | Weighted correlation in R<p>I am trying to output a correlation matrix for various locations. The row names 'PC1', PC2' etc. represent principal components. Since the percentage variance explained (and thus the weights) of principal components decreases from PC1 to PC4, I need to run Pearson correlation such that it ta... | <p>Ok, this is very easy to do in R using <code>cov.wt</code> (available in <code>stats</code>)</p>
<pre class="lang-r prettyprint-override"><code>weighted_corr <- cov.wt(DF, wt = w, cor = TRUE)
corr_matrix <- weighted_corr$cor
</code></pre>
<p>That's it!</p> | Weighted correlation in R | r|correlation | 8 | 6,438 | 1 | 44,136,794 | 44,136,794 | 19 | true | 2017-05-22T19:40:00.483Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Weighted correlation in R<p>I am trying to output a correlation matrix for various locations. The row names 'PC1', PC2' etc. represent principal components. ... |
43,937,561 | What is the correct way to export a constant in ES6?<p>I'm trying to break my entry file into components but I'm not sure how to make the constant available to the import. This is what I've tried so far and both seem to work:</p>
<pre><code>export const ConnectedRange = connectRange(Range);
exports.ConnectedRange = c... | <p><code>export const ConnectedRange = connectRange(Range);</code></p>
<p>Is the ES modules syntax.</p>
<p><code>exports.ConnectedRange = connectRange(Range);</code></p>
<p>Is the commonJS syntax.</p>
<p>I would recommend using the ES modules syntax, and compiling to common JS if the environment you run your code on do... | What is the correct way to export a constant in ES6? | javascript|webpack | 32 | 59,205 | 3 | 43,938,110 | 43,938,110 | 20 | true | 2017-05-12T12:15:44.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the correct way to export a constant in ES6?<p>I'm trying to break my entry file into components but I'm not sure how to make the constant available ... |
43,970,878 | How to add close button to bootstrap card?<p>I have a bootstrap card using the following code: </p>
<pre><code> <div class="card card-outline-danger text-center">
<span class="pull-right clickable" data-effect="fadeOut"><i class="fa fa-times"></i></span>
<div class="... | <p>This isn't a standard feature of bootstrap, so you need to bind a JS click event to the icon, and trigger it to close the parent <code>.card</code>. I also added <code>cursor: pointer</code> to the icon so that it looks like something you can click on. </p>
<p><div class="snippet" data-lang="js" data-hide="false" d... | How to add close button to bootstrap card? | html|css|twitter-bootstrap|twitter-bootstrap-3 | 14 | 28,220 | 2 | 43,970,963 | 43,970,963 | 20 | true | 2017-05-15T02:43:38.717Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add close button to bootstrap card?<p>I have a bootstrap card using the following code: </p>
<pre><code> <div class="card card-outline-danger text... |
44,067,861 | PySpark: Add a new column with a tuple created from columns<p>Here I have a dateframe created as follow,</p>
<pre><code>df = spark.createDataFrame([('a',5,'R','X'),('b',7,'G','S'),('c',8,'G','S')],
["Id","V1","V2","V3"])
</code></pre>
<p>It looks like</p>
<pre><code>+---+---+---+---+
| Id| V1... | <p>I'm coming from scala but I do believe that there's a similar way in python : </p>
<p>Using <a href="http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.functions$" rel="noreferrer"><code>sql.functions</code></a> package mehtod : </p>
<p>If you want to get a <code>StructType</code> with t... | PySpark: Add a new column with a tuple created from columns | python|apache-spark|pyspark|apache-spark-sql | 7 | 14,097 | 2 | 44,069,321 | 44,069,321 | 20 | true | 2017-05-19T10:37:12.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PySpark: Add a new column with a tuple created from columns<p>Here I have a dateframe created as follow,</p>
<pre><code>df = spark.createDataFrame([('a',5,'... |
44,116,800 | How to show html entity using React?<p>I am wanting to show the 'cubic' html entity (superscript 3). I am doing like
this:</p>
<pre><code>const formatArea = function(val){
return val + " ft&sup3;";
}
</code></pre>
<p>where <code>formatArea</code> is being called from inside the component':</p>
<pre><code>r... | <p>Found this way using JSX:</p>
<pre><code>const formatArea = (val) => {
return (<span>{val}&nbsp;ft<sup>3</sup></span>);
}
</code></pre> | How to show html entity using React? | javascript|reactjs|superscript | 39 | 42,824 | 6 | 44,117,068 | 44,117,068 | 20 | true | 2017-05-22T15:29:22.113Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to show html entity using React?<p>I am wanting to show the 'cubic' html entity (superscript 3). I am doing like
this:</p>
<pre><code>const formatArea... |
44,218,378 | Comparison of a Dataframe column values with a list<p>Consider this Dataframe:</p>
<pre><code>df = pd.DataFrame({'A': [1, 1, 2, 2, 3, 3],
'B': [10, 15, 20, 25, 30,35],
'C': [100, 150, 200, 250, 300, 350]})
</code></pre>
<p>This is the code to get values of column C, where it is the... | <p>You can use <code>isin</code> method:</p>
<pre><code>df['D'] = df.C.isin(firsts).astype(int)
df
# A B C D
#0 1 10 100 1
#1 1 15 150 0
#2 2 20 200 1
#3 2 25 250 0
#4 3 30 300 1
#5 3 35 350 0
</code></pre>
<hr>
<p>The reason your approach fails is that python <code>in</code> operato... | Comparison of a Dataframe column values with a list | python|pandas|dataframe | 15 | 45,867 | 4 | 44,218,412 | 44,218,412 | 21 | true | 2017-05-27T15:04:49.603Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Comparison of a Dataframe column values with a list<p>Consider this Dataframe:</p>
<pre><code>df = pd.DataFrame({'A': [1, 1, 2, 2, 3, 3],
... |
44,347,129 | Delete git.io shortened URL<p>I wanted to shorten my GitHub repo's URL using git.io. I wanted a custom name but accidentally used their automatic name, which is full of random characters.</p>
<p>How can I revert this and get a new one?</p> | <p>If someone else created it first, it will return the existing shortened URL. So, it is currently not possible to override but you can contact GitHub support team to either remove or change it.</p>
<p>I discovered following trick though, you can add a harmless query param <code>?</code> to make it different:</p>
<p... | Delete git.io shortened URL | url|github | 14 | 2,309 | 5 | 44,347,271 | 44,347,271 | 21 | true | 2017-06-03T18:13:33.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Delete git.io shortened URL<p>I wanted to shorten my GitHub repo's URL using git.io. I wanted a custom name but accidentally used their automatic name, which... |
44,136,463 | How to get Kafka lag using Kafka 0.10?<p>As <code>Kafka 0.10</code> isn't using Zookeeper anymore to store the lags anymore, how do I retrieve it now? Is there way to access it from the consumers?</p> | <p>According to the latest documentation: <a href="https://kafka.apache.org/documentation/#basic_ops_consumer_group" rel="noreferrer">kafka.apache.org/documentation</a> it is done the following way:</p>
<pre><code>> bin/kafka-consumer-groups.sh --bootstrap-server broker1:9092 --describe --group test-consumer-group
... | How to get Kafka lag using Kafka 0.10? | apache-kafka | 7 | 20,002 | 3 | 44,137,094 | 44,137,094 | 22 | true | 2017-05-23T13:37:45.357Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get Kafka lag using Kafka 0.10?<p>As <code>Kafka 0.10</code> isn't using Zookeeper anymore to store the lags anymore, how do I retrieve it now? Is the... |
44,107,868 | Is http.CloseNotify entirely replaced by http.Request.Context().Done()?<p>Go 1.7 added Context to the http.Request. Does it completely replace http.CloseNotify? Should I prefer that now, and not bother with CloseNotify?</p> | <p>Yes, but only in Go 1.8+. The APIs existed in Go 1.7 but it wasn't until Go 1.8 that the client's disconnection caused the Request's Context to be Done, so in Go 1.7 there was still a valid use of CloseNotifier.</p>
<p>(Source: I added "context" to the standard library and am the author of the net/http package.)</p... | Is http.CloseNotify entirely replaced by http.Request.Context().Done()? | http|go | 9 | 1,282 | 1 | 44,146,619 | 44,146,619 | 22 | true | 2017-05-22T08:15:54.037Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is http.CloseNotify entirely replaced by http.Request.Context().Done()?<p>Go 1.7 added Context to the http.Request. Does it completely replace http.CloseNoti... |
44,208,081 | JS quote best practices? ES6 / React -- single, double, backticks?<p>All of these <em>work</em> of course, but which one is the best practice for ES6 in a jsx file? (ignoring the formatting). It is my understanding that template strings are meant mostly (solely?) for descriptive console logging and not for regular usag... | <p>When working with JSX best practice is to use double quotes directly (no-braces) if just a simple string, or use backtick if interpolating a var into the string</p>
<p>JSX attempts to mimics HTML attributes making it more accessible when learning for first time, and beyond that I find it provides a clear visual dis... | JS quote best practices? ES6 / React -- single, double, backticks? | reactjs|ecmascript-6 | 16 | 23,341 | 3 | 44,209,432 | 44,209,432 | 23 | true | 2017-05-26T18:30:26.767Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JS quote best practices? ES6 / React -- single, double, backticks?<p>All of these <em>work</em> of course, but which one is the best practice for ES6 in a js... |
44,098,326 | "EF BB BF" at the beginning of JSON files created in Visual Studio<p>I have a bunch of <code>JSON</code> files set as <code>Embedded resource</code> in one of my projects. I'm using <code>Newtonsoft.Json</code> to parse these files:</p>
<pre><code>public static string ReadStringFromStream(string streamName)
{
usin... | <p>That's a byte-order mark (BOM). </p>
<p>I'm assuming your first code block is showing how you get the file. If you want the files in UTF-8 without a BOM, you can use the <a href="https://msdn.microsoft.com/en-us/library/s064f8w2(v=vs.110).aspx" rel="noreferrer"><code>UTF8Encoding</code></a> constructor to build an ... | "EF BB BF" at the beginning of JSON files created in Visual Studio | c#|.net|json|json.net | 19 | 19,499 | 2 | 44,098,350 | 44,098,350 | 24 | true | 2017-05-21T15:00:56.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
"EF BB BF" at the beginning of JSON files created in Visual Studio<p>I have a bunch of <code>JSON</code> files set as <code>Embedded resource</code> in one o... |
44,359,812 | Set nil string pointer to empty string<p>How do I set the referenced value of a string pointer in a type to the empty string?
Consider this example:</p>
<pre><code>package main
import (
"fmt"
)
type Test struct {
value *string
}
func main() {
t := Test{nil}
if t.value == nil {
// I want to s... | <p>String literals are not <a href="https://golang.org/ref/spec#Address_operators" rel="noreferrer">addressable</a>.</p>
<p>Take the address of variable containing the empty string:</p>
<pre><code>s := ""
t.value = &s
</code></pre>
<p>or use new:</p>
<pre><code>t.value = new(string)
</code></pre> | Set nil string pointer to empty string | string|pointers|go | 10 | 16,204 | 1 | 44,359,942 | 44,359,942 | 24 | true | 2017-06-04T23:28:07.773Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set nil string pointer to empty string<p>How do I set the referenced value of a string pointer in a type to the empty string?
Consider this example:</p>
<pr... |
44,105,029 | How to set default value and also use Environment variable in application.conf<p><br/>
I want to set value for one of config variable in application.conf using environment variable. But if this env variable is not present I want to default config to a certain value instead of erring out. <br/>
Is this possible? Here is... | <p>This is described in the play documentation <a href="https://www.playframework.com/documentation/2.8.x/ProductionConfiguration#Using-environment-variables" rel="nofollow noreferrer">Production Configuration</a>:</p>
<pre><code>my.key = defaultvalue
my.key = ${?MY_KEY_ENV}
</code></pre> | How to set default value and also use Environment variable in application.conf | scala|playframework|config | 20 | 8,707 | 1 | 44,105,416 | 44,105,416 | 25 | true | 2017-05-22T05:08:52.847Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set default value and also use Environment variable in application.conf<p><br/>
I want to set value for one of config variable in application.conf usi... |
43,957,876 | How to count the number of characters at the start of a string?<p>How can I count the number of characters at the start/end of a string in Python?</p>
<p>For example, if the string is</p>
<pre><code>'ffffhuffh'
</code></pre>
<p>How would I count the number of <code>f</code>s at the <strong>start</strong> of the stri... | <p>A short and simple way will be to use the <code>str.lstrip</code> method, and count the difference of length.</p>
<pre><code>s = 'ffffhuffh'
print(len(s)-len(s.lstrip('f')))
# output: 4
</code></pre>
<p><a href="https://docs.python.org/3/library/stdtypes.html#str.lstrip" rel="noreferrer"><code>str.lstrip([chars])<... | How to count the number of characters at the start of a string? | python|string|python-3.x|count | 11 | 8,262 | 7 | 43,958,170 | 43,958,170 | 26 | true | 2017-05-13T20:52:51.537Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to count the number of characters at the start of a string?<p>How can I count the number of characters at the start/end of a string in Python?</p>
<p>Fo... |
43,991,642 | Service Worker support in chrome webview<p>Is Service Worker supported in chrome webview for android, if yes then from which version is it supported. Tried googling, but didn't find proper information.</p> | <p>As per <a href="https://chromereleases.googleblog.com/2015/03/android-webview-update.html" rel="noreferrer">this announcement</a>, service workers have been supported in Chrome WebViews since March of 2015 (Android WebView v40+). Devices running Android OS 5.0 and higher should have it.</p>
<p>Since WebViews have t... | Service Worker support in chrome webview | service-worker|google-chrome-webview | 11 | 8,261 | 1 | 44,162,561 | 44,162,561 | 26 | true | 2017-05-16T02:34:49.047Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Service Worker support in chrome webview<p>Is Service Worker supported in chrome webview for android, if yes then from which version is it supported. Tried g... |
44,179,097 | Firebase DatabaseReference filter by specified values<p>Lets suppose I have this firebase JSON structure:</p>
<p><a href="https://i.stack.imgur.com/YuK39.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/YuK39.jpg" alt="example"></a></p>
<p>And I need to get all the questions which have the atribute "from" eq... | <blockquote>
<p>Try this if may be useful in your scenario</p>
</blockquote>
<pre><code> DatabaseReference reference = FirebaseDatabase.getInstance().getReference();
Query query = reference.child("questions").orderByChild("from").equalTo("this");
query.addListenerForSingleValueEvent(new ValueEventListener()... | Firebase DatabaseReference filter by specified values | android|json|filter|firebase-realtime-database | 8 | 13,110 | 2 | 44,179,255 | 44,179,255 | 26 | true | 2017-05-25T11:10:40.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Firebase DatabaseReference filter by specified values<p>Lets suppose I have this firebase JSON structure:</p>
<p><a href="https://i.stack.imgur.com/YuK39.jp... |
44,115,791 | Grant privileges for an Oracle package?<p>I have a <code>package A</code>, which uses some variables and procedures in another <code>package B</code> in the <strong>same schema</strong>. Now I want to move <code>package A</code> to a <strong>new schema</strong>. What privileges should I grant to the <code>new schema</c... | <p>Use <a href="https://www.techonthenet.com/oracle/grant_revoke.php" rel="noreferrer">GRANT</a> to give <code>execute</code> privileges</p>
<pre><code>grant execute on PACKAGE_B to new_schema;
</code></pre>
<p>Then, you need to ensure that any reference in package A includes the full path:</p>
<pre><code>PACKAGE_B.SOM... | Grant privileges for an Oracle package? | sql|oracle|ddl | 20 | 96,073 | 1 | 44,116,007 | 44,116,007 | 31 | true | 2017-05-22T14:41:01.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Grant privileges for an Oracle package?<p>I have a <code>package A</code>, which uses some variables and procedures in another <code>package B</code> in the ... |
44,192,105 | Checking if a map or array is empty in Presto?<p>How do I check if a map has no keys in Presto? If I have a way to check if an array is empty, I can use the <code>map_keys</code> function to determine if the map is empty.</p> | <p>You can use the <code>cardinality</code> function: <a href="https://prestodb.io/docs/current/functions/array.html#cardinality" rel="noreferrer">https://prestodb.io/docs/current/functions/array.html#cardinality</a></p>
<pre><code>select cardinality(array[]) = 0;
_col0
-------
true
(1 row)
</code></pre> | Checking if a map or array is empty in Presto? | sql|presto | 13 | 32,569 | 2 | 44,316,753 | 44,316,753 | 33 | true | 2017-05-26T01:15:55.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Checking if a map or array is empty in Presto?<p>How do I check if a map has no keys in Presto? If I have a way to check if an array is empty, I can use the ... |
44,323,531 | How to get bearer token passed through header in rails?<p>In my rails application I'm able to get the Token <code>Authorization: Token token='aUthEnTicAtIonTokeN'</code> passed in header of request with</p>
<pre><code>authenticate_with_http_token do |token, options|
@auth_token = token
end
</code></pre>
<p>but when ... | <p>You could get the Bearer token with a method like:</p>
<pre><code>def bearer_token
pattern = /^Bearer /
header = request.headers['Authorization']
header.gsub(pattern, '') if header && header.match(pattern)
end
</code></pre>
<p>Also, when setting the header it should be:</p>
<pre><code>Authorization... | How to get bearer token passed through header in rails? | ruby-on-rails|authentication|bearer-token | 18 | 15,378 | 3 | 44,324,505 | 44,324,505 | 33 | true | 2017-06-02T07:48:17.393Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get bearer token passed through header in rails?<p>In my rails application I'm able to get the Token <code>Authorization: Token token='aUthEnTicAtIonT... |
37,626,898 | Error: Could not find or load main class .library.path=<p>I am trying to run DynamoDB locally, with the instructions here:</p>
<p><a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html" rel="noreferrer">http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.h... | <p>We found that PowerShell misinterprets the <code>-Djava.library.path</code> parameter.
Enclosing either the parameter name or the entire name & value fixed the issue in our case.</p>
<p><code>java -D"java.library.path"=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb</code></p>
<p>or</p>
<p><code>java "-D... | Error: Could not find or load main class .library.path= | java|amazon-dynamodb | 21 | 7,436 | 2 | 44,385,482 | 44,385,482 | 36 | true | 2016-06-04T05:57:08.957Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error: Could not find or load main class .library.path=<p>I am trying to run DynamoDB locally, with the instructions here:</p>
<p><a href="http://docs.aws.a... |
44,159,621 | How to denoise audio with SOX?<p>Givent a audio.wav recording with silence at both start and end for at least 1second...</p>
<p><strong>How to denoise with SOX ?</strong></p> | <h3>What is SOX</h3>
<ul>
<li><a href="https://linux.die.net/man/1/sox" rel="noreferrer">SoX</a> - Sound eXchange, the Swiss Army knife of audio manipulation</li>
</ul>
<h3>Create noise file from input audio's initial 0.9s silence + room's noise</h3>
<pre><code># sox in.ext out.ext trim {start: s.ms} {duration: s.ms... | How to denoise audio with SOX? | audio-recording|sox | 18 | 13,573 | 1 | 44,159,622 | 44,159,622 | 41 | true | 2017-05-24T13:21:09.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to denoise audio with SOX?<p>Givent a audio.wav recording with silence at both start and end for at least 1second...</p>
<p><strong>How to denoise with ... |
43,994,584 | What is qobject_cast?<p>Could someone explain in as simple terms as possible (or as simple as you would like) what <code>qobject_cast</code> is, what it does and why we would need to cast one class type to another?</p>
<p>Like, I get typecasting in the sense of casting an <code>int</code> as a <code>char</code> or <co... | <p>Before you start learning what <a href="http://doc.qt.io/qt-5/qobject.html#qobject_cast" rel="noreferrer"><code>qobject_cast</code></a> is, you would need to know what C++'s <a href="http://en.cppreference.com/w/cpp/language/dynamic_cast" rel="noreferrer"><code>dynamic_cast</code></a> is. Dynamic cast is all about <... | What is qobject_cast? | c++|qt|dynamic-cast|qobject | 27 | 34,081 | 2 | 43,995,082 | 43,995,082 | 42 | true | 2017-05-16T07:05:21.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is qobject_cast?<p>Could someone explain in as simple terms as possible (or as simple as you would like) what <code>qobject_cast</code> is, what it does... |
43,951,118 | Slack Incoming Web Hooks - Send message @channel<p>I am working with Slack API recently and my motive is to send a channel wide message at a certain time by calling a web hook provided by Slack Incoming Web hooks.</p>
<p>I created a web hook and got code from Slack as below</p>
<pre><code>curl -X POST -H 'Content-typ... | <p>The correct syntax for sending @channel messages is <code><!channel></code>. </p>
<p>So the correct curl command for your example should read:</p>
<pre><code>curl -X POST -H 'Content-type: application/json' --data '{"text":"Hey, Its time for meeting!! <!channel>", "link_names" : 1}' HOOK_URL
</code></p... | Slack Incoming Web Hooks - Send message @channel | slack-api | 20 | 13,317 | 4 | 43,951,805 | 43,951,805 | 46 | true | 2017-05-13T08:48:21.093Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Slack Incoming Web Hooks - Send message @channel<p>I am working with Slack API recently and my motive is to send a channel wide message at a certain time by ... |
44,046,877 | How to import Room Persistence Library to an Android project<p>I recently saw the new feature announced on Google I/O Room Persistence Library to work with Sqlite databases on Android. I have been looking to the <a href="https://developer.android.com/topic/libraries/architecture/room.html" rel="noreferrer">official doc... | <p>It's possible to find the dependencies on <a href="https://github.com/googlecodelabs/android-persistence/blob/master/app/build.gradle" rel="noreferrer">the example codelab</a> for the new architecture components.</p>
<p><strong>Root :</strong></p>
<pre><code>allprojects {
repositories {
jcenter()
maven {
... | How to import Room Persistence Library to an Android project | android|sqlite|android-sqlite|android-room | 52 | 54,036 | 13 | 44,046,878 | 44,046,878 | 55 | true | 2017-05-18T11:46:05.720Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to import Room Persistence Library to an Android project<p>I recently saw the new feature announced on Google I/O Room Persistence Library to work with S... |
44,013,663 | How to Enter Placeholder Text Within Html.TextBoxFor in C# / MVC 4<p>Typically in HTML / CSS, if you want to add placeholder text to a textbox you would simply do this: </p>
<p><code><input type="text" class="input-class" placeholder="Please enter your email"/></code></p>
<p>But since I'm using the existing cod... | <p>Use an overload of <code>TextBoxFor()</code> with an <code>htmlAttributes</code> argument. This argument should be an anonymous object with <em>all</em> attributes you wish to assign to the input.</p>
<p>For example, if you want to set the <code>placeholder</code> and <code>class</code> attributes:</p>
<pre><code>... | How to Enter Placeholder Text Within Html.TextBoxFor in C# / MVC 4 | c#|html|css|asp.net|asp.net-mvc-4 | 30 | 74,043 | 6 | 44,013,787 | 44,013,787 | 66 | true | 2017-05-17T00:33:28.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Enter Placeholder Text Within Html.TextBoxFor in C# / MVC 4<p>Typically in HTML / CSS, if you want to add placeholder text to a textbox you would simp... |
44,352,750 | Java File Handling DisplayOnConsole<p>Question – File Handling [20 pts]</p>
<p>Given the following data about some account information of First National bank customers:</p>
<p>111111 john smith 500</p>
<p>222222 mark smith 1500</p>
<p>333333 steve jones 2000</p>
<p>444444 mary jones 1000</p>
<pre><code> ... | <p>c.</p>
<pre><code>System.out.println("Account 1 id 111111 name: john smith balance: 500 $");
System.out.println("Account 2 id 222222 name: mark smith balance: 1500 $");
System.out.println("Account 3 id 333333 name: steve jones balance: 2000 $");
System.out.println("Account 4 id 444444 name: mary jones balance: 1000... | Java File Handling DisplayOnConsole | java|file-handling | -5 | 60 | 1 | 44,352,880 | 44,352,880 | -3 | true | 2017-06-04T09:46:18.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java File Handling DisplayOnConsole<p>Question – File Handling [20 pts]</p>
<p>Given the following data about some account information of First National ban... |
44,083,595 | Need answer for this from R language with some explanation<ol>
<li>Suppose age is a vector containing ages of 10 persons as
22,27,31,41,30,25,19,20,23,35.</li>
</ol>
<p><strong>Create a vector ‘age30’ with age of person > 30?</strong></p> | <p>We can subset the original vector based on the logical condition</p>
<pre><code>age30 <- ages[ages > 30]
</code></pre> | Need answer for this from R language with some explanation | r | -9 | 43 | 1 | 44,083,633 | 44,083,633 | -1 | true | 2017-05-20T08:23:04.850Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need answer for this from R language with some explanation<ol>
<li>Suppose age is a vector containing ages of 10 persons as
22,27,31,41,30,25,19,20,23,35.</l... |
44,168,787 | Is there such a thing as a clear both for CSS column styling?<p>I have a parent element and it has column-count: 2 and i want the last p element in this container to take up the entire width of the parent container. But the column-count: 2 forces the last p element to appear in the 2nd column. </p>
<p>See here: <a hre... | <p>If you want to add styles to the last <p> element, you can use this selector </p>
<pre><code>.columns-2 .p:nth-last-child(1){}
</code></pre> | Is there such a thing as a clear both for CSS column styling? | css|css-multicolumn-layout | -3 | 574 | 2 | 44,168,942 | 44,168,942 | -1 | true | 2017-05-24T21:31:26.167Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there such a thing as a clear both for CSS column styling?<p>I have a parent element and it has column-count: 2 and i want the last p element in this cont... |
44,237,369 | Rails mailer smtp authentication error<p>my mailer can't work because of this error. I can't understannd why. I use G-suite for my email.</p>
<p><a href="https://i.stack.imgur.com/AycIf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AycIf.png" alt="enter image description here"></a></p>
<p>Thanks ... | <p><strong>Reason</strong>: Google was blocking access from unknown location (app in production)</p>
<p><strong>Solution</strong>: go to following link and turn on <a href="https://www.google.com/settings/security/lesssecureapps" rel="nofollow noreferrer">https://www.google.com/settings/security/lesssecureapps</a></p> | Rails mailer smtp authentication error | ruby-on-rails|gmail|mailer | -3 | 310 | 1 | 44,237,807 | 44,237,807 | -1 | true | 2017-05-29T07:59:23.633Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rails mailer smtp authentication error<p>my mailer can't work because of this error. I can't understannd why. I use G-suite for my email.</p>
<p><a href="ht... |
43,958,755 | LIMIT CELLS PER ROW IN JSP<p>please i want to display some products from database in a jsp page , i used a table to display them , and it display all the products in a single row , i want to limit the number of cells ( td ) per row , for example 5 per row ..
here is the reuslt i get <a href="https://i.stack.imgur.com/... | <p>Open and close the row by</p>
<pre><code><tr></tr>
</code></pre>
<p>And iterate through your rows when it reaches your desired total then break out of the loop</p> | LIMIT CELLS PER ROW IN JSP | java|jsp|servlets | -4 | 67 | 1 | 43,958,781 | 43,958,781 | 0 | true | 2017-05-13T22:58:18.407Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
LIMIT CELLS PER ROW IN JSP<p>please i want to display some products from database in a jsp page , i used a table to display them , and it display all the pro... |
43,960,566 | How to call a service in view model through the interface<ul>
<li>I have defined a service <code>RestService.cs</code> and trying to call the
service from the view model <code>FirstViewModel.cs</code></li>
<li>How to achieve this using <code>IntIRestService.cs</code></li>
</ul>
<p><strong>RestService.cs</strong></p>
... | <p>IntIrestService is the interface, you can't instantiate the interface.<br>
You need to instantiate the concrete class that implements the interface.</p>
<pre><code>IntIrestService intIrestService = new RestService();
</code></pre> | How to call a service in view model through the interface | c#|xamarin|mvvmcross | -3 | 784 | 1 | 43,960,658 | 43,960,658 | 0 | true | 2017-05-14T05:05:19.547Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to call a service in view model through the interface<ul>
<li>I have defined a service <code>RestService.cs</code> and trying to call the
service from th... |
43,981,183 | create menu with ionic 2 and angular 2<p>I am developing a mobile application with ionic 2, and I need a menu as shown in the image,this menu is not like the menu side</p>
<p><a href="https://i.stack.imgur.com/8CDRa.png" rel="nofollow noreferrer">Page View</a></p> | <p>You will need to scaffold a new project with ionic2 cli using </p>
<pre><code>$ionic start myApp sidemenu
</code></pre>
<p>which will give you the basic hamburger menu after which it is all on how you style it.</p> | create menu with ionic 2 and angular 2 | html|angular|typescript|ionic2 | -5 | 65 | 1 | 43,981,972 | 43,981,972 | 0 | true | 2017-05-15T13:45:41.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
create menu with ionic 2 and angular 2<p>I am developing a mobile application with ionic 2, and I need a menu as shown in the image,this menu is not like the... |
43,998,410 | Java country code. Make the first character always appear<p>I wanna to make a country code text field. When user click text field, there preset a "+" at the first. Also, that "+" cannot be deleted.
How can I make this happen. </p> | <p>Use OnFocusChangeListener() to set the visibility of the "+" character and TextWatcher() for delete behavior:</p>
<pre><code>final EditText edt = (EditText) findViewById(R.id.editText);
edt.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSeque... | Java country code. Make the first character always appear | java|android|string | -3 | 48 | 3 | 43,999,348 | 43,999,348 | 0 | true | 2017-05-16T10:05:37.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java country code. Make the first character always appear<p>I wanna to make a country code text field. When user click text field, there preset a "+" at the ... |
43,998,405 | Why we need advanced versions in SQL Server and explain specific features it included with simple example<p>Why we keep moving from SQL Server 2000 to 2005 to 2008 to 2012 to 2016 to recent application of SQL Server? Answer me simply with example.. and kindly tell features included in each version</p> | <p>Odd question, odd answer :<br/>
<a href="https://en.wikipedia.org/wiki/Obsolescence" rel="nofollow noreferrer">Obsolescence</a><br/>
<br/>
By the way, if you wish to ask for support for unsupported solutions good luck.<br/>
Here is the official Microsoft post on <a href="https://docs.microsoft.com/en-us/sccm/core/pl... | Why we need advanced versions in SQL Server and explain specific features it included with simple example | sql-server | -5 | 45 | 1 | 44,000,368 | 44,000,368 | 0 | true | 2017-05-16T10:05:27.340Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why we need advanced versions in SQL Server and explain specific features it included with simple example<p>Why we keep moving from SQL Server 2000 to 2005 t... |
44,166,852 | CSV file with string in python<p>I have a CSV file that contains string cells, and I want to import it into python. My file is like :</p>
<pre><code>header1 header2 header3
abc 1.12 abc
str1 5.00 str2
</code></pre>
<p>I want to see the same format in python as array. How can I do this?</p> | <p>To convert your (assuming tab delimited) CSV file into a list of lists:</p>
<pre><code>import csv
with open('input.csv', 'rb') as f_input:
csv_input = csv.reader(f_input, delimiter='\t')
header = next(csv_input)
data = list(csv_input)
print data
print data[1][2] # row 2, column 3
</code></pre>
... | CSV file with string in python | python|arrays|string|csv | -4 | 1,577 | 4 | 44,167,293 | 44,167,293 | 0 | true | 2017-05-24T19:19:31.623Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CSV file with string in python<p>I have a CSV file that contains string cells, and I want to import it into python. My file is like :</p>
<pre><code>header1... |
43,960,183 | Material UI component reference does not work<p>I am building a little chat application.i have used Material UI TextField to input user message. but i can't refer it. I read about this. they said that they do not support for <code>refs</code>.
this is my code. and it works.</p>
<pre><code>class App extends Component ... | <p>In onChange method, you don't need to use <code>ref</code> to access value of same textfield, material-ui TextField pass 2 parameters in onChange method:</p>
<pre><code>event, value
</code></pre>
<p>So you can write it like this without using ref:</p>
<pre><code><TextField ... onChange={(e, value) => this.han... | Material UI component reference does not work | javascript|reactjs|material-ui | 11 | 19,751 | 6 | 43,960,434 | 43,960,434 | 1 | true | 2017-05-14T03:47:31.697Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Material UI component reference does not work<p>I am building a little chat application.i have used Material UI TextField to input user message. but i can't ... |
44,279,078 | How many users can I connect with my Laravel app using Pusher?<p>I have a small app that has more than 300 subscribers, maybe up to 900 subscribers. I'm planning to implement real-time product info and came across pusher.com. It was easy to implement but I couldn't clearly understand its pricing. <a href="https://pushe... | <p><strong>Disclaimer: I work at Pusher</strong></p>
<p>Your understanding of concurrent connections seems to be correct:</p>
<blockquote>
<p>If 900 premium users simultaneously logs in to my app...</p>
</blockquote>
<p>This would indeed constitute 900 concurrent connections but 900 concurrent connections would no... | How many users can I connect with my Laravel app using Pusher? | php|laravel|angular|pusher | -3 | 551 | 1 | 44,279,408 | 44,279,408 | 1 | true | 2017-05-31T08:06:59.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How many users can I connect with my Laravel app using Pusher?<p>I have a small app that has more than 300 subscribers, maybe up to 900 subscribers. I'm plan... |
44,138,474 | Set Item Permissions<p><strong>Folders work:</strong></p>
<p>I now know how to set the permissions of a folder in a library:</p>
<pre><code>public void ChangeItemPermissions()
{
_SharePoint.ClientContext _ClientContext = new _SharePoint.ClientContext("https://sharepoint.oshirowanen.com/sites/oshirodev/");
_Cl... | <p>I assume that <code>andresm53</code> is right about you using the extension method he mentioned.</p>
<p>To get this method to work on files you need to query by <code>FileLeafRef</code> (file name) and make sure that you add <code>FileLeafRef</code> to query <code>ViewFields</code>.</p>
<p>/edit</p>
<p>One more v... | Set Item Permissions | c#|.net|sharepoint|sharepoint-2010|csom | 13 | 1,827 | 5 | 44,209,629 | 44,209,629 | 2 | true | 2017-05-23T15:02:27.200Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set Item Permissions<p><strong>Folders work:</strong></p>
<p>I now know how to set the permissions of a folder in a library:</p>
<pre><code>public void Cha... |
44,349,131 | Ruby on rails: unexpected end-of-input, expecting keyword_end<p>i have a problem like the subject in the controller. I've got error of expecting end of function. But as you can see I've got every end of the function. I'm a beginner in RoR.</p>
<pre><code>class UsersController < ApplicationController
before_filter :... | <p>You missed <code>end</code> in <code>show</code> method. Try this:</p>
<pre><code> def show
@user = User.find(params[:id])
@user_catalogs = @user.catalogs
@hash = Gmaps4rails.build_markers(@user.locations) do |location, marker|
marker.lat location.latitude
marker.lng location.longitude
... | Ruby on rails: unexpected end-of-input, expecting keyword_end | ruby-on-rails|ruby | -4 | 529 | 2 | 44,349,145 | 44,349,145 | 2 | true | 2017-06-03T22:35:56.267Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ruby on rails: unexpected end-of-input, expecting keyword_end<p>i have a problem like the subject in the controller. I've got error of expecting end of funct... |
44,013,098 | Xamarin.Android.Support.Fragment, Version=1.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?<p>I attempted to use Xamarin.Android.Support libraries version 25.3.1 but because of a bug I decided to downgrade back to my previous version 23.3.0. After Downgrading I am get... | <p>I renamed the title because I had 2 following problem, they look similar indeed and both related to Android project only.</p>
<ol>
<li><p>First one was complaining about support.Fragment which is available above 24.x.x versions but I was using 23.0.x. This was caused probably because of downgrading from 25.3.1 vers... | Xamarin.Android.Support.Fragment, Version=1.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile? | xamarin|xamarin.android|xamarin.forms | 7 | 11,806 | 6 | 44,070,744 | 44,070,744 | 3 | true | 2017-05-16T23:16:39.467Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Xamarin.Android.Support.Fragment, Version=1.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?<p>I attempted... |
44,308,901 | TypeError: firebase.messaging is not a function in node.js<p>While trying to fetch the FCM messages in node.js using firebase module, following error "TypeError: firebase.messaging is not a function" is occurring. </p>
<pre><code>var firebase = require("firebase");
firebase.initializeApp({
apiKey: "xxxxxxx",
... | <p>The criteria you are trying to use only works on the browser:</p>
<p>You have to require <code>firebase-messaging</code>, check this full sample it will guide you <a href="https://github.com/firebase/quickstart-js/tree/master/messaging" rel="nofollow noreferrer">https://github.com/firebase/quickstart-js/tree/master... | TypeError: firebase.messaging is not a function in node.js | javascript|node.js|firebase|firebase-cloud-messaging | 9 | 20,031 | 5 | 44,309,060 | 44,309,060 | 3 | true | 2017-06-01T13:29:04.797Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeError: firebase.messaging is not a function in node.js<p>While trying to fetch the FCM messages in node.js using firebase module, following error "TypeEr... |
44,314,501 | How to pass a component type to render to another component in Angular?<p>I have a base component (<strong>MyBaseComponent</strong>) receiving data from it's invoker (<strong>App</strong>). </p>
<p>I want to know if it's possible for my base component to be told by it's invoker what 'display' component it should use ... | <p>1) You can try using <code>ngTemplateOutlet</code> directive like </p>
<p><strong>my-base.component.ts</strong></p>
<pre><code>@Component({
selector: 'my-base',
template: `
<div *ngFor="let datum of data">
<ng-container *ngTemplateOutlet="tmpl; context: { $implicit: datum }"></ng-conta... | How to pass a component type to render to another component in Angular? | angular|typescript | 7 | 11,584 | 4 | 44,315,841 | 44,315,841 | 3 | true | 2017-06-01T18:18:58.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to pass a component type to render to another component in Angular?<p>I have a base component (<strong>MyBaseComponent</strong>) receiving data from it's... |
44,197,177 | Disable Jupyter Notebook automatic hyperlink<p>In my notebook, I print some data from scraped web pages. Some of these are hyperlinks without tags e.g. <code>https://stackoverflow.com</code>. Unfortunately, Notebook prints these out as an actual hyperlink (i.e. wraps it in tags) on the output page and shortens it. (So... | <p><strong>Solution</strong>:</p>
<p>Enter the following text in the empty cell of your Jupyter notebook:</p>
<pre><code>%%javascript
Jupyter.utils.autoLinkUrls = function (txt) {
return txt;
}
</code></pre>
<p><strong>Explanation</strong>:</p>
<p>The ability to locate URLs in text output and convert them to hy... | Disable Jupyter Notebook automatic hyperlink | jupyter-notebook | 8 | 1,565 | 1 | 44,354,175 | 44,354,175 | 3 | true | 2017-05-26T08:38:54.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Disable Jupyter Notebook automatic hyperlink<p>In my notebook, I print some data from scraped web pages. Some of these are hyperlinks without tags e.g. <code... |
44,357,835 | JQuery panel hiding<p>I'm having trouble getting a simple panel hide script to work. It works for MLAWebsite's panel, but when I click the MLAJournal button nothing happens? I've tried everything I can think of and looked at it for quite a bit now and can't seem to figure it out.</p>
<p>Relevant JQuery and HTML:</p>
... | <p>You're missing a <code>#</code> there.</p>
<pre><code>$("#btnMLAJournal").click(function(){
$("#MLAWebsitepanel").hide();
$("#MLAJournalpanel").show();
//currentStep = 1;
});
</code></pre> | JQuery panel hiding | javascript|jquery|html | -3 | 40 | 3 | 44,357,876 | 44,357,876 | 3 | true | 2017-06-04T19:10:38.717Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JQuery panel hiding<p>I'm having trouble getting a simple panel hide script to work. It works for MLAWebsite's panel, but when I click the MLAJournal button ... |
44,231,610 | C++ Struct Array - Why does it have to be a pointer?<p>It took me a while to figure out how to make an array of the data structure I had created. I eventually figured it has to be a pointer, but why?</p>
<pre><code>struct Food{
int weight;
double price;
string name;
};
Food *foods = new Food[5]; // Why a pointer?
</... | <p>Because <code>new[]</code> allocates a chunk of memory, and gives you a <em>pointer</em> to that memory. In the case of <code>new Food[5]</code> there will be space for five objects of type <code>Food</code>, each default constructed. The pointer you get is to the first <code>Food</code> object of the five.</p>
<p>... | C++ Struct Array - Why does it have to be a pointer? | c++|arrays|struct | -3 | 56 | 2 | 44,231,622 | 44,231,622 | 4 | true | 2017-05-28T20:14:45.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C++ Struct Array - Why does it have to be a pointer?<p>It took me a while to figure out how to make an array of the data structure I had created. I eventuall... |
43,976,874 | kafka connect hdfs sink connector is failing even when json data contains schema and payload field<p>I am trying kafka connect hdfs sink connector for moving json data from kafka to hdfs.</p>
<p>Even when the json data in kafka has schema and payload kafka connect task is failing with error</p>
<pre><code>org.apache.... | <p>What version of Kafka Connect are you using? It helps to know this when working from the stacktrace to determine the source of the error.</p>
<p>I think what's happening is that you have data in the values, but not in the keys. Since you have both <code>key.converter</code> and <code>value.converter</code> set to t... | kafka connect hdfs sink connector is failing even when json data contains schema and payload field | apache-kafka|hdfs|apache-kafka-connect | 7 | 6,931 | 1 | 43,991,583 | 43,991,583 | 5 | true | 2017-05-15T10:16:21.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
kafka connect hdfs sink connector is failing even when json data contains schema and payload field<p>I am trying kafka connect hdfs sink connector for moving... |
43,989,590 | Acquire renderer process id in Electron<p>In Electron, the renderer process's pid was exposed by </p>
<pre><code>processId = require('remote').getCurrentWindow().getProcessId()
</code></pre>
<p>which, however, is no longer valid in recent releases (1.4.x, 1.5.x, 1.6.x).</p>
<p>Is there any other way to get the pid o... | <p>The method <code>getOSProcessId()</code> to acquire the renderer's OS pid (not the routing id) was added to <a href="https://github.com/electron/electron/releases/tag/v1.7.1" rel="nofollow noreferrer">Electron v1.7.1</a>. Here is the original <a href="https://github.com/electron/electron/pull/9222" rel="nofollow nor... | Acquire renderer process id in Electron | javascript|node.js|electron|chromium | 9 | 5,145 | 4 | 44,054,941 | 44,054,941 | 5 | true | 2017-05-15T22:13:30.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Acquire renderer process id in Electron<p>In Electron, the renderer process's pid was exposed by </p>
<pre><code>processId = require('remote').getCurrentWin... |
44,038,958 | Koa's `ctx.status` not getting sent to client<p>Here is my simple route:</p>
<pre><code>router.post('/getFile', async (ctx) => {
const fileName = `${ctx.request.body.file}.pdf`;
const file = fs.createReadStream(fileName); // This file might not exist.
file.on('error', (err) => {
ctx.response.status = 5... | <p>Looking <a href="https://github.com/koajs/koa/blob/302814e7a3ae214e0791edd9a513db9cba4f9b61/lib/context.js#L139-L140" rel="noreferrer">at the Koa code</a>, it has specific handling for <code>ENOENT</code> (which is the error that gets thrown when a file doesn't exist):</p>
<pre><code>// ENOENT support
if ('ENOENT' ... | Koa's `ctx.status` not getting sent to client | javascript|node.js|http|fetch-api|koa | 10 | 5,891 | 2 | 44,094,069 | 44,094,069 | 5 | true | 2017-05-18T05:04:22.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Koa's `ctx.status` not getting sent to client<p>Here is my simple route:</p>
<pre><code>router.post('/getFile', async (ctx) => {
const fileName = `${ctx... |
44,217,131 | MVC ASP.NET Writing to database is looping unintentionally<p>I'm very new to MVC and ASP.NET, but I've come across a weird issue.</p>
<p>I'm adding one entry to my database, then saving the changes, but that is not what happens.</p>
<pre><code>[Authorize]
public ActionResult EggRecieved()
{
//CHECK IF... | <p>You are recursively calling the method in the end, with</p>
<pre><code>return EggRecieved();
</code></pre>
<p>You should return an <code>ActionResult</code> there, like</p>
<pre><code>return View("MyView");
</code></pre> | MVC ASP.NET Writing to database is looping unintentionally | c#|asp.net|asp.net-mvc|database|visual-studio | -3 | 46 | 3 | 44,217,156 | 44,217,156 | 5 | true | 2017-05-27T12:56:54.243Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MVC ASP.NET Writing to database is looping unintentionally<p>I'm very new to MVC and ASP.NET, but I've come across a weird issue.</p>
<p>I'm adding one entr... |
44,339,375 | How can I install python modules in a docker image?<p>I have an image called: <code>Image</code> and a running container called: <code>container</code>. I want to install <code>pytorch</code> and <code>anacoda</code>. what's the easiest way to do this? Do I have to change the <code>dockerfile</code> and build a new ima... | <p>Yes, the best thing is to build your image in such a way it has the python modules are in there.</p>
<p>Here is an example. I build an image with the build dependencies:</p>
<pre><code>$ docker build -t oz123/alpine-test-mycoolapp:0.5 - < Image
Sending build context to Docker daemon 2.56 kB
Step 1 : FROM alpin... | How can I install python modules in a docker image? | linux|docker|dockerfile|torch|pytorch | 8 | 23,572 | 1 | 44,340,324 | 44,340,324 | 5 | true | 2017-06-03T01:25:49.867Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I install python modules in a docker image?<p>I have an image called: <code>Image</code> and a running container called: <code>container</code>. I wa... |
43,967,578 | Default Makefile for Sphinx<p>I'm trying to understand the Makefile that is automatically produced by <code>sphinx-quickstart</code>. Here it is:</p>
<pre><code>SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = myproj
SOURCEDIR = source
BUILDDIR = build
.PHONY: help Makefile
%: Makefile
@$(SP... | <p>The <code>.PHONY: foo</code> has the effect that <code>foo</code> is never to be considered up-to-date. (but see <a href="https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html" rel="noreferrer">https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html</a> for the more detailed explanation... | Default Makefile for Sphinx | makefile|python-sphinx | 7 | 3,403 | 1 | 44,086,670 | 44,086,670 | 6 | true | 2017-05-14T18:42:09.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Default Makefile for Sphinx<p>I'm trying to understand the Makefile that is automatically produced by <code>sphinx-quickstart</code>. Here it is:</p>
<pre><... |
44,272,446 | How to use an array as a variable in Postgres?<p>I have this .sql script:</p>
<pre><code>DO $$
DECLARE
user_list integer[] = (select user_id from user where state = 'ACTIVE');
BEGIN
CREATE CREATE MATERIALIZED VIEW accounts_with_active_users AS
select * from accounts where user_account IN (user_list);
... | <p>You're trying to assign a row set to an array. You can use <code>array_agg()</code> instead.</p>
<pre class="lang-sql prettyprint-override"><code>user_list integer[] = (select array_agg(user_id) from users where state = 'ACTIVE');
</code></pre>
<p>That being said this IMHO doesn't really help you with creating you... | How to use an array as a variable in Postgres? | postgresql|postgresql-9.6 | 8 | 17,998 | 1 | 44,272,722 | 44,272,722 | 7 | true | 2017-05-30T21:43:25.227Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use an array as a variable in Postgres?<p>I have this .sql script:</p>
<pre><code>DO $$
DECLARE
user_list integer[] = (select user_id from use... |
44,329,032 | How to send "back to normal" notifications in Jenkins Declarative Pipeline?<p>I'm trying to convert an existing Jenkins Pipeline to the new Declarative Pipeline and I was wondering how to handle correctly mail notifications ? </p>
<p>I'm currently using this code: </p>
<pre><code>node {
try {
...
cur... | <p>Problem is that in the post section of declarative the currentBuild.result is not set to SUCCESS. FAILURE and ABORTED is set though. So the behaviour here seems to be inconsistent at the moment.</p>
<p>I've improved my answer from <a href="https://stackoverflow.com/questions/44245002/how-to-get-same-mailer-behaviou... | How to send "back to normal" notifications in Jenkins Declarative Pipeline? | email|jenkins|jenkins-pipeline | 11 | 7,741 | 4 | 44,435,895 | 44,435,895 | 7 | true | 2017-06-02T12:30:59.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to send "back to normal" notifications in Jenkins Declarative Pipeline?<p>I'm trying to convert an existing Jenkins Pipeline to the new Declarative Pipel... |
44,025,992 | Serilog : how do you specify a filter expression in config file<p>I am trying to specify this filter in the appsettings .json file</p>
<pre><code>.Filter.ByExcluding(Matching.FromSource("Microsoft.AspNetCore.Hosting.Internal.WebHost"))
</code></pre>
<p>The above syntax works when specified in c#</p>
<p>But trying to... | <p>You need to use <a href="https://github.com/serilog/serilog-expressions" rel="nofollow noreferrer">Serilog.Expressions</a> for this:</p>
<pre><code>Install-Package Serilog.Expressions
</code></pre>
<p>The filter section in <em>appsettings.json</em> looks like:</p>
<pre><code>"Filter": [
{
"Name&... | Serilog : how do you specify a filter expression in config file | serilog | 8 | 5,701 | 3 | 44,035,241 | 44,035,241 | 8 | true | 2017-05-17T13:14:28.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Serilog : how do you specify a filter expression in config file<p>I am trying to specify this filter in the appsettings .json file</p>
<pre><code>.Filter.By... |
44,353,974 | Set up a link in slack reminder<p>Is there any way to set up a slack <code>/reminder</code> with a link in the text?</p>
<p><strong>Example:</strong></p>
<pre><code>/reminder me Hey! Check out the weather in https://www.yr.no/place/Norway/ every weekday
</code></pre>
<p>When I try to type this on Slack, I get the fo... | <p>yep, it is always nice to include links to Docs, Jira, etc. To include a link, use quotation marks when you describe what to remind.
e.g., /remind @Trump to "use Google Scholar when searching for scientific evidence <a href="https://scholar.google.com" rel="noreferrer">https://scholar.google.com</a>" every weekday... | Set up a link in slack reminder | slack | 8 | 5,892 | 3 | 44,382,489 | 44,382,489 | 8 | true | 2017-06-04T12:15:00.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set up a link in slack reminder<p>Is there any way to set up a slack <code>/reminder</code> with a link in the text?</p>
<p><strong>Example:</strong></p>
<... |
44,033,605 | why is metal shader gradient lighter as a SCNProgram applied to a SceneKit Node than it is as a MTKView?<p>I have a gradient, generated by a Metal fragment shader that I've applied to a SCNNode defined by a plane geometry.</p>
<p>It looks like this:</p>
<p><a href="https://i.stack.imgur.com/YfWam.png" rel="noreferrer... | <p>As explained in the <a href="https://developer.apple.com/videos/play/wwdc2016/609/" rel="noreferrer" title="Advances in SceneKit Rendering">Advances in SceneKit Rendering</a> session from WWDC 2016, SceneKit now defaults to rendering in linear space which is required to have accurate results from lighting equations.... | why is metal shader gradient lighter as a SCNProgram applied to a SceneKit Node than it is as a MTKView? | scenekit|metal | 7 | 1,588 | 3 | 44,045,637 | 44,045,637 | 9 | true | 2017-05-17T19:48:57.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
why is metal shader gradient lighter as a SCNProgram applied to a SceneKit Node than it is as a MTKView?<p>I have a gradient, generated by a Metal fragment s... |
43,958,616 | Laravel - Type error: Too few arguments?<p>I get an error:</p>
<blockquote>
<p>Type error: Too few arguments</p>
</blockquote>
<p>I thought Laravel do some magic to if arguments is not fully passed?</p>
<p>For example:</p>
<p>In the Controller I have:</p>
<pre><code>public function create(CreateRequest $request)... | <p>If you are calling createList() by yourself so you will need to pass both parameters by yourself. You can bind something with Plan but still if you will call something not Laravel, then you will be responsible to pass that function parameters.</p>
<p>This type hinting only works if Laravel is calling that function.... | Laravel - Type error: Too few arguments? | php|laravel|laravel-5|laravel-5.4 | 10 | 67,390 | 4 | 43,958,718 | 43,958,718 | 10 | true | 2017-05-13T22:36:26.160Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel - Type error: Too few arguments?<p>I get an error:</p>
<blockquote>
<p>Type error: Too few arguments</p>
</blockquote>
<p>I thought Laravel do so... |
44,163,624 | Why does Option<String>.as_ref() not deref to Option<&str>?<p>I expect the same result for both of these code samples:</p>
<pre><code>let maybe_string = Some(String::from("foo"));
let string = if let Some(ref value) = maybe_string { value } else { "none" };
</code></pre>
<pre><code>let maybe_string = Some(String::fro... | <p>Because that's how <a href="https://doc.rust-lang.org/std/option/enum.Option.html#method.as_ref" rel="noreferrer"><code>Option::as_ref</code></a> is defined:</p>
<pre><code>impl<T> Option<T> {
fn as_ref(&self) -> Option<&T>
}
</code></pre>
<p>Since you have an <code>Option<String&... | Why does Option<String>.as_ref() not deref to Option<&str>? | string|rust|option-type | 8 | 2,069 | 1 | 44,163,769 | 44,163,769 | 10 | true | 2017-05-24T16:13:30.690Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does Option<String>.as_ref() not deref to Option<&str>?<p>I expect the same result for both of these code samples:</p>
<pre><code>let maybe_string = Som... |
44,246,722 | Is there any way to create an alias of a specific FnMut?<p>I want to work with <code>FnMut(&[f32]) -> f32</code>,
to not copy/paste full signature, I want to introduce some kind of alias, but</p>
<pre><code>type Boo = FnMut(&[f32]) -> f32;
fn f<F: Boo>(mut f: F) {}
</code></pre>
<p>Causes a compi... | <p>Trait aliases are not currently part of the language. However, there is an <a href="https://github.com/rust-lang/rfcs/pull/1733" rel="noreferrer">accepted RFC</a> for exactly that. It's hard to predict exactly when it will be implemented, but accepting the RFC represents a commitment to implement it at some point in... | Is there any way to create an alias of a specific FnMut? | syntax|rust|traits|type-alias | 10 | 836 | 1 | 44,246,787 | 44,246,787 | 10 | true | 2017-05-29T16:14:06.067Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there any way to create an alias of a specific FnMut?<p>I want to work with <code>FnMut(&[f32]) -> f32</code>,
to not copy/paste full signature, I ... |
44,334,008 | How to dispatch a thunk from a saga?<p>I know I shouldn't be trying to dispatch thunks from sagas, it goes against what redux-saga tries to do. But I'm working in a fairly large app and most of the code is made with thunks, we are migrating by bits and need to dispatch a thunk from inside a saga. The thunk can't be cha... | <p>You're using <code>syncItems</code> wrong. The key is that the <em>function returned by <code>syncItems</code></em> needs to get passed to <code>dispatch</code>, not <code>syncItems</code> itself. The correct usage would be:</p>
<pre><code>yield put(syncItems());
</code></pre>
<p>I showed some visual comparisons... | How to dispatch a thunk from a saga? | javascript|reactjs|redux|redux-thunk|redux-saga | 9 | 3,119 | 3 | 44,336,940 | 44,336,940 | 10 | true | 2017-06-02T16:59:43.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to dispatch a thunk from a saga?<p>I know I shouldn't be trying to dispatch thunks from sagas, it goes against what redux-saga tries to do. But I'm worki... |
44,354,421 | How to embed Youtube live chat with url permanent?<p>The embed URL for a channel's live stream is:</p>
<pre><code>https://www.youtube.com/embed/live_stream?channel=CHANNEL_ID
</code></pre>
<p>and it works but if I want to embed near at it a YouTube live chat for current streaming the URL that I use for the embed is: ... | <p>You could get the video ID using PHP like this:</p>
<pre class="lang-php prettyprint-override"><code><?php
try {
$videoId = getLiveVideoID('CHANNEL_ID');
// Output the Chat URL
echo "The Chat URL is https://www.youtube.com/live_chat?v=".$videoId;
} catch(Exception $e) {
// Echo the generated er... | How to embed Youtube live chat with url permanent? | javascript|php|url|youtube|embed | 13 | 13,873 | 2 | 44,398,199 | 44,398,199 | 10 | true | 2017-06-04T13:07:25.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to embed Youtube live chat with url permanent?<p>The embed URL for a channel's live stream is:</p>
<pre><code>https://www.youtube.com/embed/live_stream?... |
44,058,972 | "projections are not allowed for immediate arguments of a supertype" Kotlin Android Studio<p>I am getting this error when I converted Java to Kotlin:</p>
<p>Java</p>
<pre><code>public class HeaderTab extends ExpandableGroup {
private String header;
public HeaderTab(String title, List items) {
super(t... | <p>Use <code>Any</code> for a quick fix, or introduce a type parameter to make sure you don't break the type safety of the library.</p>
<p><code>class HeaderTab(title: String, items: List<*>) : ExpandableGroup<Any>(title, items) {</code></p>
<p>or</p>
<p><code>class HeaderTab<E>(title: String, item... | "projections are not allowed for immediate arguments of a supertype" Kotlin Android Studio | java|android|android-studio|kotlin|kotlin-android-extensions | 8 | 5,399 | 1 | 44,059,381 | 44,059,381 | 11 | true | 2017-05-18T22:51:12.307Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
"projections are not allowed for immediate arguments of a supertype" Kotlin Android Studio<p>I am getting this error when I converted Java to Kotlin:</p>
<p... |
44,112,715 | Mocking a return value which is an object<p>I'd like to write some tests for the following code:</p>
<pre><code>def person_name_length(id):
person = get_person(id)
return len(person.first_name)
</code></pre>
<p>How can I mock out <code>get_person(id)</code> method so that it returns an object which has a valu... | <p>I think you should need to do something like this</p>
<pre><code>class MockPerson(object):
first_name = 'Bob'
@patch('get_person')
def test_person_name_length(self, get_person_mock):
get_person_mock.return_value = MockPerson()
self.assertEqual(person_name_length(1), 3)
</code></pre> | Mocking a return value which is an object | python|unit-testing|mocking|python-unittest | 11 | 6,727 | 2 | 44,112,876 | 44,112,876 | 11 | true | 2017-05-22T12:20:36.243Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mocking a return value which is an object<p>I'd like to write some tests for the following code:</p>
<pre><code>def person_name_length(id):
person = get... |
44,325,272 | Getting the id of a clicked element from rendered list<p>What is the best way to get an id from a clicked element of a list?
I am trying to render a list of items and then display an item detail view for the clicked item.</p>
<p>e.g</p>
<pre><code>render() {
let list = data.map((obj) => {
return &... | <p>You can get the <code>id</code> from the <code>click</code> event directly. No need to bind the variable to the event handler.</p>
<pre><code>render() {
let list = data.map((obj) => {
return <div key={obj[id]} id={obj[id]} onClick={this.handleClick}></div>
}
return <div... | Getting the id of a clicked element from rendered list | javascript|reactjs | 9 | 12,802 | 2 | 44,325,369 | 44,325,369 | 11 | true | 2017-06-02T09:21:20.220Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting the id of a clicked element from rendered list<p>What is the best way to get an id from a clicked element of a list?
I am trying to render a list of ... |
43,933,718 | Running Angular under Virtual Directory on IIS<p>This question is related to Angular2+ (not AngularJS)</p>
<p>We are trying to host our angular site under a virtual directory under a website on IIS.</p>
<p>We have a Website Called Development that points to: <code>C:\inetpub\wwwroot\Development.</code>
In this folder... | <p>The url change is handled by webpack. This is controlled by the --deploy-url.</p>
<p>Running the following fixes it:</p>
<pre><code>ng build --base-href "/Web" --deploy-url "/Web/"
</code></pre> | Running Angular under Virtual Directory on IIS | angular|iis|iis-8 | 8 | 5,418 | 1 | 43,936,513 | 43,936,513 | 12 | true | 2017-05-12T09:07:46.990Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Running Angular under Virtual Directory on IIS<p>This question is related to Angular2+ (not AngularJS)</p>
<p>We are trying to host our angular site under a... |
43,945,927 | Kafka consumer does not start from latest message<p>I want to have a Kafka Consumer which starts from the latest message in a topic.</p>
<p>Here is the java code:</p>
<pre><code>private static Properties properties = new Properties();
private static KafkaConsumer<String, String> consumer;
static
{
propertie... | <p>Have you run this same code before with the same <code>group.id</code>? The <code>auto.offset.reset</code> parameter is only used if there is not an existing offset already stored for your consumer. So if you've run the example previously, say two days ago, and then you run it again, it will start from the last cons... | Kafka consumer does not start from latest message | apache-kafka|kafka-consumer-api | 7 | 10,293 | 2 | 43,968,065 | 43,968,065 | 12 | true | 2017-05-12T20:22:44.917Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kafka consumer does not start from latest message<p>I want to have a Kafka Consumer which starts from the latest message in a topic.</p>
<p>Here is the java... |
43,989,891 | UIScrollView - Need Constraints for x position/width, Need Constraints for y position/height<p>I have a view hierarchy that looks like this (based on other answers and Apple's advanced AutoLayout guide for working with UIScrollView):</p>
<p><a href="https://i.stack.imgur.com/5zo30.png" rel="noreferrer"><img src="https... | <p>Scroll views can be a little tricky at first. You really have 3 parts:</p>
<ol>
<li>Actual frame of the scroll view</li>
<li>Actual frame of the subview(s) contained in the scroll view</li>
<li>The contentSize of the scroll view - that is, how far it should scroll in either direction</li>
</ol>
<p>So, 1. is pretty... | UIScrollView - Need Constraints for x position/width, Need Constraints for y position/height | ios|objective-c|uiscrollview|autolayout | 17 | 9,736 | 2 | 43,990,159 | 43,990,159 | 12 | true | 2017-05-15T22:41:53.730Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UIScrollView - Need Constraints for x position/width, Need Constraints for y position/height<p>I have a view hierarchy that looks like this (based on other a... |
44,051,666 | How can Mongoose "delete" non-existing documents?<p>Code:</p>
<pre><code>function deleteItem(req, res) {
Goods.findByIdAndRemove(req.params.id, (err) => {
if (err) {
res.send({
success: false,
error: err
});
} else {
res.send({
success: true,
item: req.p... | <p>If you check the related Mongoose documentation you will find the reason behind it:</p>
<blockquote>
<p>Finds a matching document, removes it, passing the found document (if any) to the callback.
<a href="http://mongoosejs.com/docs/api.html#model_Model.findByIdAndRemove" rel="noreferrer">http://mongoosejs.com/d... | How can Mongoose "delete" non-existing documents? | javascript|node.js|mongodb|mongoose | 9 | 2,380 | 1 | 44,051,977 | 44,051,977 | 12 | true | 2017-05-18T15:14:24.773Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can Mongoose "delete" non-existing documents?<p>Code:</p>
<pre><code>function deleteItem(req, res) {
Goods.findByIdAndRemove(req.params.id, (err) =&... |
44,101,690 | Python3 ImportError: No module named '_tkinter'<p>On my Linux Mint 18, I've tried to install Python 3.6.1 beside my 3.5.2.
With these commands:</p>
<pre><code>wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
tar xJf Python-3.6.1.tar.xz
cd Python-3.6.1
./configure
make
make install
</code></pre>
<... | <p>I think you still need to install the tkinker package. You can do this by simply typing:</p>
<pre><code>sudo apt-get install python3-tk
</code></pre> | Python3 ImportError: No module named '_tkinter' | python|python-3.x|tkinter | 9 | 12,106 | 3 | 44,105,710 | 44,105,710 | 12 | true | 2017-05-21T20:53:52.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python3 ImportError: No module named '_tkinter'<p>On my Linux Mint 18, I've tried to install Python 3.6.1 beside my 3.5.2.
With these commands:</p>
<pre><c... |
44,347,683 | How to set parameters to score function in sklearn SelectKBest ()<p>I'm using the <code>SelectKBest()</code> class for feature selection in sklearn. <code>SelectKBest()</code> can take a callable score function as an input. In this case I would like to use <code>mutual_info_regression</code> as the score function. <cod... | <p>You can create another function which calls mutual_info_regression and pass it instead:</p>
<pre><code>def my_score(X, y):
return mutual_info_regression(X, y, random_state=0)
SelectKBest(score_func=my_score)
</code></pre>
<p>Python standard library provides an useful helper for creating such functions - it is... | How to set parameters to score function in sklearn SelectKBest () | python|class|machine-learning|syntax|scikit-learn | 7 | 3,149 | 1 | 44,349,144 | 44,349,144 | 12 | true | 2017-06-03T19:13:38.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set parameters to score function in sklearn SelectKBest ()<p>I'm using the <code>SelectKBest()</code> class for feature selection in sklearn. <code>Se... |
43,974,448 | BigQuery User Defined Aggregation Function?<p>I know I can define a <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/user-defined-functions" rel="noreferrer">User Defined Function</a> in order to perform some custom calculation. I also know I can use the 'out-of-the-box' <a href="https://cloud.goo... | <p>Turns out that this IS possible (as long as the groups we seek to aggregate are of a reasonable size in memory) with a little bit of 'glue' - namely the <code>ARRAY_AGG</code> function</p>
<p>The steps are as follows:</p>
<ol>
<li>Create a UDF with an input parameter of type <code>ARRAY<T></code> where <cod... | BigQuery User Defined Aggregation Function? | google-bigquery|aggregate-functions|udf | 10 | 3,345 | 1 | 43,979,566 | 43,979,566 | 13 | true | 2017-05-15T08:15:29.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
BigQuery User Defined Aggregation Function?<p>I know I can define a <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/user-defined-funct... |
44,090,217 | Thymeleaf : passing javascript parameters<p>I have a basic SpringBoot app. using Spring Initializer, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file.
I want to pass an attribute of a POJO to a javascript function:</p>
<pre><code> <tr th:each="company: ${companies}" > ... | <p>The problem came from anchor, so please try this one if the <code>confirmDelete()</code> function require a string id</p>
<pre><code>th:onclick="'javascript:confirmDelete(\'' + ${company.id} + '\');'"
</code></pre>
<p>And if it need a number id</p>
<pre><code>th:onclick="'javascript:confirmDelete(' + ${company.id... | Thymeleaf : passing javascript parameters | spring-boot|thymeleaf | 11 | 18,474 | 4 | 44,090,684 | 44,090,684 | 13 | true | 2017-05-20T19:51:39.463Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Thymeleaf : passing javascript parameters<p>I have a basic SpringBoot app. using Spring Initializer, embedded Tomcat, Thymeleaf template engine, and package ... |
44,197,704 | Passing parameters to Docker container<p>I create a container docker. Which should give the following:</p>
<pre><code>docker run --rm container1
> Hello World!
docker run --rm container1 Bob
> Hello Bob!
</code></pre>
<p>My Dockerfile:</p>
<pre><code>FROM ubuntu:14.04
ENTRYPOINT ["/bin/echo", "Hello"]
CMD ["W... | <p>Your problem might be coming from an underlaying incomprehension of string concatenation done by your Ubuntu shell</p>
<pre><code>$ echo "Hello" "I" "am" "a" "developer"
Hello I am a developer
</code></pre>
<p>This works because the shell does not have a concatenatio... | Passing parameters to Docker container | docker | 11 | 33,841 | 3 | 44,201,230 | 44,201,230 | 13 | true | 2017-05-26T09:05:53.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing parameters to Docker container<p>I create a container docker. Which should give the following:</p>
<pre><code>docker run --rm container1
> Hello ... |
44,206,266 | Is there a difference between Request.ServerVariables["HTTP_X_FORWARDED_FOR"] and Request.Headers["X-Forwarded-For"]?<p>In ASP.NET, is there a difference between these?</p>
<ol>
<li><code>HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]</code> </li>
<li><code>HttpContext.Current.Request.Headers["X-F... | <p>There is no difference between <code>Request.ServerVariables["HTTP_X_FORWARDED_FOR"]</code> and <code>Request.Headers["X-Forwarded-For"]</code>.</p>
<p>The documentation for the <a href="https://msdn.microsoft.com/en-us/library/ms524602.aspx" rel="noreferrer">IIS Server Variables</a> starting with "HTTP_" says: "Th... | Is there a difference between Request.ServerVariables["HTTP_X_FORWARDED_FOR"] and Request.Headers["X-Forwarded-For"]? | asp.net | 8 | 3,099 | 1 | 44,213,443 | 44,213,443 | 13 | true | 2017-05-26T16:32:47.423Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a difference between Request.ServerVariables["HTTP_X_FORWARDED_FOR"] and Request.Headers["X-Forwarded-For"]?<p>In ASP.NET, is there a difference bet... |
44,265,975 | Remove Last Number of a Integer<p>I have searched for a few answers and none of them seems to work.</p>
<p>Below is an example but the code does not work and gives errors. I am using Python 2.7.</p>
<pre><code>operationTwo = 91239
operationTwo = operationTwo[:-1]
print(operationTwo)
</code></pre> | <p>The code you found which is <code>slicing</code>, works but not on <code>integers</code>. If you want to use it you can convert the number to <code>str</code> for slicing then convert it back to <code>int</code>. It is not the best practice but it can be done as the following:</p>
<pre><code>operationTwo = 91239
op... | Remove Last Number of a Integer | python | 9 | 28,741 | 2 | 44,266,096 | 44,266,096 | 13 | true | 2017-05-30T15:14:11.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove Last Number of a Integer<p>I have searched for a few answers and none of them seems to work.</p>
<p>Below is an example but the code does not work an... |
44,348,807 | How to exclude (ignore) certain folders in vagrant rsync?<p>I wish to run npm install in my vagrant virtual box.</p>
<p>But whenever I ran the npm install command, my rsync will execute. Since my host computer does not have node_modules installed, it simply remove the folder completely for me.</p>
<p>What do I need t... | <p><code>rsync__exclude</code> as well as <code>rsync__auto</code> takes 2 <code>_</code></p>
<p>You need to rewrite your line as </p>
<pre><code>config.vm.synced_folder "./", "/home/vagrant/app", type: "rsync", rsync__auto: true, rsync__exclude: ['./node_modules*']
</code></pre> | How to exclude (ignore) certain folders in vagrant rsync? | vagrant|rsync | 7 | 6,172 | 2 | 44,352,166 | 44,352,166 | 13 | true | 2017-06-03T21:42:23.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to exclude (ignore) certain folders in vagrant rsync?<p>I wish to run npm install in my vagrant virtual box.</p>
<p>But whenever I ran the npm install c... |
43,951,945 | MongoDb $addFields inside arrays that $multiply two values within the array<p>MongoDb version 3.4.4</p>
<p>How to aggregate a new key 'total', whose value is the product of 'course' and 'quantity' for each object inside array snapshot.</p>
<p><strong>Sample document:</strong></p>
<pre><code>{
cur: "EUR",
sna... | <p>Modify your second attempt using the <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/map/" rel="noreferrer"><code>$map</code> operator</a> to map the whole snapshot embedded document with its fields as</p>
<pre><code>db.mycoll.aggregate([
{
"$addFields": {
"snapshot":... | MongoDb $addFields inside arrays that $multiply two values within the array | mongodb|aggregation-framework | 8 | 7,995 | 1 | 43,952,287 | 43,952,287 | 14 | true | 2017-05-13T10:20:18.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MongoDb $addFields inside arrays that $multiply two values within the array<p>MongoDb version 3.4.4</p>
<p>How to aggregate a new key 'total', whose value i... |
44,123,874 | 'DataFrame' object has no attribute 'sort'<p>I face some problem here, in my python package I have install <code>numpy</code>, but I still have this error:</p>
<blockquote>
<p><strong>'DataFrame' object has no attribute 'sort'</strong></p>
</blockquote>
<p>Anyone can give me some idea..</p>
<p>This is my code :</p>
<pr... | <p><code>sort()</code> was deprecated for DataFrames in favor of either:</p>
<ul>
<li><a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.sort_values.html" rel="noreferrer"><code>sort_values()</code></a> to <strong>sort by column(s)</strong></li>
<li><a href="http://pandas.pydata.org/pa... | 'DataFrame' object has no attribute 'sort' | python|pandas|numpy|dataframe | 130 | 186,411 | 2 | 44,123,892 | 44,123,892 | 270 | true | 2017-05-23T00:14:45.457Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
'DataFrame' object has no attribute 'sort'<p>I face some problem here, in my python package I have install <code>numpy</code>, but I still have this error:</... |
43,947,307 | Change name of file created by migration<p>Its possible to change a name o file create by migration? like this `18b6422c9d3f i prefer organize usign date-time like 201705121927</p>
<p>its possible change configs of alembic to do that?</p> | <p>You need to edit <code>alembic.ini</code>. </p>
<p>Parameter that you looking for is <code>file_template</code>.</p>
<p>From <a href="http://alembic.zzzcomputing.com/en/latest/tutorial.html?highlight=file_template#editing-the-ini-file" rel="noreferrer">docs</a>:</p>
<blockquote>
<p><code>file_template</code> - ... | Change name of file created by migration | python|alembic | 11 | 1,581 | 1 | 43,947,666 | 43,947,666 | 15 | true | 2017-05-12T22:29:16.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change name of file created by migration<p>Its possible to change a name o file create by migration? like this `18b6422c9d3f i prefer organize usign date-tim... |
44,009,145 | get response from InvokeHTTP POST<p>New to NiFi!</p>
<p>I'm using InvokeHTTP nifi processor (using this link as an example to implement my flow <a href="http://www.tomaszezula.com/2016/10/30/nifi-and-http-post-configuration/" rel="noreferrer">http://www.tomaszezula.com/2016/10/30/nifi-and-http-post-configuration/</a>)... | <p>Apache NiFi's <a href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.2.0/org.apache.nifi.processors.standard.InvokeHTTP/index.html" rel="noreferrer">InvokeHTTP</a> processor sends the response content to a separate relationship from the original flowfile. You will want to sep... | get response from InvokeHTTP POST | apache-nifi | 10 | 8,475 | 1 | 44,010,742 | 44,010,742 | 15 | true | 2017-05-16T18:36:54.130Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
get response from InvokeHTTP POST<p>New to NiFi!</p>
<p>I'm using InvokeHTTP nifi processor (using this link as an example to implement my flow <a href="htt... |
44,137,481 | prevent NodeJS program from exiting<p>I am creating NodeJS based crawler, which is working with <code>node-cron</code> package and I need to prevent entry script from exiting since application should run forever as cron and will execute crawlers at certain periods with logs.</p>
<p>In the web application, server will ... | <p>Because nodejs is single thread a <code>while(true)</code> will not work. It will just grab the whole CPU and nothing else can ever run.</p>
<p>nodejs will stay running when anything is alive that could run in the future. This includes open TCP sockets, listening servers, timers, etc...</p>
<p>To answer more spe... | prevent NodeJS program from exiting | node.js|cron|web-crawler|exit|serverless-architecture | 13 | 16,707 | 3 | 44,139,602 | 44,139,602 | 15 | true | 2017-05-23T14:22:25.137Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
prevent NodeJS program from exiting<p>I am creating NodeJS based crawler, which is working with <code>node-cron</code> package and I need to prevent entry sc... |
44,292,220 | In Unity, what is the difference between the 2 ways to register a singleton instance?<p>In Unity, as I know I can use the following 2 options to register a singleton instance:</p>
<pre><code> IConfiguration globalConfig = new Configuration();
container.RegisterInstance<IConfiguration>(globalConfig... | <p>The first way registers an instance. You have to create the instance of the object when you do it.</p>
<p>The second way is not a singleton. It's a "singleton for any resolution by the container or any of it's child containers". The first time it would ever be resolve would "fix the state" of the object and registe... | In Unity, what is the difference between the 2 ways to register a singleton instance? | c#|singleton|unity-container | 10 | 8,477 | 2 | 44,293,106 | 44,293,106 | 15 | true | 2017-05-31T18:28:17.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In Unity, what is the difference between the 2 ways to register a singleton instance?<p>In Unity, as I know I can use the following 2 options to register a s... |
44,338,204 | OAuth2 - Authorize with no user interaction<p>So I'm trying to access my own data from an external app via their API. <em>I only need access to my own data</em>. Not trying to receive data from any of my users' accounts, so they don't need to authorize anything. So obviously I need to avoid any redirects (which seems t... | <p>The oauth2 grant you are describing is called <a href="https://www.rfc-editor.org/rfc/rfc6749#section-4.1" rel="nofollow noreferrer"><code>Authorization Code Grant</code></a>. This way of authentication has been designed so that applications which want to access resources of a user do <strong>not</strong> have acces... | OAuth2 - Authorize with no user interaction | http|oauth|oauth-2.0|authorization | 13 | 16,427 | 2 | 44,354,417 | 44,354,417 | 15 | true | 2017-06-02T22:21:00.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
OAuth2 - Authorize with no user interaction<p>So I'm trying to access my own data from an external app via their API. <em>I only need access to my own data</... |
44,064,299 | How can I concatenate Pandas DataFrames by column and index?<p>I've got four Pandas DataFrames with numerical columns and indices:</p>
<pre><code>A = pd.DataFrame(data={"435000": [9.792, 9.795], "435002": [9.825, 9.812]}, index=[119000, 119002])
B = pd.DataFrame(data={"435004": [9.805, 9.783], "435006": [9.785, 9.78]}... | <p>You need concat in pairs:</p>
<pre><code>result = pd.concat([pd.concat([A, C], axis=0), pd.concat([B, D], axis=0)], axis=1)
print (result)
435000 435002 435004 435006
119000 9.792 9.825 9.805 9.785
119002 9.795 9.812 9.783 9.780
119004 9.778 9.750 9.743 9.762
119006 9.743 9.74... | How can I concatenate Pandas DataFrames by column and index? | python|pandas | 15 | 16,154 | 2 | 44,064,351 | 44,064,351 | 16 | true | 2017-05-19T07:44:25.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I concatenate Pandas DataFrames by column and index?<p>I've got four Pandas DataFrames with numerical columns and indices:</p>
<pre><code>A = pd.Dat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.