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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
53,696,875 | Get last message sent to channel<p>I already have a variable containing a specific channel, but how can I obtain the last message sent to the channel? I want to make my bot only perform an action if the last message to the channel wasn't by it.</p> | <p>If you already have the specific channel stored in a variable, it's quite easy. You can call the <code>MessageManager#fetch()</code> method on that specific channel and get the latest message.</p>
<p>Example:</p>
<pre><code>let channel // <-- your pre-filled channel variable
channel.messages.fetch({ limit: 1 }).... | Get last message sent to channel | node.js|discord.js | 11 | 31,008 | 3 | 53,705,574 | 53,705,574 | 15 | true | 2018-12-09T21:30:47.190Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get last message sent to channel<p>I already have a variable containing a specific channel, but how can I obtain the last message sent to the channel? I want... |
53,771,028 | How "d3.translateExtent" coordinate works?<p><strong><a href="https://jsfiddle.net/sarathsaleem/76t03kbu/" rel="noreferrer">jsfiddle DEMO</a></strong> </p>
<p>I am trying to add a drag to the circle and trying to apply a translateExtent. So how to restrict the drag boundary to the rectangle .?</p>
<pre><code>var heig... | <p>There are a few considerations here, and given I've certainly been tripped up by them in the past, I hope I can explain them clearly here. </p>
<p><strong>Zoom Extent</strong></p>
<p>Let's look at zoom extent (<code>zoom.extent</code>) - not translate extent. The default extent is "<code>[[0, 0], [width, height]]<... | How "d3.translateExtent" coordinate works? | javascript|d3.js|zooming | 9 | 5,444 | 1 | 53,784,776 | 53,784,776 | 15 | true | 2018-12-13T22:34:21.880Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How "d3.translateExtent" coordinate works?<p><strong><a href="https://jsfiddle.net/sarathsaleem/76t03kbu/" rel="noreferrer">jsfiddle DEMO</a></strong> </p>
... |
53,507,352 | Replace service with mocked using WebApplicationFactory<p>I'm trying to replace an implementation of <code>IMessageFormatter</code> with a <code>MockMessageFormatter</code> for a test.</p>
<pre class="lang-cs prettyprint-override"><code>public class MyMockingWebApplicationFactory<TStartUp> : WebApplicationFactor... | <p>replace your code :</p>
<pre><code>builder.ConfigureServices(services => { services.AddTransient<IMessageFormatter, MockMessageFormatter>(); });
</code></pre>
<p>to:</p>
<pre><code>builder.ConfigureTestServices(services =>
{
var serviceProvider = services.BuildServiceProvider();
... | Replace service with mocked using WebApplicationFactory | .net|razor|asp.net-core | 11 | 4,134 | 2 | 53,736,814 | 53,736,814 | 16 | true | 2018-11-27T20:08:07.443Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replace service with mocked using WebApplicationFactory<p>I'm trying to replace an implementation of <code>IMessageFormatter</code> with a <code>MockMessageF... |
53,687,162 | How to inject JavaScript callback to detect onclick event, using iOS WKWebView?<p>I'm using a <code>WKWebView</code> to show a website which has some HTML that includes three buttons. I want to run some Swift code in the native app when a specific button is clicked.</p>
<h2>About the HTML</h2>
<p>The three buttons lo... | <p>User Scripts are JS that you inject into your web page at either the start of the document load or after the document is done loading. User scripts are extremely powerful because they allow client-side customization of web page, allow injection of event listeners and can even be used to inject scripts that can in tu... | How to inject JavaScript callback to detect onclick event, using iOS WKWebView? | javascript|ios|swift|wkwebview | 20 | 16,683 | 4 | 53,755,764 | 53,755,764 | 16 | true | 2018-12-08T21:30:51.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to inject JavaScript callback to detect onclick event, using iOS WKWebView?<p>I'm using a <code>WKWebView</code> to show a website which has some HTML th... |
53,548,964 | How to use approxQuantile by group?<p>Spark has SQL function <code>percentile_approx()</code>, and its Scala counterpart is <code>df.stat.approxQuantile()</code>. </p>
<p>However, the Scala counterpart cannot be used on grouped datasets, something like <code>df.groupby("foo").stat.approxQuantile()</code>, as answered ... | <p><strong>Spark >= 3.1</strong></p>
<p>Corresponding SQL functions have been added in Spark 3.1 - see <a href="https://issues.apache.org/jira/browse/SPARK-30569" rel="noreferrer">SPARK-30569</a>.</p>
<p><strong>Spark < 3.1</strong></p>
<p>While you cannot use <code>approxQuantile</code> in an UDF, and you there ... | How to use approxQuantile by group? | apache-spark|apache-spark-sql|apache-spark-dataset | 8 | 9,789 | 1 | 53,549,914 | 53,549,914 | 17 | true | 2018-11-29T23:11:53.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use approxQuantile by group?<p>Spark has SQL function <code>percentile_approx()</code>, and its Scala counterpart is <code>df.stat.approxQuantile()</c... |
53,637,368 | Running a python script and changing git branch<p>I am trying to find ways to make better use of my time while programming.</p>
<p>I have a python script that does some heavy work (it can take hours) to finish. Now, most of the work it does is network related, so i have plenty of cpu resources to spare. </p>
<p>If th... | <p>In general, if you have a single Python file which you run as a script, you're fine. When you run the file, it is compiled into bytecode which is then executed. You can change the original script at this point and nothing breaks.</p>
<p>However, we can <em>deliberately</em> break it by writing some horrible but leg... | Running a python script and changing git branch | python|git|branch|git-branch | 10 | 3,888 | 3 | 53,637,631 | 53,637,631 | 17 | true | 2018-12-05T17:06:40.323Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Running a python script and changing git branch<p>I am trying to find ways to make better use of my time while programming.</p>
<p>I have a python script th... |
53,725,741 | Ruby: Syntax for defining a constant inside a Struct<p>Consider the following (correct) Ruby program:</p>
<pre><code>class Outer
Inner = Struct.new(:dummy) do
CONST = 'abce'
def fun
puts(dummy)
end
end
end
obj = Outer::Inner.new(15)
obj.fun
puts(Outer::CONST)
</code></pre>
<p>Why do I have to... | <p>This happens because the constant is defined in the current <em>namespace</em>. The <code>class</code> and <code>module</code> keywords define namespaces, but <code>Struct.new</code> (just like <code>Class.new</code>) does not.</p>
<p>In order to define the constant under the Struct's scope, you have to use <code>s... | Ruby: Syntax for defining a constant inside a Struct | ruby | 7 | 1,316 | 2 | 53,727,917 | 53,727,917 | 18 | true | 2018-12-11T14:01:34.487Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ruby: Syntax for defining a constant inside a Struct<p>Consider the following (correct) Ruby program:</p>
<pre><code>class Outer
Inner = Struct.new(:dumm... |
53,575,855 | How to find list of ODBC drivers installed on Linux<p>Good day all.</p>
<p>On Windows, the list of installed ODBC drivers located here:
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers</p>
<p>On macOS, the list of installed ODBC drivers located here:
/Library/ODBC/odbcinst.ini and /Users/{userName}/ODBC/odb... | <p>Thanks for the answers but I found out that list of installed ODBC drivers on Linux can be found on</p>
<p>/etc/odbcinst.ini and /home/{userName}/.odbcinst.ini which is very similar to macOS</p> | How to find list of ODBC drivers installed on Linux | linux|odbc | 12 | 37,410 | 4 | 53,591,242 | 53,591,242 | 19 | true | 2018-12-01T23:08:03.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to find list of ODBC drivers installed on Linux<p>Good day all.</p>
<p>On Windows, the list of installed ODBC drivers located here:
HKEY_LOCAL_MACHINE\S... |
53,693,889 | What is legacy-stash?<p>Today I ran git stash -h on my Windows box to get this response:</p>
<pre><code>usage: git legacy-stash list [<options>]
or: git legacy-stash show [<stash>]
or: git legacy-stash drop [-q|--quiet] [<stash>]
or: git legacy-stash ( pop | apply ) [--index] [-q|--quiet] [&... | <p>There is ongoing work to port the <code>git stash</code> and <code>git rebase</code> programs to be built-ins written in C. They are faster on all systems, but this work is especially valuable for Windows because the programs written in shell are much slower there than on Unix. However, we're still finding a small n... | What is legacy-stash? | windows|git|git-stash | 12 | 1,302 | 1 | 53,694,333 | 53,694,333 | 19 | true | 2018-12-09T15:37:18.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is legacy-stash?<p>Today I ran git stash -h on my Windows box to get this response:</p>
<pre><code>usage: git legacy-stash list [<options>]
or... |
53,753,417 | Node.js Semicolon Use<p>Why is it that in node.js, some things do not need / generally do not use semicolons? For example this code runs just fine with no semicolons =></p>
<pre><code>var server = app.listen(3000, function() {
var host = server.address().address
var port = server.address().port
console.log... | <p>Because NodeJS runs on the Chrome's V8 JavaScript engine. It's basically JavaScript that runs on the server and in JavaScript there is this thing called <em>Automatic Semicolon Insertion</em>.</p>
<p>That V8 engine that parses the JavaScript will follow certain rules (according to ECMAScript specs) and insert the ... | Node.js Semicolon Use | node.js | 14 | 12,083 | 3 | 53,753,441 | 53,753,441 | 20 | true | 2018-12-13T00:35:44.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Node.js Semicolon Use<p>Why is it that in node.js, some things do not need / generally do not use semicolons? For example this code runs just fine with no se... |
53,408,781 | System.Net.Http.HttpClient Disable Caching (.Net Standart Project)<p>In my .NET Standard project I'm using <code>System.Net.Http.HttpClient</code>. How can I disable all caching (request caching especially) in <code>HttpClient</code>?</p>
<p>If server sends responses with no cache header problem solves. But I want to m... | <p>You can use CacheControlHeaderValue in HttpClient</p>
<pre><code>using System.Net.Http.Headers;
httpClient.DefaultRequestHeaders.CacheControl = new CacheControlHeaderValue
{
NoCache = true
}
</code></pre>
<p>For more information you can look
<a href="https://docs.microsoft.com/en-us/dotnet/api/system.net.http.hea... | System.Net.Http.HttpClient Disable Caching (.Net Standart Project) | c#|httpclient|http-caching | 10 | 10,277 | 2 | 53,858,507 | 53,858,507 | 26 | true | 2018-11-21T09:21:34.250Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
System.Net.Http.HttpClient Disable Caching (.Net Standart Project)<p>In my .NET Standard project I'm using <code>System.Net.Http.HttpClient</code>. How can I... |
53,527,850 | How to mask a list using boolean values from another list<p>I have a list like this:</p>
<pre><code>x = [True, False, True, False]
</code></pre>
<p>and a list like this:</p>
<pre><code>y = [a, b, c, d]
</code></pre>
<p>I would like to mask <code>x</code> over <code>y</code> to get this output:</p>
<pre><code>outpu... | <p>You can use <code>zip</code> and a list comprehension to perform a filter operation on <code>y</code> based on corresponding truth values in <code>x</code>:</p>
<pre><code>x = [True, False, True, False]
y = ["a", "b", "c", "d"]
print([b for a, b in zip(x, y) if a])
</code></p... | How to mask a list using boolean values from another list | python|list | 15 | 12,296 | 4 | 53,527,895 | 53,527,895 | 27 | true | 2018-11-28T20:47:22.193Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to mask a list using boolean values from another list<p>I have a list like this:</p>
<pre><code>x = [True, False, True, False]
</code></pre>
<p>and a l... |
53,553,523 | TypeORM subqueries<p>Based on typeORM <a href="http://typeorm.io/#/select-query-builder/using-subqueries" rel="noreferrer">docs</a> on using subqueries, there are explained how to create subqueries.
Example:</p>
<pre><code>const qb = await getRepository(Post).createQueryBuilder("post");
const posts = qb
.where("po... | <p>I hope this answer could help others to use TypeORM subquery.</p>
<pre><code>const subquery = await getManager()
.createQueryBuilder(table4, 't4')
.select('"t4".f')
.addSelect('"t4".g')
.addSelect('"t5".e')
.addSelect('"t6".h')
.innerJoin(table5, 't5', ... | TypeORM subqueries | sql|oracle|typeorm|typeorm-datamapper | 16 | 44,562 | 1 | 53,556,477 | 53,556,477 | 27 | true | 2018-11-30T08:03:59.260Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeORM subqueries<p>Based on typeORM <a href="http://typeorm.io/#/select-query-builder/using-subqueries" rel="noreferrer">docs</a> on using subqueries, ther... |
53,567,903 | Postgres cast to UUID from JSON<p>I have two very simple tables <code>sessions</code> which has a <code>json</code> column like this:</p>
<pre><code>+----+-------------------------------------------------------+
| id | data |
+----+--------------------------------------... | <p>The issue is that the -> operator returns JSON, which is why you get a string back with quotes as part of the string instead of the string you'd expect. See details in <a href="https://www.postgresql.org/docs/9.5/functions-json.html" rel="noreferrer">https://www.postgresql.org/docs/9.5/functions-json.html</a> .</p>
... | Postgres cast to UUID from JSON | postgresql | 15 | 24,594 | 1 | 53,568,037 | 53,568,037 | 35 | true | 2018-12-01T05:01:46.320Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Postgres cast to UUID from JSON<p>I have two very simple tables <code>sessions</code> which has a <code>json</code> column like this:</p>
<pre><code>+----+-... |
53,524,495 | Angular table index is undefined with multiTemplateDataRows directive<p>I'm having trouble getting my table indexes to show up. Here's an example table:</p>
<pre class="lang-html prettyprint-override"><code><mat-table [dataSource]="dataSource" multiTemplateDataRows>
<!--Column definitions-->
... | <p><code>multiTemplateDataRows</code> have a different variable to hold the row's index called <code>dataIndex</code>. Access the row's index using <code>let k = dataIndex</code>.</p>
<pre class="lang-html prettyprint-override"><code><!-- Row content-->
<mat-row
*matRowDef="let row; columns: displayedColu... | Angular table index is undefined with multiTemplateDataRows directive | angular|indexing|row|mat-table | 18 | 7,705 | 3 | 53,524,496 | 53,524,496 | 47 | true | 2018-11-28T16:57:12.480Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular table index is undefined with multiTemplateDataRows directive<p>I'm having trouble getting my table indexes to show up. Here's an example table:</p>
... |
53,580,507 | Disable / Enable Button in TKinter<p>I'm trying to make a button like a switch, so if I click the disable button
it will disable the "Button" (that works). And if I press it again, it will enable it again.</p>
<p>I tried things like if, else but didn't get it to work.
Here's an example:</p>
<pre><code>from tkinter im... | <p>A Tkinter <code>Button</code> has three states : <strong><code>active, normal, disabled</code></strong>.</p>
<p>You set the <code>state</code> option to <code>disabled</code> to gray out the button and make it unresponsive. It has the value <code>active</code> when the mouse is over it and the default is <code>norm... | Disable / Enable Button in TKinter | python|tkinter | 27 | 95,819 | 2 | 53,580,593 | 53,580,593 | 48 | true | 2018-12-02T13:05:59.300Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Disable / Enable Button in TKinter<p>I'm trying to make a button like a switch, so if I click the disable button
it will disable the "Button" (that works). A... |
53,667,793 | What Are controllers in flutter?<p>I'm bit confused. Most of the widgets don't have a controller. Few have one ( camera, textfield ...) </p>
<p>What is the purpose of using a respective controller? why do we use it?</p> | <p>In flutter, controllers are a means to give control to the parent widget over its child state. </p>
<p>The main selling point of controllers is that they remove the need of a <code>GlobalKey</code> to access the widget State. This, in turn, makes it harder to do anti-pattern stuff and increase performances.</p>
<p... | What Are controllers in flutter? | flutter | 39 | 23,363 | 3 | 53,668,245 | 53,668,245 | 51 | true | 2018-12-07T10:37:06.177Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What Are controllers in flutter?<p>I'm bit confused. Most of the widgets don't have a controller. Few have one ( camera, textfield ...) </p>
<p>What is the... |
53,678,664 | Flutter Container: cannot provide both a color and a decoration<p>I want to draw a border around my container and have the background be colored.</p>
<pre><code>Widget bodyWidget() {
return Container(
color: Colors.yellow,
decoration: BoxDecoration(
border: Border.all(color: Colors.black),
),
c... | <p>Remove the <code>color</code> parameter from the Container and add it to the BoxDecoration:</p>
<pre><code>Widget bodyWidget() {
return Container(
decoration: BoxDecoration(
color: Colors.yellow,
border: Border.all(color: Colors.black),
),
child: Text("Flutter"),
);
}
</code></pre>
<p><... | Flutter Container: cannot provide both a color and a decoration | flutter|dart|background-color|flutter-container|decoration | 29 | 21,036 | 1 | 53,678,665 | 53,678,665 | 56 | true | 2018-12-08T01:18:51.043Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter Container: cannot provide both a color and a decoration<p>I want to draw a border around my container and have the background be colored.</p>
<pre><... |
53,606,878 | AndroidX package android.support.design.R does not exist<p>When I convert my Project to AndroidX I run into </p>
<pre><code>error: package android.support.design.R does not exist
android.support.design.R.styleable.FloatingActionButton_Behavior_Layout);
</code></pre>
<p>any clue how to solve it ?<... | <p>I found the solution, simply replace this line</p>
<pre><code>android.support.design.R.
</code></pre>
<p>with</p>
<pre><code>com.google.android.material.R.
</code></pre> | AndroidX package android.support.design.R does not exist | android|androidx | 24 | 8,205 | 3 | 53,606,903 | 53,606,903 | 74 | true | 2018-12-04T06:26:06.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AndroidX package android.support.design.R does not exist<p>When I convert my Project to AndroidX I run into </p>
<pre><code>error: package android.support.d... |
53,723,928 | AttributeError: 'Series' object has no attribute 'reshape'<p>I'm using sci-kit learn linear regression algorithm.
While scaling Y target feature with:</p>
<pre><code>Ys = scaler.fit_transform(Y)
</code></pre>
<p>I got</p>
<blockquote>
<p>ValueError: Expected 2D array, got 1D array instead:</p>
</blockquote>
<p>A... | <p>Solution was linked on reshaped method on <a href="https://pandas.pydata.org/pandas-docs/version/0.22/generated/pandas.Series.reshape.html#pandas.Series.reshape" rel="noreferrer">documentation page</a>.</p>
<p>Insted of <code>Y.reshape(-1,1)</code> you need to use:</p>
<pre><code>Y.values.reshape(-1,1)
</code></pr... | AttributeError: 'Series' object has no attribute 'reshape' | python|python-3.x|pandas|reshape|attributeerror | 70 | 146,703 | 4 | 53,723,929 | 53,723,929 | 137 | true | 2018-12-11T12:10:17.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AttributeError: 'Series' object has no attribute 'reshape'<p>I'm using sci-kit learn linear regression algorithm.
While scaling Y target feature with:</p>
... |
53,716,571 | How to align single widgets in Flutter?<p>I want to align a Flutter widget within its parent. I know that I can center a widget by wrapping it in a Center widget.</p>
<pre><code> Center(
child: Text("widget"),
)
</code></pre>
<p>But how do I align it to the right, bottom, top middle, etc? </p>
<p><strong>Note... | <h1>How to align widgets</h1>
<p>To align a child widget within its parent you use the <a href="https://docs.flutter.io/flutter/widgets/Align-class.html" rel="noreferrer"><code>Align</code></a> widget. If you know how to use the <code>Center</code> widget then you are the right track because <code>Center</code> is jus... | How to align single widgets in Flutter? | flutter|dart|alignment|text-align | 95 | 103,208 | 3 | 53,716,572 | 53,716,572 | 191 | true | 2018-12-11T02:38:18.487Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to align single widgets in Flutter?<p>I want to align a Flutter widget within its parent. I know that I can center a widget by wrapping it in a Center wi... |
53,574,600 | C++: Using remove_if to filter vector on a condition<p>What is the correct syntax to use erase+remove_if to remove all elements in a vector, that are smaller than a specific value. However, this specific value is not a constant, but a variable. </p>
<p>Refer to the code to get a better understanding of the question:</... | <p>Below example demonstrates the usage of erase-remove_if. <code>limit</code> is captured by reference and can thus be modified outside the lambda:</p>
<pre><code>#include <vector>
#include <algorithm>
#include <iostream>
int main()
{
std::vector<int> vec{0,1,2,3,4,5,6,7,8,9};
int size... | C++: Using remove_if to filter vector on a condition | c++|algorithm|vector|erase | -5 | 305 | 1 | 53,574,808 | 53,574,808 | 0 | true | 2018-12-01T20:04:56.067Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C++: Using remove_if to filter vector on a condition<p>What is the correct syntax to use erase+remove_if to remove all elements in a vector, that are smaller... |
53,624,111 | Azure Monitor... or is it Log Analytics? Or Application Insights? Or Operational Insights? Or<p>Here's my scenario.</p>
<p>Application:</p>
<ol>
<li>Created an asp.net core app</li>
<li>Grab an <code>ILogger<T> logger;</code></li>
<li><code>logger.LogInformation(new EventId(123456, "HelloEvent"), "Hello there")... | <p>Regarding the "Where's my HelloEvent" with application insights:</p>
<p>Please make sure in Startup.cs -> Configure method, you specify the loglevel to information, like below:</p>
<pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
// other code
//... | Azure Monitor... or is it Log Analytics? Or Application Insights? Or Operational Insights? Or | azure|logging | 11 | 2,320 | 1 | 53,624,415 | 53,624,415 | 1 | true | 2018-12-05T02:04:52.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Azure Monitor... or is it Log Analytics? Or Application Insights? Or Operational Insights? Or<p>Here's my scenario.</p>
<p>Application:</p>
<ol>
<li>Create... |
53,687,845 | Saving data in .txt file java<p>can someone help me with this? I want to save all data(like textfields , checkbox , radioButtton, scroll list) in .txt file when i press that btnSubmit .</p>
<pre><code>btnSubmit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
... | <pre><code>BufferedWriter writer = new BufferedWriter(new FileWriter(your_file, append));
writer.write(your_string);
writer.close();
</code></pre>
<p>For btnSubmit:</p>
<pre><code>btnSubmit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if(textField.getText().isE... | Saving data in .txt file java | java | -4 | 43 | 1 | 53,688,258 | 53,688,258 | 1 | true | 2018-12-08T23:01:07.920Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Saving data in .txt file java<p>can someone help me with this? I want to save all data(like textfields , checkbox , radioButtton, scroll list) in .txt file w... |
53,781,736 | Javascript change name format from AD container<p>I'm trying to change the format of how a name displays when a distinguished name is in the format "CN=Doe\, John" to display as "John Doe". How can I change this code to account for it?</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" da... | <p>Just like that. This assumes that names are always split with comma + space and there's equal sign.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>function changeName(name... | Javascript change name format from AD container | javascript | -4 | 38 | 1 | 53,782,043 | 53,782,043 | 1 | true | 2018-12-14T14:37:27.550Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript change name format from AD container<p>I'm trying to change the format of how a name displays when a distinguished name is in the format "CN=Doe\,... |
53,792,632 | Find and replace string in between characters<p>I need to find a string in a file and reformat it.</p>
<p>String to find format:</p>
<pre><code>[title](link)
</code></pre>
<p>example:</p>
<pre><code>[template application](https://stackoverflow.com/sample/base-app)
</code></pre>
<p>I would like to change that to HT... | <p>You could take advantage of the fact that the <a href="https://docs.python.org/3/library/re.html#re.sub" rel="nofollow noreferrer">sub</a> function receives another function as a parameter for replacement:</p>
<pre><code>import re
line = '[template application](https://stackoverflow.com/sample/base-app)'
def re... | Find and replace string in between characters | python|python-3.x | -4 | 47 | 2 | 53,793,843 | 53,793,843 | 1 | true | 2018-12-15T13:09:49.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find and replace string in between characters<p>I need to find a string in a file and reformat it.</p>
<p>String to find format:</p>
<pre><code>[title](lin... |
53,742,412 | Jdbc: What happens to running statements on application exit?<p>Assume I have a long running statement, say <code>load data infile...</code>, and the Java application quits, what happens to the statement?</p>
<p>Will the statement finish? Will rollback? Will it die somewhere in the middle? Does it depend on configurat... | <p>A JDBC database Connection Object is just a cursor to a database connection that is owned and managed by the database.</p>
<p>If the application exits without closing the connection properly, the database connection will be left unclosed (including all the running statements). This may result in database resources ... | Jdbc: What happens to running statements on application exit? | java|mysql|jdbc | -4 | 55 | 1 | 53,742,608 | 53,742,608 | 2 | true | 2018-12-12T11:50:22.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jdbc: What happens to running statements on application exit?<p>Assume I have a long running statement, say <code>load data infile...</code>, and the Java ap... |
53,778,131 | Discrepancy when capturing Rails view block<p>I have an ERB view with two blocks:</p>
<pre><code><%= test_h1 do %>
<%= 'test1' %>
<% end -%>
<%= test_h2 do %>
<%= 'test2' %>
<% end -%>
</code></pre>
<p>where <code>test_h1</code> and <code>test_h2</code> are similar helpers, bu... | <p><code>capture</code> overrides current output buffer and just calls the block (which is still bound to other view context), thus override has no effect when called from controller because <code>view_context</code> is not the same context the view is being rendered in.</p>
<p>To work around contexts you can define y... | Discrepancy when capturing Rails view block | ruby-on-rails|ruby-on-rails-5|actionview | 7 | 290 | 4 | 53,884,673 | 53,884,673 | 2 | true | 2018-12-14T10:43:03.150Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Discrepancy when capturing Rails view block<p>I have an ERB view with two blocks:</p>
<pre><code><%= test_h1 do %>
<%= 'test1' %>
<% end -%... |
53,508,439 | Variable declaration in Java with conditional blocks<p>In both the cases below , I don't need the name outside the conditional block. Which of these approaches is better and why?</p>
<p><strong>Approach 1</strong></p>
<pre><code>String name = null
if(){
name = "hello";
} else {
name = "carlo"
}
</code></pre>
<p><str... | <p>In the more likely event that you want to use the value of name that you've set after the <code>else</code> block ends, the first approach is better, because the second will not compile; the variables <code>name</code> will not be visible outside the <code>if</code>/<code>else</code> block.</p>
<p>In the less likel... | Variable declaration in Java with conditional blocks | java | -3 | 44 | 1 | 53,508,477 | 53,508,477 | 3 | true | 2018-11-27T21:29:08.350Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Variable declaration in Java with conditional blocks<p>In both the cases below , I don't need the name outside the conditional block. Which of these approach... |
53,562,585 | Google Pie Chart is not drawing<p>Can someone tell me why this is not drawing?</p>
<p>It is drawing perfectly fine when I have 3 slices. But when I add a fourth slice it doesn't draw anymore.</p>
<p><strong>Code:</strong></p>
<pre><code>function pieChart() {
var data = new google.visualization.DataTab... | <p>you need a comma after the array in the third line... </p>
<pre><code>echo "['3rd Place', $third_total, '3rd place Received: $third_total times'],"; // <-- add comma after array
</code></pre> | Google Pie Chart is not drawing | javascript|php|google-visualization | -3 | 38 | 1 | 53,562,606 | 53,562,606 | 3 | true | 2018-11-30T17:58:18.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Pie Chart is not drawing<p>Can someone tell me why this is not drawing?</p>
<p>It is drawing perfectly fine when I have 3 slices. But when I add a fo... |
53,683,429 | Flutter change dialog background color<p>I was using <code>dialogBackgroundColor</code> property still the color was not changing. Can anyone tell me how to change the background color of the dialog?</p> | <p>You need to wrap your <code>Dialog</code> in a <code>Builder</code> like this. After that <code>dialogBackgroundColor</code> will have an effect.</p>
<pre><code>Theme(
data: ThemeData(dialogBackgroundColor: Colors.orange),
child: Builder(
builder: (context) {
return RaisedButton(
onPressed: ()... | Flutter change dialog background color | dart|flutter | 8 | 27,913 | 6 | 53,683,431 | 53,683,431 | 4 | true | 2018-12-08T14:20:18.233Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter change dialog background color<p>I was using <code>dialogBackgroundColor</code> property still the color was not changing. Can anyone tell me how to ... |
53,524,896 | What is happening when I assign a list with self references to a list copy with the slice syntax `mylist[:] = [mylist, mylist, ...]`?<p>I was just looking at the implementation of <a href="https://github.com/python/cpython/blob/3.7/Lib/functools.py#L495" rel="noreferrer">functools.lru_cache</a>, when I stumbled across ... | <p>in</p>
<pre><code>root[:] = [root, root, None, None]
</code></pre>
<p>left hand slice assignment just says that the reference of <code>root</code> is reused to hold the contents of the right part.</p>
<p>So <code>root</code> reference never changes, and yes, in a list you can reference yourself (but don't try rec... | What is happening when I assign a list with self references to a list copy with the slice syntax `mylist[:] = [mylist, mylist, ...]`? | python|python-3.x|list|assignment-operator | 9 | 267 | 3 | 53,525,012 | 53,525,012 | 5 | true | 2018-11-28T17:20:06.847Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is happening when I assign a list with self references to a list copy with the slice syntax `mylist[:] = [mylist, mylist, ...]`?<p>I was just looking at... |
53,774,503 | FormGroup inside FormArray in Angular 2 Reactive Forms<p>I failed to get an Angular 2 reactive form to work which has a <strong>FormGroup</strong> nested in a <strong>FormArray</strong>. Can somebody show me what is wrong in my setup. </p>
<p>Unrelated parts of the code has been omitted for the brevity.</p>
<p>Follo... | <p>@Johna, to complementary my answer:</p>
<p>You have two functions</p>
<pre><code> buildForm(data:any):FormGroup
{
return data?this.fb.group({
id: [data.id?data.id:''],
store: [data.store?data.store:'', Validators.required],
order_lines:this.fb.array(this.buildArrayControl(data.order_lines?... | FormGroup inside FormArray in Angular 2 Reactive Forms | angular|angular2-forms|angular-reactive-forms | 15 | 22,792 | 4 | 53,778,007 | 53,778,007 | 5 | true | 2018-12-14T06:27:57.623Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
FormGroup inside FormArray in Angular 2 Reactive Forms<p>I failed to get an Angular 2 reactive form to work which has a <strong>FormGroup</strong> nested in... |
53,800,144 | In JavaScript, is it possible to bypass a setter?<p>I have an object <code>o</code> with prototype <code>p</code>:</p>
<pre><code>var p = {}
var o = Object.create(p)
</code></pre>
<p>It is possible to add a property <code>a</code> to the object <code>o</code>, and then add a setter of the same name to the prototype <... | <p>You can use <code>defineProperty</code> again and set <code>writable</code> to <code>true</code>. You'll probably also want to set <code>enumerable</code> and <code>configurable</code> since they default to <code>false</code>. You don't need to set the <code>value</code> as that defaults to <code>undefined</code>, b... | In JavaScript, is it possible to bypass a setter? | javascript|prototype|getter-setter | 7 | 516 | 1 | 53,800,177 | 53,800,177 | 5 | true | 2018-12-16T07:09:05.133Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In JavaScript, is it possible to bypass a setter?<p>I have an object <code>o</code> with prototype <code>p</code>:</p>
<pre><code>var p = {}
var o = Object.... |
53,604,539 | HiDPI support with java 9+, scalling issue with JTable gridlines with Windows L&F - but not Nimbus<p>I'm migrating my Swing app to Java 11 to take advantage of the HiDPI display support. I'm using a Samsung monitor with resolution set to 3840x2160, scaling at 125%, with Windows 10.</p>
<p>Although java 9 and above are... | <p>The difference is how the two look and feels render their grid lines.</p>
<p>The default look and feel <code>MetalLookAndFeel</code> (and the <code>WindowsLookAndFeel</code>) is based around <code>BasicLookAndFeel</code> which uses the <code>BasicTableUI</code> class to render the <code>JTable</code>. In <a href="... | HiDPI support with java 9+, scalling issue with JTable gridlines with Windows L&F - but not Nimbus | java|look-and-feel|nimbus|hidpi | 8 | 553 | 1 | 53,664,079 | 53,664,079 | 6 | true | 2018-12-04T01:47:08.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HiDPI support with java 9+, scalling issue with JTable gridlines with Windows L&F - but not Nimbus<p>I'm migrating my Swing app to Java 11 to take advantage ... |
53,517,885 | Why does the java.time.Clock has zone information?<p>Why does <code>java.time.Clock</code> has zone information? From the Clock you only can get an <code>Instant</code> when calling the <code>instant()</code> method - which is a time without zone info.</p>
<p>Is the only purpose to have the zone available in the clock... | <h1>Alternate clock behaviors</h1>
<p>Quoting the <a href="https://docs.oracle.com/javase/8/docs/api/java/time/Clock.html" rel="nofollow noreferrer"><code>Clock</code></a> documentation (emphasis mine):</p>
<blockquote>
<p>Use of a Clock is optional. All key date-time classes also have a now() factory method that u... | Why does the java.time.Clock has zone information? | java|timezone|java-time|jsr310 | 14 | 1,292 | 2 | 53,518,376 | 53,518,376 | 7 | true | 2018-11-28T10:59:18.570Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does the java.time.Clock has zone information?<p>Why does <code>java.time.Clock</code> has zone information? From the Clock you only can get an <code>Ins... |
53,651,810 | Extract Time from Datetime SQL<p>I want to get only Time from a DateTime column using SQL query using SQL Server 2012:</p>
<p>The datetime format in the column at the moment is:</p>
<p><strong>dd/mm/yyyy hh:mm</strong> </p>
<p><strong>example - 16/10/2018 11:50</strong></p>
<p>I want to extract the hh:mm and conver... | <p>If the column is a string, do you simply want this?</p>
<pre><code>select convert(time, right(col, 5))
</code></pre> | Extract Time from Datetime SQL | sql|tsql|datetime|time|type-conversion | 7 | 24,884 | 2 | 53,651,849 | 53,651,849 | 7 | true | 2018-12-06T12:46:56.253Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extract Time from Datetime SQL<p>I want to get only Time from a DateTime column using SQL query using SQL Server 2012:</p>
<p>The datetime format in the col... |
53,680,668 | versionCodeOverride equivalent for Gradle Kotlin DSL<pre><code> android.applicationVariants.all { variant ->
variant.outputs.each { output ->
int newVersionCode = android.defaultConfig.versionCode * 10 + abiVersionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0)
... | <p><code>output</code> actually has <code>ApkVariantOutputImpl</code> type, that has <code>setVersionCodeOverride(int versionCodeOverride)</code> method. So you just can cast <code>output</code> to this type explicitly to use this method in Kotlin:</p>
<pre><code>(output as ApkVariantOutputImpl).versionCodeOverride = ... | versionCodeOverride equivalent for Gradle Kotlin DSL | android|gradle|kotlin|gradle-kotlin-dsl|groovydsl | 7 | 1,587 | 1 | 53,708,914 | 53,708,914 | 8 | true | 2018-12-08T07:57:15.827Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
versionCodeOverride equivalent for Gradle Kotlin DSL<pre><code> android.applicationVariants.all { variant ->
variant.outputs.each { output ->... |
53,735,718 | How can I concatenate a string using Jinja for loop?<p>I am trying to iteratively concatenate a string to build url params with a 'for' loop, but I believe I am having scoping issues. </p>
<pre><code>The output should be: url_param = "&query_param=hello&query_param=world"
array_of_objects = [{'id':'hello'},{'... | <p>That is indeed a scope issue. One "hacky" way of dealing with this is using a list that you append to like so:</p>
<pre><code>{% set array_of_objects = [{'id':'hello'},{'id':'world'}] %}
{% set array_of_ids = array_of_objects|map(attribute='id')|list%}
{{ array_of_ids|pprint }} {# output: ['hello', 'worl... | How can I concatenate a string using Jinja for loop? | jinja2|email-templates|sendwithus | 7 | 4,627 | 2 | 53,736,050 | 53,736,050 | 8 | true | 2018-12-12T03:39:52.800Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I concatenate a string using Jinja for loop?<p>I am trying to iteratively concatenate a string to build url params with a 'for' loop, but I believe I... |
53,483,066 | babel 7 Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead<p>I'm using react js with latest babel 7.
when I use decorators of mobx I get the error</p>
<p>Parsing error: Using the export keyword between a decorator and a class is not allowed. Please use <code... | <p>There is a work around you can do. Modify your class to the following.</p>
<pre><code>import React, { Component } from 'react';
import { observer,inject } from 'mobx-react'
import './style.scss'
@inject('routingStore', 'UserStore')
@observer
class Login extends Component {
constructor(props) {
super(props);... | babel 7 Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead | reactjs|babeljs | 10 | 12,099 | 3 | 53,508,399 | 53,508,399 | 9 | true | 2018-11-26T14:18:00.383Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
babel 7 Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead<p>I'm using react js with latest babe... |
53,777,697 | Define StringDef in kotlin<p>I'm trying to define a StringDef in kotlin:</p>
<pre><code>@Retention(AnnotationRetention.SOURCE)
@StringDef(NORTH, SOUTH)
annotation class FilterType {
companion object {
const val NORTH = "NORTH"
const val SOUTH = "SOUTH"
}
}
</code></pre>
<p>I think something i... | <p>According to <a href="https://youtrack.jetbrains.com/issue/KT-7729" rel="noreferrer">jetbrains issue</a>, <code>Lint</code> check plugin for enumerated annotations in kotlin is under development and is not stable yet. Checking android support annotations such as <code>@Nullable</code>, <code>@StringRes</code>, <code... | Define StringDef in kotlin | android|kotlin|annotations | 8 | 5,896 | 2 | 53,778,797 | 53,778,797 | 9 | true | 2018-12-14T10:17:28.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Define StringDef in kotlin<p>I'm trying to define a StringDef in kotlin:</p>
<pre><code>@Retention(AnnotationRetention.SOURCE)
@StringDef(NORTH, SOUTH)
anno... |
53,443,249 | Do all CPUs which support AVX2 also support SSE4.2 and AVX?<p>I am planning to implement runtime detection of SIMD extensions. Is it such that if I find out that the processor has AVX2 support, it is also guaranteed to have SSE4.2 and AVX support?</p> | <p><strong>Support for a more-recent Intel SIMD ISA extension implies support for previous SIMD ones.</strong></p>
<p>AVX2 definitely implies AVX1.</p>
<p>I think AVX1 implies all of SSE/SSE2/SSE3/SSSE3/SSE4.1/SSE4.2 feature bits must also be set in CPUID. If not formally guaranteed, <em>many</em> things make this ass... | Do all CPUs which support AVX2 also support SSE4.2 and AVX? | sse|simd|avx|avx2 | 11 | 10,002 | 3 | 53,512,051 | 53,512,051 | 10 | true | 2018-11-23T08:45:06.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Do all CPUs which support AVX2 also support SSE4.2 and AVX?<p>I am planning to implement runtime detection of SIMD extensions. Is it such that if I find out ... |
53,793,847 | Add `host`, `basePath` and `schemes` to swagger.json using Swashbuckle Aspnetcore<p>I am using official doc step by step method to configure Swagger UI and generate Swagger JSON file in my ASP.NET core API application.</p>
<p><a href="https://docs.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuc... | <p>You can implement and register your own <code>IDocumentFilter</code> and set the desired values there. </p>
<pre><code>public class MyDocumentFilter : IDocumentFilter
{
public void Apply(SwaggerDocument swaggerDoc, SchemaRegistry schemaRegistry, IApiExplorer apiExplorer)
{
swaggerDoc.Host = "some-ur... | Add `host`, `basePath` and `schemes` to swagger.json using Swashbuckle Aspnetcore | c#|json|asp.net-core|swagger|swashbuckle | 17 | 15,130 | 5 | 53,794,326 | 53,794,326 | 10 | true | 2018-12-15T13:56:47.547Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add `host`, `basePath` and `schemes` to swagger.json using Swashbuckle Aspnetcore<p>I am using official doc step by step method to configure Swagger UI and g... |
53,523,524 | How to push existing docker image to google app-engine<p>I am currently using the app engine maven plugin, which seems to trigger a Google cloud build to build a docker image and then push to app engine.</p>
<p>Is it possible for me to just push an exiting docker image from docker hub or google container registry?</p> | <p>You can deploy to App Engine using a specific Docker image hosted on Google Container Registry by using the <code>--image-url</code> flag like this:</p>
<pre><code>gcloud app deploy --image-url=[HOSTNAME]/[PROJECT-ID]/[IMAGE]
</code></pre>
<p>See doc <a href="https://cloud.google.com/container-registry/docs/pushin... | How to push existing docker image to google app-engine | google-app-engine|google-cloud-platform | 7 | 7,448 | 2 | 53,523,962 | 53,523,962 | 11 | true | 2018-11-28T16:01:42.303Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to push existing docker image to google app-engine<p>I am currently using the app engine maven plugin, which seems to trigger a Google cloud build to bui... |
53,529,292 | First Expo project throwing error after npm start<p>I followed instructions to install Expo on my Windows 10 machine. I'm running <code>node</code> version <code>10.14.0</code> on my machine.</p>
<p>After I issued <code>expo init</code> command and created the first project, running <code>npm start</code> shows a mess... | <p>I had the same issue, first run:</p>
<pre><code>npm i expo-cli
</code></pre>
<p>then:</p>
<pre><code>npm start
</code></pre>
<p>Worked for me</p> | First Expo project throwing error after npm start | react-native|expo | 7 | 4,620 | 3 | 53,529,687 | 53,529,687 | 11 | true | 2018-11-28T22:51:13.790Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
First Expo project throwing error after npm start<p>I followed instructions to install Expo on my Windows 10 machine. I'm running <code>node</code> version <... |
53,605,017 | How to execute a 'command with arguments' on a container of 'multi-container pod'?<p>I have an app/pod: <code>app1</code> with 2 containers <code>service1</code> and <code>service2</code>. These services writes log at /var/log/app1Service1.log and /var/log/aapp1Service2.log. I'd like to tail log from mac's cli. Tried a... | <p>Add <code>bash -c</code> or if your container has <code>sh</code> then add <code>sh -c</code></p>
<pre><code>kubectl exec app1-6f6749ccdd-4ktwf -c app1Service1 -- bash -c "tail -f -n +1 /var/log/app1Service1.log"
</code></pre>
<p>Hope this'll help</p> | How to execute a 'command with arguments' on a container of 'multi-container pod'? | kubernetes|kubectl | 9 | 8,461 | 2 | 53,606,924 | 53,606,924 | 11 | true | 2018-12-04T02:50:53.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to execute a 'command with arguments' on a container of 'multi-container pod'?<p>I have an app/pod: <code>app1</code> with 2 containers <code>service1</c... |
53,625,687 | What is the largest filesize supported by VS Code syntax highlighting?<p>VS Code provides syntax highlighting automatically for xml and json files out-of-the-box. But when you start to process file that is larger than a certain size, the syntax highlighting no longer works. </p>
<p>Many other features might be disable... | <p>This is controlled by the <code>"editor.largeFileOptimizations"</code> setting in VS Code. As of VS Code 1.30, the limits are:</p>
<ul>
<li>20MB </li>
<li>Or 300K lines</li>
</ul>
<p>These values are defined <a href="https://github.com/Microsoft/vscode/blob/1e3dc27c78aa4213315b9772d2207218901bcbb3/src/vs/editor/co... | What is the largest filesize supported by VS Code syntax highlighting? | visual-studio-code | 8 | 6,150 | 1 | 53,643,761 | 53,643,761 | 11 | true | 2018-12-05T05:27:48.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the largest filesize supported by VS Code syntax highlighting?<p>VS Code provides syntax highlighting automatically for xml and json files out-of-the... |
53,692,326 | Convert relative to absolute URLs in Go<p>I'm writing a little web crawler, and a lot of the links on sites I'm crawling are relative (so they're <code>/robots.txt</code>, for example). How do I convert these relative URLs to absolute URLs (so <code>/robots.txt</code> => <code>http://google.com/robots.txt</code>)? Does... | <p>Yes, the standard library can do this with the <code>net/url</code> package. Example (from the standard library): </p>
<pre><code>package main
import (
"fmt"
"log"
"net/url"
)
func main() {
u, err := url.Parse("../../..//search?q=dotnet")
if err != nil {
log.Fatal(err)
}
base, ... | Convert relative to absolute URLs in Go | url|go|relative-url | 7 | 3,089 | 3 | 53,692,721 | 53,692,721 | 11 | true | 2018-12-09T12:32:22.437Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert relative to absolute URLs in Go<p>I'm writing a little web crawler, and a lot of the links on sites I'm crawling are relative (so they're <code>/robo... |
53,688,988 | Why does pandas merge on NaN?<p>I recently asked a question regarding missing values in pandas <a href="https://stackoverflow.com/questions/53549030/comparing-pd-series-and-getting-what-appears-to-be-unusual-results-when-the-se">here</a> and was directed to a <a href="https://github.com/pandas-dev/pandas/issues/20442#i... | <p>Yeah, this is <em>definitely</em> a bug. See <a href="https://github.com/pandas-dev/pandas/issues/22491" rel="noreferrer">GH22491</a> which documents exactly your issue, and <a href="https://github.com/pandas-dev/pandas/issues/22618" rel="noreferrer">GH22618</a> which notes the problem is also observed with <code>No... | Why does pandas merge on NaN? | python|python-3.x|pandas | 22 | 2,819 | 1 | 53,719,315 | 53,719,315 | 11 | true | 2018-12-09T03:01:42.653Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does pandas merge on NaN?<p>I recently asked a question regarding missing values in pandas <a href="https://stackoverflow.com/questions/53549030/comparin... |
53,606,426 | RabbitHealthIndicator - Health check failed<p>Have a similar situation as we have here <a href="https://stackoverflow.com/questions/44683347/spring-cloud-stream-and-rabbitmq-health-check">Spring Cloud Stream and RabbitMQ health check
</a></p>
<p><strong>Error message</strong></p>
<pre>
2018-12-04 05:17:31.768 INFO 1... | <p>This configuration is solution for such a case for for application.yml</p>
<pre><code>spring:
autoconfigure:
exclude: org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration
</code></pre>
<p>The issue in external application.yaml file, when added this configuration in my local application.yml insid... | RabbitHealthIndicator - Health check failed | spring|spring-boot|spring-boot-actuator|spring-integration-amqp | 9 | 17,474 | 3 | 53,612,820 | 53,612,820 | 12 | true | 2018-12-04T05:46:43.983Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
RabbitHealthIndicator - Health check failed<p>Have a similar situation as we have here <a href="https://stackoverflow.com/questions/44683347/spring-cloud-str... |
53,605,744 | How to split based on multiple delimiter pandas<p>I have a df column which contains</p>
<pre><code>Phone number
12399422/930201021
5451354;546325642
789888744,656313214
123456654
</code></pre>
<p>I would like to separate it into two columns</p>
<pre><code>Phone number1 Phone number2
12399422 930201021... | <p>Using <code>str.split</code> </p>
<pre><code>df.Phonenumber.str.split('/|;|,',expand=True).add_prefix('Number_')
Number_0 Number_1
0 12399422 930201021
1 5451354 546325642
2 789888744 656313214
3 123456654 None
</code></pre> | How to split based on multiple delimiter pandas | python|python-3.x|pandas | 9 | 11,549 | 3 | 53,605,756 | 53,605,756 | 13 | true | 2018-12-04T04:33:36.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to split based on multiple delimiter pandas<p>I have a df column which contains</p>
<pre><code>Phone number
12399422/930201021
5451354;546325642
7898887... |
53,657,378 | Device torch turns off when starting AVCaptureSession<p>I'm using AVCaptureSession to capture video.</p>
<p>I want to light on the torch during the whole session, but once the session is started, the light turns automatically off.</p>
<p>There is a lot of posts here showing how to turn on the torch. It works, <strong... | <p>Ok, I figured out.</p>
<p>The torch simply must be lighted on after the session start.</p>
<p>So instead of:</p>
<pre><code>try camera.setLight(on: true)
self.captureSession.commitConfiguration()
DispatchQueue(label: "capturesession").async {
self.captureSession.startRunning()
}
</code></pre>
<p>just do </p... | Device torch turns off when starting AVCaptureSession | ios|swift|avcapturesession | 9 | 1,325 | 2 | 53,666,293 | 53,666,293 | 13 | true | 2018-12-06T18:12:16.063Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Device torch turns off when starting AVCaptureSession<p>I'm using AVCaptureSession to capture video.</p>
<p>I want to light on the torch during the whole se... |
53,698,758 | How do I apply a map of tags to aws_autoscaling_group?<p><a href="https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html#propagate_at_launch" rel="noreferrer">https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html#propagate_at_launch</a></p>
<p>I do this to apply tags to aws resources:</p>
... | <p>I do it using a null resource and take it's output as a tag, sample below - </p>
<pre><code>data "null_data_source" "tags" {
count = "${length(keys(var.tags))}"
inputs = {
key = "${element(keys(var.tags), count.index)}"
value = "${element(values(var.tags), count.index)}"
... | How do I apply a map of tags to aws_autoscaling_group? | terraform|terraform-provider-aws | 7 | 4,390 | 1 | 53,699,778 | 53,699,778 | 15 | true | 2018-12-10T02:31:56.097Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I apply a map of tags to aws_autoscaling_group?<p><a href="https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html#propagate_at_launch" r... |
53,691,457 | React-Native Android - Could not find com.android.tools:common<p>It seems that somehow the <code>android/tools/common</code> library has been deleted
(<a href="https://jcenter.bintray.com/com/android/tools/common/25.2.3/common-25.2.3.pom" rel="nofollow noreferrer">pom</a>, <a href="https://jcenter.bintray.com/com/andr... | <p><strong>Update</strong>, I had to add more code to <strong>build.gradle</strong></p>
<p>This is my fix, I did not fork repos just used this workaround: add this to your <strong>build.gradle</strong> file, the sibling of <strong>settings.gradle</strong> file</p>
<pre><code>buildscript {
repositories {
google... | React-Native Android - Could not find com.android.tools:common | android|android-studio|react-native|android-gradle-plugin|jcenter | 16 | 3,140 | 2 | 53,692,168 | 53,692,168 | 16 | true | 2018-12-09T10:41:59.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React-Native Android - Could not find com.android.tools:common<p>It seems that somehow the <code>android/tools/common</code> library has been deleted
(<a hr... |
53,758,438 | How to detect if test is running on GitLab CI server<p>I have a test, which is using MySQL database configured and running on gitlab CI server (gitlab-ci.yml). I want that test to be disabled when it's running locally (it's using in-memory database instead). Is there any way to check if the test is running on GitLab Ci... | <p>Gitlab CI <a href="https://docs.gitlab.com/ee/ci/variables/predefined_variables.html" rel="nofollow noreferrer">defines a large number of environment variables</a>; you could use e.g. <code>GITLAB_CI</code>.</p>
<p>Something like:</p>
<pre class="lang-java prettyprint-override"><code>if(System.getenv("GITLAB_CI... | How to detect if test is running on GitLab CI server | java|gitlab|gitlab-ci | 9 | 2,827 | 1 | 53,758,763 | 53,758,763 | 16 | true | 2018-12-13T09:15:00.193Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to detect if test is running on GitLab CI server<p>I have a test, which is using MySQL database configured and running on gitlab CI server (gitlab-ci.yml... |
53,539,348 | What is the backward process of max operation in deep learning?<p>I know that the backward process of deep learning follows the gradient descent algorithm. However, there is never a gradient concept for <code>max</code> operation.</p>
<p>How does deep learning frameworks like tensorflow, pytorch deal with the backward... | <p>You have to think of what the <code>max</code> operator actually does? That is:</p>
<ul>
<li><strong>It returns or lets better say it propagates the maximum.</strong> </li>
</ul>
<p>And that's exactly what it does here - it takes two or more tensors and propagates forward <em>(only)</em> the maximum.</p>
<p>It i... | What is the backward process of max operation in deep learning? | python|tensorflow|deep-learning|caffe|pytorch | 9 | 4,113 | 1 | 53,539,777 | 53,539,777 | 18 | true | 2018-11-29T12:42:39.177Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the backward process of max operation in deep learning?<p>I know that the backward process of deep learning follows the gradient descent algorithm. H... |
53,576,189 | CoroutineExceptionHandler not executed when provided as launch context<p>When I run this:</p>
<pre><code>fun f() = runBlocking {
val eh = CoroutineExceptionHandler { _, e -> trace("exception handler: $e") }
val j1 = launch(eh) {
trace("launched")
delay(1000)
throw RuntimeException("e... | <p>I believe the answer lies in this section from the <a href="https://github.com/Kotlin/kotlinx.coroutines/blob/master/docs/exception-handling.md#cancellation-and-exceptions" rel="noreferrer">official coroutines docs</a>:</p>
<blockquote>
<p>If a coroutine encounters exception other than CancellationException, it canc... | CoroutineExceptionHandler not executed when provided as launch context | kotlin|coroutine|kotlinx.coroutines | 7 | 3,903 | 2 | 53,588,660 | 53,588,660 | 18 | true | 2018-12-02T00:08:28.320Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CoroutineExceptionHandler not executed when provided as launch context<p>When I run this:</p>
<pre><code>fun f() = runBlocking {
val eh = CoroutineExcep... |
53,645,309 | Can not create classlib (core) using dotnet CLI<p>I used the dotnet CLI command <code>dotnet new classlib -o ProjectName</code> to create a class library and added the EF Core Package using <code>dotnet add package</code> but when I tried to run some <code>dotnet ef</code> commands it threw the following error.</p>
<p... | <p>You can always use <code>-h</code> to check the class lib. So, when you run <code>dotnet new classlib -h</code>, you would find an option <code>-f</code> to set the framework. Basically, you can run the following if you would like to create a new .net core project:</p>
<pre><code>dotnet new classlib -f netcoreapp2.... | Can not create classlib (core) using dotnet CLI | c#|.net-core|projects-and-solutions|class-library|dotnet-cli | 9 | 3,901 | 1 | 53,647,348 | 53,647,348 | 18 | true | 2018-12-06T05:45:46.997Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can not create classlib (core) using dotnet CLI<p>I used the dotnet CLI command <code>dotnet new classlib -o ProjectName</code> to create a class library and... |
53,692,036 | How can I combine two lists in Nix?<p>I've currently got a list defined as:</p>
<pre><code> environment.systemPackages = with pkgs; [
acpi
ag
alacritty
audacity
awscli
bash
breeze-gtk
cabal-install
];
</code></pre>
<p>How would I go about defining two lists and then mergi... | <p><a href="https://nixos.org/manual/nix/stable/expressions/language-operators.html" rel="nofollow noreferrer">https://nixos.org/manual/nix/stable/expressions/language-operators.html</a></p>
<p>The <code>++</code> operator:</p>
<pre><code>nix-repl> [1 2 3] ++ [5 6]
[ 1 2 3 5 6 ]
</code></pre>
<p>Code example:</p>
<... | How can I combine two lists in Nix? | nix|nixos | 13 | 4,147 | 1 | 53,692,127 | 53,692,127 | 20 | true | 2018-12-09T11:51:07.340Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I combine two lists in Nix?<p>I've currently got a list defined as:</p>
<pre><code> environment.systemPackages = with pkgs; [
acpi
ag
... |
53,706,390 | Vue.js change placeholder of text input according to v-model value<p>I need to change placeholder of a text input via Vue.js data binding. Here is my code.</p>
<pre class="lang-html prettyprint-override"><code><select2 :options="power_options" v-model="power">
<option selected value=&qu... | <p>You should use placeholder property notation in this case <code>:placeholder="[[ power ]]"</code>:</p>
<pre><code><input
name="power_to"
type="text"
class="form-control pwer_change"
v-model="power_from"
:placeholder="[[ power ]]"
style="display: inline;width: 48%;"
/>
</code></pre> | Vue.js change placeholder of text input according to v-model value | vue.js|vue-component|jquery-select2 | 7 | 35,403 | 1 | 53,706,508 | 53,706,508 | 21 | true | 2018-12-10T13:10:20.907Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vue.js change placeholder of text input according to v-model value<p>I need to change placeholder of a text input via Vue.js data binding. Here is my code.</... |
53,666,106 | Use Paramiko AutoAddPolicy with pysftp<p>This code is not working:</p>
<pre><code>def sftp_connection(self):
import pysftp
connection = pysftp.Connection(self.host, username=self.system_name,
private_key=os.path.join(HOME, '.ssh', 'id_rsa'))
# in the next lines I try to use AutoAddPolicy... | <p>pysftp does not use Paramiko <a href="https://docs.paramiko.org/en/stable/api/client.html" rel="nofollow noreferrer"><code>SSHClient</code> class</a> at all, it uses more low-level <a href="https://docs.paramiko.org/en/stable/api/transport.html" rel="nofollow noreferrer"><code>Transport</code> class</a>. So it does ... | Use Paramiko AutoAddPolicy with pysftp | python|ssh|paramiko|pysftp | 8 | 10,270 | 2 | 53,669,608 | 53,669,608 | 23 | true | 2018-12-07T08:52:03.553Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use Paramiko AutoAddPolicy with pysftp<p>This code is not working:</p>
<pre><code>def sftp_connection(self):
import pysftp
connection = pysftp.Conne... |
53,695,965 | Not able to exclude some rules from PMD<p>I'm just trying to add PMD to my Spring Boot project but I'm facing some issues trying to exclude some rules from <code>category/java/errorprone.xml</code> ruleset.</p>
<p>I'm using the gradle plugin as follows:</p>
<pre><code>pmd {
ruleSetConfig = resources.text.fromFile... | <p>Gradle defaults to using the <code>basic</code> and <code>braces</code> rulesets up to Gradle 5. Gradle 5 defaults to using the <code>errorprone</code> category.</p>
<p>You need to clear out these defaults if you don't want them by doing:</p>
<pre><code>pmd {
ruleSets = []
}
</code></pre>
<p><a href="https:/... | Not able to exclude some rules from PMD | java|spring|spring-boot|pmd | 10 | 3,381 | 1 | 53,696,963 | 53,696,963 | 23 | true | 2018-12-09T19:39:01.013Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Not able to exclude some rules from PMD<p>I'm just trying to add PMD to my Spring Boot project but I'm facing some issues trying to exclude some rules from <... |
53,711,068 | How to use Scratch Files in Android Studio?<p>Recently I came across a cool feature in Android Studio called scratch files. Just wanted to share it in Q and A Style.</p>
<p>What are scratch files and how to use them?</p> | <p>It's a cool feature that lets you save your code that you want to look at later or just for reference.</p>
<p>See <a href="https://medium.com/@droid.dev/using-scratch-files-in-android-studio-9f749a0fb068" rel="noreferrer">this post</a></p>
<p>Say you are creating a class and you decide to change a section of code. Y... | How to use Scratch Files in Android Studio? | java|android|android-studio|kotlin|intellij-idea | 23 | 9,020 | 3 | 53,711,069 | 53,711,069 | 25 | true | 2018-12-10T17:52:52.957Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use Scratch Files in Android Studio?<p>Recently I came across a cool feature in Android Studio called scratch files. Just wanted to share it in Q and ... |
53,797,581 | Easily check if a number is in a given Range in Dart?<p>Is there an operator or function in Dart to easily verify if a number is in a range? Something like Kotlin <code>in</code> operator: </p>
<p><a href="https://kotlinlang.org/docs/reference/ranges.html" rel="noreferrer">https://kotlinlang.org/docs/reference/ranges.... | <p>Quite simply, no. Just use <code>1 <= i && i <= 10</code>.</p> | Easily check if a number is in a given Range in Dart? | dart | 27 | 12,323 | 4 | 53,797,617 | 53,797,617 | 28 | true | 2018-12-15T21:53:24.040Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Easily check if a number is in a given Range in Dart?<p>Is there an operator or function in Dart to easily verify if a number is in a range? Something like K... |
53,622,598 | Changing SliverAppBar title color in Flutter application<p>I'm using a SliverAppBar including a background Image and Title.
Title text is white and I need to change the color to black on the AppBar is 'reduced' (since tabbar is white as well).</p>
<p>How to do that ?</p>
<pre><code>NestedScrollView(
headerS... | <p>You can do it using a <code>ScrollController</code> , listen to the scroll and compare the offset with the default size of the Toolbar.
I made an example for you:</p>
<pre><code> class TestingNewState extends State<TestingNew> {
ScrollController _scrollController;
bool ... | Changing SliverAppBar title color in Flutter application | dart|flutter|appbar | 15 | 15,105 | 1 | 53,622,820 | 53,622,820 | 29 | true | 2018-12-04T22:47:37.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Changing SliverAppBar title color in Flutter application<p>I'm using a SliverAppBar including a background Image and Title.
Title text is white and I need to... |
53,653,689 | How enable Typescript typing and intellisense for vue props in template in VS Code?<p>I'm working with Vue and VS Code with vetur extension installed.</p>
<p>I've defined a <code>MyClass</code> class with two public attributes. Inside the "script" section i'm able to get proper intelisense for the <code>value</code> p... | <p>Using <a href="https://marketplace.visualstudio.com/items?itemName=octref.vetur" rel="noreferrer">Vetur</a> extension:</p>
<p>In settings:</p>
<pre class="lang-js prettyprint-override"><code>"vetur.experimental.templateInterpolationService": true,
</code></pre>
<p><a href="https://i.stack.imgur.com/0H1B2.p... | How enable Typescript typing and intellisense for vue props in template in VS Code? | typescript|vue.js|visual-studio-code|vetur | 18 | 6,190 | 1 | 53,653,850 | 53,653,850 | 30 | true | 2018-12-06T14:34:27.100Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How enable Typescript typing and intellisense for vue props in template in VS Code?<p>I'm working with Vue and VS Code with vetur extension installed.</p>
<... |
53,743,020 | How can I use a Map() inside [(ngModel)]?<p>I'm trying to get a specific value into a map at a specific key. </p>
<p>In my code I use <code>ngFor</code> to loop through the array. The item I get in each iteration should be the key value of the map, while the user input the corresponding value.</p>
<p>IMPORTANT: The v... | <p>You can separate <code>[(ngModel)]</code> in its two parts, <code>[ngModel]</code> and <code>(ngModelChange)</code>, and call the appropriate <code>Map</code> method in each part. The value typed by the user is given by the <code>$event</code> parameter of the <code>ngModelChange</code> event.</p>
<pre><code><fo... | How can I use a Map() inside [(ngModel)]? | angular|typescript | 14 | 6,207 | 1 | 53,744,831 | 53,744,831 | 35 | true | 2018-12-12T12:26:34.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I use a Map() inside [(ngModel)]?<p>I'm trying to get a specific value into a map at a specific key. </p>
<p>In my code I use <code>ngFor</code> to ... |
53,542,627 | How can I get url of image variant in model (outside of controller/view)? Active Storage<p>I can get url in model with this code (Active Storage)</p>
<p><code>Rails.application.routes.url_helpers.rails_blob_path(picture_of_car, only_path: true)</code></p>
<p>But I need to get url of a resized variant</p>
<p><code>pictu... | <p>Solution:</p>
<p><code>Rails.application.routes.url_helpers.rails_representation_url(picture_of_car.variant(resize: "300x300").processed, only_path: true)</code></p>
<p>Answer provided <a href="https://github.com/rails/rails/issues/32500#issuecomment-380004250" rel="noreferrer">here</a>. </p>
<blockquote>
<p>fo... | How can I get url of image variant in model (outside of controller/view)? Active Storage | ruby-on-rails|rails-activestorage | 19 | 11,010 | 4 | 53,547,638 | 53,547,638 | 51 | true | 2018-11-29T15:40:51.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I get url of image variant in model (outside of controller/view)? Active Storage<p>I can get url in model with this code (Active Storage)</p>
<p><cod... |
53,707,080 | What is the spring-boot-configuration-processor ? Why do people exclude libraries from it? Why is it invisible in dependency tree?<h1>Introduction</h1>
<p>So I noticed the following line in the gradle file of the jhipster project:</p>
<pre><code>annotationProcessor ("org.springframework.boot:spring-boot-configuration... | <p><code>spring-boot-configuration-processor</code> is an annotation processor that generates metadata about classes in your application that are annotated with <code>@ConfigurationProperties</code>. This metadata is used by your IDE (Eclipse, IntelliJ, or NetBeans) to provide auto-completion and documentation for the ... | What is the spring-boot-configuration-processor ? Why do people exclude libraries from it? Why is it invisible in dependency tree? | java|spring|maven|spring-boot|gradle | 60 | 57,352 | 2 | 53,708,051 | 53,708,051 | 91 | true | 2018-12-10T13:50:04.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the spring-boot-configuration-processor ? Why do people exclude libraries from it? Why is it invisible in dependency tree?<h1>Introduction</h1>
<p>S... |
53,458,821 | Why is my FloatingActionButton icon black?<p>Following is the code I'm using. I'm using androidx. Every FAB has a black icon, even if it has a white color.</p>
<p>mylayout.xml</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://sche... | <p>If you're using <strong>AndroidX</strong>, to change the color of the icon you must use <code>app:tint</code> opposed to <code>android:tint</code></p>
<pre><code><com.google.android.material.floatingactionbutton.FloatingActionButton
style="@style/Widget.MaterialComponents.FloatingActionButton"
android:la... | Why is my FloatingActionButton icon black? | android|android-layout|androidx | 83 | 28,452 | 6 | 53,668,350 | 53,668,350 | 198 | true | 2018-11-24T13:50:28.350Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is my FloatingActionButton icon black?<p>Following is the code I'm using. I'm using androidx. Every FAB has a black icon, even if it has a white color.</... |
53,687,958 | Mapstruct 'aftermapping' not called<p>The problem is that, methods annotated with <code>@AfterMapping</code> are not called at all. From the <code>testToEntityMapping</code> it goes to <code>toEntity</code> method but it doesn't call any of the <code>toEntityAfterMapping()</code> methods. Why ? Is it possible ? how can... | <p>Ok, it was simpler than I thought it is.</p>
<pre class="lang-java prettyprint-override"><code>public interface FordMapper<D extends FordDto> {
@Mapping(target = "totalWidth", ignore=true)
public abstract Ford toEntity(D dto);
}
</code></pre>
<p>you can even peek in the implementation th... | Mapstruct 'aftermapping' not called | mapstruct | 8 | 10,018 | 2 | 53,696,170 | 53,696,170 | 1 | true | 2018-12-08T23:17:18.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mapstruct 'aftermapping' not called<p>The problem is that, methods annotated with <code>@AfterMapping</code> are not called at all. From the <code>testToEnti... |
53,507,355 | Remove validators from form control Angular 6<p>I have a form with a lot of form controls and Validators for some of the controls, like:</p>
<pre><code>title = new FormControl("", Validators.compose([
Validators.required
]));
description = new FormControl("", [
Validators.required,
Validators.minLength(1),... | <p>I have implemented quite a lot of forms with this Save As Draft functionality.</p>
<p>What I generally do is, just keep the Submit Button as disabled unless the form is <code>valid</code>. But keep the Save as a Draft button as always enabled.</p>
<p>What this allows me to do is, save the contents of the form with... | Remove validators from form control Angular 6 | angular|angular-forms|angular-reactive-forms|angular-formbuilder | 20 | 37,644 | 7 | 53,507,454 | 53,507,454 | 2 | true | 2018-11-27T20:08:21.140Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove validators from form control Angular 6<p>I have a form with a lot of form controls and Validators for some of the controls, like:</p>
<pre><code>titl... |
53,524,595 | Spring Boot add additional attribute to WebClient request in ServerOAuth2AuthorizedClientExchangeFilterFunction<p>I am trying to implement the client_credentials grant to get a token in my spring boot resource server.
I am using <strong>Auth0</strong> as an Authorization server. They seem to require an extra parameter... | <p>Here is what i found out after further investigation. The code described in my question was never going to call the client_credentials and fit my use-case. I think (not 100% sure on this) it will be very useful in the future if i am trying to propagate the user submitted token around multiple services in a micro-ser... | Spring Boot add additional attribute to WebClient request in ServerOAuth2AuthorizedClientExchangeFilterFunction | spring-boot|spring-security-oauth2|auth0 | 11 | 8,011 | 4 | 53,558,787 | 53,558,787 | 2 | true | 2018-11-28T17:02:27.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spring Boot add additional attribute to WebClient request in ServerOAuth2AuthorizedClientExchangeFilterFunction<p>I am trying to implement the client_credent... |
53,683,959 | Typescript incorrect assignment/mapping into strongly typed object<p>I have a raw object which I want to map/assign to a Typescript's typed object. When I do the assignment, its not as per the object type e.g.</p>
<pre><code>interface TokenModel {
username: string;
password: string;
}
const obj = {
userna... | <p>You're not actually "casting" it to the type, you're telling the compiler that the object <em>should</em> have those values. It won't assign null/undefined values to fields automatically.</p>
<p>EDIT:</p>
<p>answering the question in the comment:</p>
<pre><code>const model: TokenModel = {
username: obj.userna... | Typescript incorrect assignment/mapping into strongly typed object | typescript | -5 | 53 | 1 | 53,683,991 | 53,683,991 | 2 | true | 2018-12-08T15:24:51.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Typescript incorrect assignment/mapping into strongly typed object<p>I have a raw object which I want to map/assign to a Typescript's typed object. When I do... |
53,717,824 | What's the difference between knex.raw() and knex.schema.raw()?<p><code>knex.raw(sql, bindings)</code> and <code>knex.schema.raw(statement)</code>.</p>
<p>It seems that these two functions have different signature.</p>
<p>If they are equivalent, how can I use <code>knex.schema.raw(statement)</code> and pass <code>bin... | <p><code>knex.raw</code> creates query builder instance which can be executed right away. </p>
<p>With <code>knex.schema.*</code> things work a bit different manner. Knex schema methods creates an array of queries, which are then executed one by one when schema builder is resolved.</p>
<p>So for example if you do <co... | What's the difference between knex.raw() and knex.schema.raw()? | knex.js | 8 | 4,372 | 1 | 53,722,284 | 53,722,284 | 3 | true | 2018-12-11T05:21:24.200Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What's the difference between knex.raw() and knex.schema.raw()?<p><code>knex.raw(sql, bindings)</code> and <code>knex.schema.raw(statement)</code>.</p>
<p>I... |
53,530,748 | A time.Parse Error, What am I doing wrong?<p>I'm running into the most bizarre issue regarding datestring parsing in golang using the time package. </p>
<p>The Error:</p>
<pre><code>parsing time "07-20-2018" as "2006-01-02": cannot parse "0-2018" as "2006"
</code></pre>
<p>The Code Block:</p>
<pre><code>log.Println... | <p>It is obvious. You are trying to parse mm-dd-yyyy as yyyy-mm-dd.</p>
<hr>
<p>A simple fix:</p>
<pre><code>package main
import (
"fmt"
"time"
)
func main() {
datestring := "07-20-2018"
fmt.Println(datestring)
date, err := time.Parse("01-02-2006", datestring)
fmt.Println(date, err)
}
</cod... | A time.Parse Error, What am I doing wrong? | datetime|parsing|go | -3 | 5,401 | 1 | 53,530,865 | 53,530,865 | 4 | true | 2018-11-29T01:55:25.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
A time.Parse Error, What am I doing wrong?<p>I'm running into the most bizarre issue regarding datestring parsing in golang using the time package. </p>
<p>... |
53,610,949 | Using cypress with vuetify<p>I have a Vue.js project (Nuxt.js) and as UI I use the Vuetify.
For e2e testing I use the Cypress. </p>
<p>Below is my scenarios of test in Cypress:</p>
<p>I have a problem while creating test for page where I use v-autocomplete component.
The problem is that I can't use Vuetify native c... | <p>I don't think <code>v-list__tile--link</code> can be changed by developers, it seems to be added at runtime DOM by the Vuetify library (unless you mean Vuetify developers, then sure it can change between versions).</p>
<p>In any case, if you want to be more content-oriented in your selectors, use Cypress <a href="h... | Using cypress with vuetify | vue.js|vuetify.js|e2e-testing|cypress | 7 | 5,666 | 1 | 53,623,710 | 53,623,710 | 4 | true | 2018-12-04T10:34:02.160Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using cypress with vuetify<p>I have a Vue.js project (Nuxt.js) and as UI I use the Vuetify.
For e2e testing I use the Cypress. </p>
<p>Below is my scenario... |
53,538,100 | How to get client secret via Keycloak API?<p>How to get client secret via Keycloak API?</p>
<p>In documentation I see:</p>
<p><code>GET /admin/realms/{realm}/clients/{id}/client-secret
</code></p>
<p>My code is the following:</p>
<pre><code>data = {
"grant_type" : 'password',
"client_id" : 'myclientid',
... | <p>I think your authentication it's not working.</p>
<ol>
<li>You need a token. You can generate using OpenID (see <a href="https://www.keycloak.org/docs/3.2/securing_apps/topics/oidc/oidc-generic.html" rel="nofollow noreferrer">docs</a>).</li>
<li>With the token (by header Authorization), you can do request to API.</... | How to get client secret via Keycloak API? | python|api|keycloak | 14 | 27,136 | 4 | 53,825,640 | 53,825,640 | 4 | true | 2018-11-29T11:33:40.190Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get client secret via Keycloak API?<p>How to get client secret via Keycloak API?</p>
<p>In documentation I see:</p>
<p><code>GET /admin/realms/{real... |
53,757,986 | Primary spring bean overridden by ImportResource in Configuration<p>I have a Spring test-configuration class which is supposed to override an existing in bean in xml-config. But my problem is that the xml bean overrides the bean annotated with primary in my test-config. I have tried naming the test-bean with a differen... | <p>The name change appeared to work my simplified version.</p>
<p>I don't think it matters but the construction style of RouteConfigBuilder and RouteBuilder appears different between the Java and the XML.</p>
<p>Tested with 4.3.20</p>
<pre><code>package com.stackoverflow.q53757986;
import static org.junit.Assert.... | Primary spring bean overridden by ImportResource in Configuration | java|spring|dependency-injection|integration-testing | 7 | 1,096 | 1 | 53,824,058 | 53,824,058 | 5 | true | 2018-12-13T08:44:57.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Primary spring bean overridden by ImportResource in Configuration<p>I have a Spring test-configuration class which is supposed to override an existing in bea... |
53,545,963 | internal communication Microservices through API Gateway<p>In a microservice architecture, there is a common pattern called API Gateway. </p>
<p>I know that all communication from outside the API Gateway is used as a single entry point. </p>
<p>But I also would like that the internal communication from microservice t... | <p>I have tried three flavours</p>
<ol>
<li><strong>All communication via API gateway</strong>
It makes service discovery easy, all communications can be tracked at one point, but it increases latency for services behind the gateway(Not by much but one extra hop). Also you can strip authentication and that means all s... | internal communication Microservices through API Gateway | architecture|microservices|api-gateway | 8 | 2,354 | 2 | 53,551,794 | 53,551,794 | 6 | true | 2018-11-29T19:09:05.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
internal communication Microservices through API Gateway<p>In a microservice architecture, there is a common pattern called API Gateway. </p>
<p>I know that... |
53,483,648 | Is the xgboost documentation wrong ? (early stopping rounds and best and last iteration)<p>here below is a question about xgboost early stopping rounds parameter and how it does, or does not, give the best iteration when it is the reason why the fit ends.</p>
<p>In xgboost documentation, one can see in the scikit lear... | <p>I think, it is not wrong, but <em>inconsistent</em>. </p>
<p>The documentation of the <code>predict</code> method is correct (e.g. see <a href="https://xgboost.readthedocs.io/en/latest/python/python_api.html#xgboost.XGBRegressor.predict" rel="noreferrer">here</a>). To bee 100% sure it is better to look into the cod... | Is the xgboost documentation wrong ? (early stopping rounds and best and last iteration) | python|machine-learning|scikit-learn|xgboost | 12 | 6,462 | 3 | 53,572,126 | 53,572,126 | 6 | true | 2018-11-26T14:49:28.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is the xgboost documentation wrong ? (early stopping rounds and best and last iteration)<p>here below is a question about xgboost early stopping rounds param... |
53,733,033 | How to cleanly process java 8 stream "findFirst()" result even if empty<p>One area that I often finding confusing with java 8 streams is when an intermediate result can be empty, and you need to take alternate paths if it's empty or not empty.</p>
<p>For instance, if I have code like this:</p>
<pre><code>String pymtR... | <p>Calling <code>get()</code> straight after <code>map</code> will yield an exception if the Optional has an empty state, instead call <code>orElse</code> after <code>map</code> and provide a default value:</p>
<pre><code>paymentTenders.stream()
.filter(pt -> (pt.getFlag() == Flag.N || pt.getFlag() == n... | How to cleanly process java 8 stream "findFirst()" result even if empty | java|java-8|java-stream|option-type | 8 | 8,731 | 2 | 53,733,059 | 53,733,059 | 6 | true | 2018-12-11T22:04:22.620Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to cleanly process java 8 stream "findFirst()" result even if empty<p>One area that I often finding confusing with java 8 streams is when an intermediate... |
53,670,826 | c++ windows api: disabled menu grayed?<p>I'm testing the windows API's menu states (disabled, grayed, checked...) but there's something I don't understand. The <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-appendmenuw" rel="nofollow noreferrer">documentation</a> states that <code>MF_D... | <p>These two are now the same. See <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/ns-winuser-tagmenuiteminfoa" rel="nofollow noreferrer">tagMENUITEMINFOA</a> for more info. </p>
<p>Both <code>MFS_DISABLED</code> and <code>MFS_GRAYED</code> are grayed now as they represent the same value of <code... | c++ windows api: disabled menu grayed? | c++|windows|winapi | 8 | 292 | 1 | 53,671,080 | 53,671,080 | 7 | true | 2018-12-07T13:44:22.303Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
c++ windows api: disabled menu grayed?<p>I'm testing the windows API's menu states (disabled, grayed, checked...) but there's something I don't understand. T... |
53,750,938 | What is the Bootstrap card-block class?<p>I don't see the class <code>card-block</code> mentioned in the reference documentation, but I have seen this class used in a few examples. This is the officially reference:</p>
<p><a href="https://getbootstrap.com/docs/4.0/components/card/" rel="noreferrer">https://getbootstra... | <p>The <code>card-block</code> class was used on an <strong>Alpha Release</strong> version of <strong>Bootstrap 4</strong> and doesn't exists on the current release. You can read the documentation of that class on the link: <a href="http://v4-alpha.getbootstrap.com/components/card/#blocks" rel="nofollow noreferrer">car... | What is the Bootstrap card-block class? | twitter-bootstrap | 7 | 9,224 | 1 | 53,751,504 | 53,751,504 | 7 | true | 2018-12-12T20:35:35.110Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the Bootstrap card-block class?<p>I don't see the class <code>card-block</code> mentioned in the reference documentation, but I have seen this class ... |
53,601,999 | Getting "TypeError: can't pickle thread.lock objects" when an object is deepcopied with log configs<p>I am getting <code>TypeError: can't pickle thread.lock objects</code> when an object is deep copied. Following is my class structure. </p>
<pre><code>import logging
import copy
DEFAULT_LOG_PATH = r"C:\temp\loging.log... | <p>Finally, I've find a solution. Here, in the Base class it needs to override deepcopy method and avoid deepcopying the logger, log_config object. The class will look like below.</p>
<pre><code>class Base(object):
def __init__(self):
self.deep_cp_attr = None
self.logger = logging.getLogger("logs")... | Getting "TypeError: can't pickle thread.lock objects" when an object is deepcopied with log configs | python|python-2.x | 10 | 5,400 | 1 | 53,660,367 | 53,660,367 | 11 | true | 2018-12-03T21:15:52.577Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting "TypeError: can't pickle thread.lock objects" when an object is deepcopied with log configs<p>I am getting <code>TypeError: can't pickle thread.lock ... |
53,741,993 | TypeScript: Partially "Partial" type<h1>Environment</h1>
<p>TypeScript's version is 3.2.1 and "tsconfig.json" is like below.</p>
<pre><code>{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": t... | <p>You can use <code>Pick</code> in conjunction with <code>Partial</code> to pick only the properties you want to make optional, while preserving the rest using <code>Exclude</code> to get the keys excluding the ones passed in to make optional :</p>
<pre><code>type Entity = {
a: string,
b: string,
c?: string,... | TypeScript: Partially "Partial" type | typescript | 13 | 3,132 | 3 | 53,742,583 | 53,742,583 | 11 | true | 2018-12-12T11:24:27.177Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeScript: Partially "Partial" type<h1>Environment</h1>
<p>TypeScript's version is 3.2.1 and "tsconfig.json" is like below.</p>
<pre><code>{
"compilerOp... |
53,590,201 | How to build docker with non-root user privileges to setup python application with pipenv?<p>I created python web application using tornado server, now making the dockerization. I am trying to build docker image for Continuous integration and continuous delivery. I am able to create docker image with root user. Now I w... | <p>There's nothing wrong with installing software "globally" in a Docker image (which will generally only do one thing), and to committing to some implementation details like container-internal usernames and paths. It's totally fine to install software as root and switch to a non-root user to actually run the image.</... | How to build docker with non-root user privileges to setup python application with pipenv? | docker|dockerfile|pipenv | 19 | 15,409 | 3 | 53,594,161 | 53,594,161 | 12 | true | 2018-12-03T08:46:53.390Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to build docker with non-root user privileges to setup python application with pipenv?<p>I created python web application using tornado server, now makin... |
53,606,756 | How to set `spark.driver.memory` in client mode - pyspark (version 2.3.1)<p>I'm new to PySpark and I'm trying to use <em>pySpark</em> (ver 2.3.1) on my local computer with <em>Jupyter-Notebook</em>.</p>
<p>I want to set <em>spark.driver.memory</em> to 9Gb by doing this:</p>
<pre><code>spark = SparkSession.builder \
... | <p>You provided the following code. </p>
<pre><code>spark = SparkSession.builder \
.master("local[2]") \
.appName("test") \
.config("spark.driver.memory", "9g")\ # This will work (Not recommended)
.getOrCreate()
sc = spark.sparkContext
from pyspark.sql import SQLContext
sqlContext = SQLCont... | How to set `spark.driver.memory` in client mode - pyspark (version 2.3.1) | python|pyspark|config | 10 | 21,564 | 3 | 53,620,273 | 53,620,273 | 12 | true | 2018-12-04T06:14:59.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set `spark.driver.memory` in client mode - pyspark (version 2.3.1)<p>I'm new to PySpark and I'm trying to use <em>pySpark</em> (ver 2.3.1) on my local... |
53,654,346 | How to test HTTParty API call with Ruby and RSpec<p>I am using the HTTParty gem to make a call to the GitHub API to access a list of user's repos.</p>
<p>It is a very simple application using Sinatra that displays a user's favourite programming language based on the most common language that appears in their repos.</p... | <p>There are multiple ways you could approach this problem.</p>
<p>You could, as @anil suggested, use a library like webmock to mock the underlying HTTP call. You could also do something similar with VCR (<a href="https://github.com/vcr/vcr" rel="nofollow noreferrer">https://github.com/vcr/vcr</a>) which records the re... | How to test HTTParty API call with Ruby and RSpec | ruby|rspec|httparty | 9 | 9,017 | 2 | 53,666,136 | 53,666,136 | 12 | true | 2018-12-06T15:10:31.130Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to test HTTParty API call with Ruby and RSpec<p>I am using the HTTParty gem to make a call to the GitHub API to access a list of user's repos.</p>
<p>It... |
53,496,146 | Should I use configMap for every environment variable?<p>I am using helm right now. My project is like that:</p>
<p><strong>values.yaml:</strong></p>
<pre><code>environmentVariables:
KEY1: VALUE1
KEY2: VALUE2
</code></pre>
<p><strong>configmap.yaml:</strong></p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadat... | <p>Aside from the points about separation of config from pods, one advantage of a ConfigMap is it lets you make the values of the variables accessible to other Pods or apps that are not necessarily part of your chart. </p>
<p>It does add a little extra complexity though and there can be a large element of preference a... | Should I use configMap for every environment variable? | kubernetes|kubernetes-helm | 9 | 11,293 | 3 | 53,571,968 | 53,571,968 | 13 | true | 2018-11-27T09:10:38.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Should I use configMap for every environment variable?<p>I am using helm right now. My project is like that:</p>
<p><strong>values.yaml:</strong></p>
<pre>... |
53,519,553 | Is it safe to remove old .PhpStorm directories<p>Each time I upgrade PhpStorm to a new point release I'm left with the previous version in my home directory. I now have directories for PhpStorm2017.1, PhpStorm2017.2, PhpStorm2017.3, PhpStorm2018.1, PhpStorm2018.2 and the current version PhpStorm2018.3. These are takin... | <p>Yes, it is safe to delete them if you will not go back to that version again (e.g. if you decide not to continue your subscription where you have a right to use your <a href="https://sales.jetbrains.com/hc/en-gb/articles/207240845-What-is-a-perpetual-fallback-license-" rel="nofollow noreferrer">1-year old version</a... | Is it safe to remove old .PhpStorm directories | phpstorm | 8 | 3,648 | 1 | 53,520,097 | 53,520,097 | 14 | true | 2018-11-28T12:32:00.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it safe to remove old .PhpStorm directories<p>Each time I upgrade PhpStorm to a new point release I'm left with the previous version in my home directory.... |
53,744,467 | Hyperledger Fabric - Error on Invoke / TLS handshake failed with error tls: first record does not look like a TLS handshake<p>Scope: This is a network with one channel composed of 3 Orgs, 1 anchor peer per organization, 1 CA per org and 1 MSP per org. </p>
<p>I'm facing an issue on my Hyperledger Fabric network relate... | <p>Seems like the orderer was expecting a tls connection but cli did not connect with tls.
Did you properly specify <code>--tls --cafile <orderer-cert></code> during invoke?</p> | Hyperledger Fabric - Error on Invoke / TLS handshake failed with error tls: first record does not look like a TLS handshake | ssl|hyperledger-fabric|handshake | 7 | 5,891 | 1 | 53,757,382 | 53,757,382 | 14 | true | 2018-12-12T13:47:02.550Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Hyperledger Fabric - Error on Invoke / TLS handshake failed with error tls: first record does not look like a TLS handshake<p>Scope: This is a network with o... |
53,549,786 | React Native Maps - new pricing<p>Since Google switched their pricing model, and Mobile Native Maps are still unlimited while Javascript SDK maps are limited to 28,000 per month as you can see
<a href="https://cloud.google.com/maps-platform/pricing/sheet/" rel="noreferrer">here</a>.</p>
<p>Does anyone know which categ... | <p>You can find answer in the documentation of react native maps</p>
<blockquote>
<p>The actual map implementation depends on the platform. On Android, one has to use Google Maps, which in turn requires you to obtain an API key for the <strong>Android SDK</strong>.</p>
<p>On iOS, one can choose between Google Maps or t... | React Native Maps - new pricing | google-maps|react-native|google-maps-api-3|react-native-maps | 12 | 6,145 | 1 | 53,573,149 | 53,573,149 | 16 | true | 2018-11-30T01:01:40.513Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React Native Maps - new pricing<p>Since Google switched their pricing model, and Mobile Native Maps are still unlimited while Javascript SDK maps are limited... |
53,602,669 | Mock a non-default function using Jest and React<p>In a test file I need to render a component while mocking out some of its sub components. The file structure would look loosely something like this.</p>
<p>File 1</p>
<pre><code>import {A, B} from 'a-module';
export function MyComponent() {
return (
<... | <p><strong>You can mock non defaults like this:</strong></p>
<pre><code>jest.mock('a-module', () => ({
__esModule: true,
default: () => 'Blah',
A: () => 'Blah',
B: () => 'Blah'
}));
</code></pre>
<p><a href="https://remarkablemark.org/blog/2018/06/28/jest-mock-default-named-export/" rel="noreferre... | Mock a non-default function using Jest and React | javascript|reactjs|unit-testing|webpack|jestjs | 8 | 4,899 | 3 | 53,651,298 | 53,651,298 | 16 | true | 2018-12-03T22:07:03.527Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mock a non-default function using Jest and React<p>In a test file I need to render a component while mocking out some of its sub components. The file structu... |
53,801,694 | Passing in parameter to Styled Components<p>How can I pass in an argument into Styled Components?</p>
<p>What I tried was to create an interface and a styled component:</p>
<pre><code>export interface StyledContainerProps {
topValue?: number;
}
export const StyledContainer: StyledComponentClass<StyledContainerP... | <p>Actually you should receive <code>cannot read property 'topValue' of undefined</code> error.</p>
<p>Use a function insead:</p>
<pre><code>top: ${({ topValue = 0 }) => topValue}px;
</code></pre>
<p>Also a little bonus - you can use argument destructuring and assign a default value for <code>topValue</code> if i... | Passing in parameter to Styled Components | reactjs|styled-components | 13 | 18,746 | 3 | 53,801,709 | 53,801,709 | 17 | true | 2018-12-16T11:30:16.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing in parameter to Styled Components<p>How can I pass in an argument into Styled Components?</p>
<p>What I tried was to create an interface and a style... |
53,518,739 | Kubernetes NGINX Ingress configmap 301 redirect<p>Using an NGINX Ingresss in Kubernetes, I can't see a way to forward my traffic from non-www to www, or to another domain etc on a per-host basis</p>
<p>I've tried looking in configmap docs but can't see what I need. Maybe it can go in the ingress itself?</p>
<p>I've a... | <p>Indeed a redirect is possible with a simple annotation:</p>
<ul>
<li><a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#permanent-redirect" rel="noreferrer"><code>nginx.ingress.kubernetes.io/permanent-redirect: https://www.gothereinstead.com</code></a></li>
<li><a href="... | Kubernetes NGINX Ingress configmap 301 redirect | kubernetes|nginx-ingress | 7 | 8,993 | 3 | 53,521,945 | 53,521,945 | 18 | true | 2018-11-28T11:46:55.210Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kubernetes NGINX Ingress configmap 301 redirect<p>Using an NGINX Ingresss in Kubernetes, I can't see a way to forward my traffic from non-www to www, or to a... |
53,788,639 | Best way to deploy react app with gitlab-ci?<p>I'm just getting started figuring out gitlab CI/CD. I have my own gitlab instance, and a couple runners, 1 shared, 1 project specific, both using docker engine.</p>
<p>Currently my staging server is its own VM that it hosts with docker-compose. I usually deploy to this ... | <p>You can take some clues from how GitLab itself uses its own CI, as described in "<a href="https://about.gitlab.com/2017/09/12/vuejs-app-gitlab/" rel="noreferrer">How to use GitLab CI for Vue.js</a>":</p>
<p>They have a dedicated deploy step:</p>
<pre><code>build site:
image: node:6
stage: build
script:
-... | Best way to deploy react app with gitlab-ci? | reactjs|git|docker|gitlab|gitlab-ci | 12 | 20,515 | 1 | 53,790,537 | 53,790,537 | 18 | true | 2018-12-15T00:51:12.330Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Best way to deploy react app with gitlab-ci?<p>I'm just getting started figuring out gitlab CI/CD. I have my own gitlab instance, and a couple runners, 1 sh... |
53,784,073 | Visual Studio for Mac can't deploy to compatible android emulator<p>I have a Xamarin.Forms project in Visual Studio for Mac. When I try to build the Android project, I get the following error message.</p>
<p>"You are deploying an app supporting <code>armeabi,armeabi-v7a,x86</code> ABIs to an incompatible device of AB... | <p>I was able to solve this by reading <a href="https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/cpu-architectures?tabs=macos" rel="noreferrer">this MS documentation</a>.</p>
<p>I had to double click on the android project to open the properties, click android build, and select all architectures liste... | Visual Studio for Mac can't deploy to compatible android emulator | android|macos|visual-studio|xamarin|xamarin.forms | 14 | 4,146 | 2 | 53,784,308 | 53,784,308 | 21 | true | 2018-12-14T17:05:06.837Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Visual Studio for Mac can't deploy to compatible android emulator<p>I have a Xamarin.Forms project in Visual Studio for Mac. When I try to build the Android... |
53,743,795 | How to check if a string column in pyspark dataframe is all numeric<p>I have a PySpark <code>Dataframe</code> with a column of <code>strings</code>. How can I check which rows in it are Numeric. I could not find any function in PySpark's <a href="http://spark.apache.org/docs/2.1.0/api/python/pyspark.sql.html" rel="nore... | <p>A simple cast would do the job : </p>
<pre><code>from pyspark.sql import functions as F
my_df.select(
"ID",
F.col("ID").cast("int").isNotNull().alias("Value ")
).show()
+-----+------+
| ID|Value |
+-----+------+
|25q36| false|
|75647| true|
|13864| true|
|8758K| false|
|07645| true|
+-----+------+
</code... | How to check if a string column in pyspark dataframe is all numeric | python|apache-spark|pyspark|apache-spark-sql|numeric | 17 | 36,152 | 7 | 53,744,630 | 53,744,630 | 24 | true | 2018-12-12T13:10:01.683Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to check if a string column in pyspark dataframe is all numeric<p>I have a PySpark <code>Dataframe</code> with a column of <code>strings</code>. How can ... |
53,670,702 | jq: error: test1/0 is not defined at <top-level>, line 1<p>I have below JSON file and facing error when trying to add values to array dynamically in the shell.</p>
<p>Below is a tmp.json file,</p>
<pre><code>{
"environments": {
"integration": [
"testing for jenkins job"
],
"prod": [],
"staging... | <p>You have some extra quotes in there and <code>test1</code> needs to be <code>["test1"]</code></p>
<p><code>jq ".environments.${Environment_Name} += [\"test1\"]" tmp.json</code></p> | jq: error: test1/0 is not defined at <top-level>, line 1 | shell|jq | 28 | 63,749 | 2 | 53,670,832 | 53,670,832 | 26 | true | 2018-12-07T13:36:38.640Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
jq: error: test1/0 is not defined at <top-level>, line 1<p>I have below JSON file and facing error when trying to add values to array dynamically in the shel... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.