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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
37,826,449 | Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style<p>When using eslint in the gulp project i have encountered a problem with error like this<br>
<code>Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style</code> and I am using Windows environment for the running gulp and the entire error log is ... | <p>Check if you have the <code>linebreak-style</code> rule configure as below either in your .eslintrc or in source code:</p>
<pre><code>/*eslint linebreak-style: ["error", "unix"]*/
</code></pre>
<p>Since you're working on Windows, you may want to use this rule instead:</p>
<pre><code>/*eslint linebreak-style: ["er... | Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style | javascript|gulp|eslint|line-endings | 277 | 383,504 | 19 | 37,826,625 | 37,826,625 | 304 | true | 2016-06-15T04:55:29.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style<p>When using eslint in the gulp project i have encountered a problem with error like this<br>... |
37,618,443 | Why can't bash recognize the existence of a socket file<p>On a Linux box I want to check if a specific socket file exists. I know the socket files exists, but my checks in bash don't show that to me:</p>
<pre><code>$ ls -l /var/run/supervisor.sock
srwxrw-rw- 1 root root 0 Jun 3 13:30 /var/run/supervisor.sock # <=... | <p><a href="http://www.tldp.org/LDP/abs/html/fto.html" rel="noreferrer">http://www.tldp.org/LDP/abs/html/fto.html</a></p>
<p>Use <code>-S</code> to test if its a socket. <code>-f</code> is for regular files.</p>
<p>See <code>man 1 test</code>:</p>
<pre><code> -e FILE
FILE exists
-f FILE
FILE... | Why can't bash recognize the existence of a socket file | linux|bash|file|sockets | 20 | 10,769 | 1 | 37,618,542 | 37,618,542 | 51 | true | 2016-06-03T15:38:09.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can't bash recognize the existence of a socket file<p>On a Linux box I want to check if a specific socket file exists. I know the socket files exists, bu... |
37,625,334 | python/pandas: convert month int to month name<p>Most of the info I found was not in python>pandas>dataframe hence the question.</p>
<p>I want to transform an integer between 1 and 12 into an abbrieviated month name.</p>
<p>I have a df which looks like:</p>
<pre><code> client Month
1 sss 02
2 yyy 12
3 www... | <p>You can do this efficiently with combining <code>calendar.month_abbr</code> and <code>df[col].apply()</code></p>
<pre><code>import calendar
df['Month'] = df['Month'].apply(lambda x: calendar.month_abbr[x])
</code></pre> | python/pandas: convert month int to month name | python|date|pandas|dataframe|monthcalendar | 43 | 104,448 | 12 | 37,625,467 | 37,625,467 | 56 | true | 2016-06-04T00:58:58.247Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python/pandas: convert month int to month name<p>Most of the info I found was not in python>pandas>dataframe hence the question.</p>
<p>I want to transform ... |
37,838,778 | Destructuring object and ignore one of the results<p>I have:</p>
<pre><code>const section = cloneElement(this.props.children, {
className: this.props.styles.section,
...this.props,
});
</code></pre>
<p>Inside <code>this.props</code>, I have a <code>styles</code> property that I don't want to pass to the cloned el... | <p>You can use the <a href="https://github.com/sebmarkbage/ecmascript-rest-spread" rel="noreferrer">object rest/spread syntax</a>:</p>
<pre><code>// We destructure our "this.props" creating a 'styles' variable and
// using the object rest syntax we put the rest of the properties available
// from "this.props" into a v... | Destructuring object and ignore one of the results | javascript|reactjs|destructuring|ecmascript-next | 45 | 33,597 | 4 | 37,838,826 | 37,838,826 | 67 | true | 2016-06-15T14:48:59.113Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Destructuring object and ignore one of the results<p>I have:</p>
<pre><code>const section = cloneElement(this.props.children, {
className: this.props.styl... |
37,705,599 | Angular2 testing: What's the difference between a DebugElement and a NativeElement object in a ComponentFixture?<p>I'm currently putting together some best practices for testing Angular 2 apps on a component level.</p>
<p>I've seen a few tutorials query a fixture's NativeElement object for selectors and the like, e.g.... | <ul>
<li><code>nativeElement</code> returns a reference to the DOM element</li>
<li><code>DebugElement</code> is an Angular2 class that contains all kinds of references and methods relevant to investigate an element or component (See the <a href="https://github.com/angular/angular/blob/bb8976608db93b9ff90a71187608a4390... | Angular2 testing: What's the difference between a DebugElement and a NativeElement object in a ComponentFixture? | javascript|unit-testing|dom|angular|jasmine | 86 | 39,476 | 4 | 37,705,853 | 37,705,853 | 69 | true | 2016-06-08T14:37:03.520Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular2 testing: What's the difference between a DebugElement and a NativeElement object in a ComponentFixture?<p>I'm currently putting together some best p... |
37,839,867 | Django error. Cannot assign must be an instance<p>I get the following error when I try to run an insert into one of my tables.</p>
<blockquote>
<p>Cannot assign "1": "Team.department_id" must be a "Department" instance</p>
</blockquote>
<p>Admittedly I'm slightly unsure if I'm using the foreign key concept correctl... | <p>You don't need to pass the department id, the instance itself is enough. The following should work just fine:</p>
<pre><code>new_team = Team(
nickname = team_name,
employee_id = employee_id,
department_id = Department.objects.get(password = password, department_name = department_name)
)
</code></pre>
<... | Django error. Cannot assign must be an instance | python|django|model|foreign-keys | 41 | 59,461 | 2 | 37,840,037 | 37,840,037 | 69 | true | 2016-06-15T15:36:08.570Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django error. Cannot assign must be an instance<p>I get the following error when I try to run an insert into one of my tables.</p>
<blockquote>
<p>Cannot ... |
37,735,055 | Laravel Database Schema, Nullable Foreign<p>I've these two database tables:</p>
<ol>
<li>User Tables</li>
<li>Partner Tables</li>
</ol>
<p><strong>User Tables</strong> will handle this kind of informations</p>
<pre><code>Schema::create('users', function (Blueprint $table) {
$table->increments('id')->uniq... | <p>Set the <code>country_id</code> and the <code>state_id</code> nullable, like so.</p>
<pre><code>$table->integer('country_id')->nullable()->unsigned();
$table->integer('state_id')->nullable()->unsigned();
</code></pre> | Laravel Database Schema, Nullable Foreign | php|mysql|database|laravel | 63 | 75,830 | 6 | 37,735,206 | 37,735,206 | 76 | true | 2016-06-09T19:54:12.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel Database Schema, Nullable Foreign<p>I've these two database tables:</p>
<ol>
<li>User Tables</li>
<li>Partner Tables</li>
</ol>
<p><strong>User Tab... |
37,661,119 | python mpl_toolkits installation issue<p>After command <code>pip install mpl_toolkits</code> I receive next error:</p>
<blockquote>
<p>Could not find a version that satisfies the requirement mpl_toolkits (from versions: )</p>
<p>No matching distribution found for mpl_toolkits</p>
</blockquote>
<p>I tried to go... | <p><em>It is not on PyPI and you should not be installing it via <code>pip</code></em>. If you have <code>matplotlib</code> installed, you should be able to import <code>mpl_toolkits</code> directly:</p>
<pre><code>$ pip install --upgrade matplotlib
...
$ python
>>> import mpl_toolkits
>>>
</code><... | python mpl_toolkits installation issue | python|python-3.x|pip | 61 | 149,515 | 5 | 37,661,312 | 37,661,312 | 91 | true | 2016-06-06T15:21:52.503Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python mpl_toolkits installation issue<p>After command <code>pip install mpl_toolkits</code> I receive next error:</p>
<blockquote>
<p>Could not find a ve... |
37,754,948 | How to get the indices list of all NaN value in numpy array?<p>Say now I have a numpy array which is defined as,</p>
<pre><code>[[1,2,3,4],
[2,3,NaN,5],
[NaN,5,2,3]]
</code></pre>
<p>Now I want to have a list that contains all the indices of the missing values, which is <code>[(1,2),(2,0)]</code> at this case.</p>
<... | <p><a href="http://docs.scipy.org/doc/numpy-1.10.1/reference/generated/numpy.isnan.html">np.isnan</a> combined with <a href="http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.argwhere.html">np.argwhere</a></p>
<pre><code>x = np.array([[1,2,3,4],
[2,3,np.nan,5],
[np.nan,5,2,3]... | How to get the indices list of all NaN value in numpy array? | python|numpy|scipy | 114 | 189,195 | 3 | 37,755,016 | 37,755,016 | 196 | true | 2016-06-10T18:26:38.450Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the indices list of all NaN value in numpy array?<p>Say now I have a numpy array which is defined as,</p>
<pre><code>[[1,2,3,4],
[2,3,NaN,5],
[Na... |
37,631,648 | Convert a file path to a URL in asp.net core<p>What the simplest way to convert a file path to a absolute url. Example:</p>
<h2>file:</h2>
<pre><code>C:\myapp\src\SqlExpress\wwwroot\data\images\test.jpg
</code></pre>
<p>url:</p>
<pre><code>http://localhost/data/images/test.jpg
</code></pre> | <pre><code> static string Convert(string path)
{
return path.Replace(@"C:\myapp\src\SqlExpress\wwwroot", @"http://localhost").Replace('\\', '/');
}
static void Main(string[] args)
{
string url = Convert(@"C:\myapp\src\SqlExpress\wwwroot\data\images\test.jpg");
}
</code></pre> | Convert a file path to a URL in asp.net core | asp.net|asp.net-mvc | 7 | 7,702 | 2 | 37,632,303 | 37,632,303 | -1 | true | 2016-06-04T14:59:11.053Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert a file path to a URL in asp.net core<p>What the simplest way to convert a file path to a absolute url. Example:</p>
<h2>file:</h2>
<pre><code>C:\my... |
37,727,307 | Referencing class without name to use different static method in subclasses in TypeScript<p>In ES6, you can reference static methods via <code>this.constructor</code>:</p>
<pre><code>class MainClass {
static info() {
return "This is some information";
}
constructor() {
this.info = this.constructor.info()... | <p>Checkout this typescript code:</p>
<pre><code>class MainClass {
static info() {
return "This is some information";
}
info: string;
constructor() {
this.info = (this.constructor as any).info(); // Allows subclass to define different '.info()' method.
}
}
class ChildClass extends MainClass {
sta... | Referencing class without name to use different static method in subclasses in TypeScript | typescript|typescript1.8 | 7 | 2,621 | 2 | 37,729,030 | 37,729,030 | 3 | true | 2016-06-09T13:24:53.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Referencing class without name to use different static method in subclasses in TypeScript<p>In ES6, you can reference static methods via <code>this.construct... |
37,683,212 | Accessing an Angular service that may or may not exist<p>I'm working on an Angular project at the minute that is designed to very modular - <a href="https://stackoverflow.com/a/37675548/5436257">sections of the app can be enabled and disabled for different clients using Webpack.</a> This structure is working nicely for... | <p>This is probably the best way to accomplish what you want; however, in doing this, note that you are moving from <em><a href="https://en.wikipedia.org/wiki/Dependency_injection" rel="nofollow noreferrer">Dependency Injection</a></em> (DI) to <em><a href="https://en.wikipedia.org/wiki/Service_locator_pattern" rel="no... | Accessing an Angular service that may or may not exist | javascript|angularjs | 7 | 1,551 | 1 | 37,730,197 | 37,730,197 | 3 | true | 2016-06-07T15:15:10.180Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Accessing an Angular service that may or may not exist<p>I'm working on an Angular project at the minute that is designed to very modular - <a href="https://... |
37,621,040 | Adding new line within a textarea that's using asp.net razor markup<p>How do I add a newline after each item, in a textarea that's inside a Razor <code>@foreach</code> statement?</p>
<p>The code below displays everything on one line like...</p>
<p>12341524345634567654354487546765</p>
<p>When I want...</p>
<p>123415... | <p>You can add raw HTML with the HTML helper <code>@Html.Raw()</code>. In your case, something like this should work:</p>
<pre><code><textarea>
@foreach (var item in ViewData.Model)
{
@item["ACCT_ID"]
@Html.Raw("\n")
}
</textarea>
</code></pre>
<p>This will insert a raw newlin... | Adding new line within a textarea that's using asp.net razor markup | razor|foreach|textarea|newline|viewdata | 7 | 7,993 | 2 | 37,621,411 | 37,621,411 | 4 | true | 2016-06-03T18:17:11.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding new line within a textarea that's using asp.net razor markup<p>How do I add a newline after each item, in a textarea that's inside a Razor <code>@fore... |
37,673,650 | Modeling complex hierarchies in F#<p>I'm fairly new to F#, and I want to model things in the real world that have fairly complex "has-a" relationships. At the top of the hierarchy are four types, A - D, with these relationships:</p>
<pre><code>A
|
+--A
|
+--B
| |
| +--B
| |
| +--D
| |
| +--D
|
+--C
| |
: ... | <p>First, one very important thing: when you write </p>
<pre><code>type B_Parent = A | B
</code></pre>
<p>you are <strong>not</strong> declaring that <code>B_Parent</code> is a DU joining the two previously-defined types <code>A</code> and <code>B</code>. There is no syntax for that.</p>
<p>What the line above is ac... | Modeling complex hierarchies in F# | f# | 7 | 332 | 2 | 37,679,645 | 37,679,645 | 5 | true | 2016-06-07T07:57:28.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Modeling complex hierarchies in F#<p>I'm fairly new to F#, and I want to model things in the real world that have fairly complex "has-a" relationships. At th... |
37,737,187 | Prevent RecyclerView from scrolling under AppBarLayout before AppBarLayout is collapsed<p>I'm creating a <code>RecyclerView</code> with header where the header collapses as you scroll up the <code>RecyclerView</code>. I can achieve this very closely with the layout below, with a transparent <code>AppBarLayout</code>, a... | <p>Possible solution (untested). Add an <code>OnOffsetChangedListener</code> to your <code>AppBarLayout</code>, and keep note of the offset value. First, declare this field:</p>
<pre><code>private boolean shouldScroll = false;
</code></pre>
<p>Then, onCreate:</p>
<pre><code>AppBarLayout appbar = findViewById(...);
a... | Prevent RecyclerView from scrolling under AppBarLayout before AppBarLayout is collapsed | android|android-support-library|android-coordinatorlayout|android-design-library|android-appbarlayout | 7 | 4,414 | 3 | 37,779,606 | 37,779,606 | 5 | true | 2016-06-09T22:25:43.313Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Prevent RecyclerView from scrolling under AppBarLayout before AppBarLayout is collapsed<p>I'm creating a <code>RecyclerView</code> with header where the head... |
37,679,367 | Entity Framework Core - Customise Scaffolding<p>In Entity Framework 6 we can add the T4 templates the scaffolding uses by running</p>
<pre><code>Install-Package EntityFramework.CodeTemplates.CSharp
</code></pre>
<p>But in Entity Framework Core the scaffolding system does not appear to use T4 templates, nor does it se... | <p>There is a special, yet-to-be-documented hook to override design-time services:</p>
<pre><code>class Startup
{
public static void ConfigureDesignTimeServices(IServiceCollection services)
=> services.AddSingleton<EntityTypeWriter, MyEntityTypeWriter>();
}
</code></pre>
<p>Then implement your cu... | Entity Framework Core - Customise Scaffolding | c#|entity-framework-core | 11 | 4,941 | 2 | 37,683,689 | 37,683,689 | 7 | true | 2016-06-07T12:25:55.670Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Entity Framework Core - Customise Scaffolding<p>In Entity Framework 6 we can add the T4 templates the scaffolding uses by running</p>
<pre><code>Install-Pac... |
37,722,919 | Finding a distinct set of fields in MongoDB<p>I have the following JSON collection in MongoDB.</p>
<pre><code>{
"_id": ObjectId("57529381551673386c9150a6"),
"team_code": 3,
"team_id": 2
},
{
"_id": ObjectId("57529381551673386c91514a"),
"team_code": 4,
"team_id": 5
},
{
"_id": ObjectId("57... | <p>You can do this using the following <em>Aggregation Pipeline</em>:</p>
<pre><code>var distinctIdCode = { $group: { _id: { team_code: "$team_code", team_id: "$team_id" } } }
db.foo.aggregate([distinctIdCode])
</code></pre>
<p>This will give you:</p>
<pre><code>{ "_id" : { "team_code" : 4, "team_id" : 5 } }
{ "_id"... | Finding a distinct set of fields in MongoDB | mongodb|mongodb-query | 7 | 3,652 | 2 | 37,723,267 | 37,723,267 | 9 | true | 2016-06-09T10:07:40.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Finding a distinct set of fields in MongoDB<p>I have the following JSON collection in MongoDB.</p>
<pre><code>{
"_id": ObjectId("57529381551673386c9150a... |
37,700,730 | How do I configure a Jenkins Pipeline to be triggered by polling SubVersion?<p>We have been using Jenkins for Continuous Integration for some time.
A typical build job specifies the SVN repository and credentials in the "Source Code Management" section, then in the "Build Triggers" section we enable "Poll SCM" with a p... | <p>The solution that I have found to work is:</p>
<ol>
<li>Move the pipeline script into a file (the default is JenkinsFile) and store this in the root of my project in SubVersion.</li>
<li>Set my pipeline job definition source to "Pipeline script from SCM", enter the details of where to find my project in SubVersion ... | How do I configure a Jenkins Pipeline to be triggered by polling SubVersion? | svn|jenkins|triggers|jenkins-pipeline | 22 | 59,399 | 6 | 37,742,811 | 37,742,811 | 9 | true | 2016-06-08T11:04:37.800Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I configure a Jenkins Pipeline to be triggered by polling SubVersion?<p>We have been using Jenkins for Continuous Integration for some time.
A typical... |
37,769,985 | How to install older R version on CentOS<p>The installed version is 3.3.0. </p>
<p>I would like to install version 2.X but I don't know how. </p> | <p>Are you building from the tar.gz file? If so, you should be able to download any version you like, here's a folder with the files for 2.x versions:</p>
<p><a href="https://cran.r-project.org/src/base/R-2/" rel="noreferrer">https://cran.r-project.org/src/base/R-2/</a></p>
<p>EDIT to add:</p>
<p>You can try install... | How to install older R version on CentOS | r|centos | 8 | 14,352 | 3 | 37,770,096 | 37,770,096 | 9 | true | 2016-06-12T01:43:07.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to install older R version on CentOS<p>The installed version is 3.3.0. </p>
<p>I would like to install version 2.X but I don't know how. </p> |
37,662,433 | R 3d array to 2d matrix<p>Let's assume I have a 3d array of dimensions (x,y,z) and would like to restructure my data as a matrix of dimensions (x*y,z), something like:</p>
<pre><code>my_array <- array(1:600, dim=c(10,5,12))
my_matrix<-data.frame()
for (j in 1:5) {
for (i in 1:10) {
my_matrix <- rbind ... | <p>We can convert to a <code>matrix</code> by calling the <code>matrix</code> and specifying the dimensions</p>
<pre><code>res <- matrix(my_array, prod(dim(my_array)[1:2]), dim(my_array)[3])
all.equal(as.matrix(my_matrix), res, check.attributes=FALSE)
#[1] TRUE
</code></pre>
<p>NOTE: This will not change the origi... | R 3d array to 2d matrix | arrays|r|matrix | 10 | 12,550 | 3 | 37,662,478 | 37,662,478 | 11 | true | 2016-06-06T16:26:20.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R 3d array to 2d matrix<p>Let's assume I have a 3d array of dimensions (x,y,z) and would like to restructure my data as a matrix of dimensions (x*y,z), somet... |
37,705,974 | Why are multiprocessing.sharedctypes assignments so slow?<p>Here's a little bench-marking code to illustrate my question:</p>
<pre><code>import numpy as np
import multiprocessing as mp
# allocate memory
%time temp = mp.RawArray(np.ctypeslib.ctypes.c_uint16, int(1e8))
Wall time: 46.8 ms
# assign memory, very slow
%time... | <p>This is slow for the reasons given in <a href="https://stackoverflow.com/questions/33853543/demystifying-sharedctypes-performance">your second link</a>, and the solution is actually pretty simple: <strong>Bypass the (slow) <code>RawArray</code> slice assignment code</strong>, which in this case is inefficiently read... | Why are multiprocessing.sharedctypes assignments so slow? | python|multiprocessing|shared-memory | 9 | 4,127 | 3 | 37,708,824 | 37,708,824 | 11 | true | 2016-06-08T14:52:15.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why are multiprocessing.sharedctypes assignments so slow?<p>Here's a little bench-marking code to illustrate my question:</p>
<pre><code>import numpy as np
... |
37,744,720 | Bind with Butterknife to dynamically added view in android<p>How Can I bind the views present inside the Layout which is dynamically added to the parent view with ButterKnife.</p>
<p>I have a LinearLayout say <strong>container</strong>. And I have a custom layout which contains two buttons say this layout as <strong>c... | <p>You can bind views with ButterKnife present inside the child layout using <code>ViewHolder</code>, so add the inner class <code>BubbleViewHolder</code></p>
<pre><code>class BubbleViewHolder {
BubbleViewHolder(View view) {
ButterKnife.bind(this, view);
}
@OnClick(R.id.button_id)
void onMyBut... | Bind with Butterknife to dynamically added view in android | android|butterknife | 7 | 4,383 | 1 | 37,745,048 | 37,745,048 | 11 | true | 2016-06-10T09:30:00.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bind with Butterknife to dynamically added view in android<p>How Can I bind the views present inside the Layout which is dynamically added to the parent view... |
37,647,961 | How does pandas calculate skew<p>I'm calculating a coskew matrix and wanted to double check my calculation with pandas built in <code>skew</code> method. I could not reconcile how pandas performing the calculation.</p>
<p>define my series as:</p>
<pre><code>import pandas as pd
series = pd.Series(
{0: -0.0519174... | <p>I found <a href="http://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.stats.skew.html" rel="noreferrer"><code>scipy.stats.skew</code></a> with parameter <code>bias=False</code> return equal output, so I think in <code>pandas skew</code> is <code>bias=False</code> by default:</p>
<blockquote>
<p>bias : bo... | How does pandas calculate skew | python|pandas | 16 | 13,573 | 1 | 37,648,077 | 37,648,077 | 12 | true | 2016-06-06T00:00:10.527Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How does pandas calculate skew<p>I'm calculating a coskew matrix and wanted to double check my calculation with pandas built in <code>skew</code> method. I ... |
37,813,346 | Swashbuckle adding 200 OK response automatically to generated Swagger file<p>I am building swagger docs using Swashbuckle in my WebApi 2 project.</p>
<p>I have the following definition of the method:</p>
<pre class="lang-cs prettyprint-override"><code>[HttpPost]
[ResponseType(typeof(Reservation))]
[Route("reservation... | <p>You can remove the default response (200 OK) by decorating the method with the <code>SwaggerResponseRemoveDefaults</code> attribute.</p> | Swashbuckle adding 200 OK response automatically to generated Swagger file | c#|swagger|swashbuckle | 13 | 5,146 | 3 | 37,819,684 | 37,819,684 | 12 | true | 2016-06-14T13:22:27.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Swashbuckle adding 200 OK response automatically to generated Swagger file<p>I am building swagger docs using Swashbuckle in my WebApi 2 project.</p>
<p>I h... |
37,820,740 | rails database migrations using transactions<p>I'm just learning Rails and have begun the section on database migrations. I built 2 migrations and both migrated up successfully. Migrating down, the latest migration, the one that runs first, failed because of a typo in my code. I fixed the typo but the migration continu... | <p>Rails will already run your migrations inside a transaction <a href="http://edgeguides.rubyonrails.org/active_record_migrations.html#migration-overview" rel="noreferrer"><em>if your database supports it</em></a>:</p>
<blockquote>
<p>On databases that support transactions with statements that change the schema, mi... | rails database migrations using transactions | ruby-on-rails|database-migration | 9 | 6,989 | 1 | 37,820,766 | 37,820,766 | 12 | true | 2016-06-14T19:41:05.833Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
rails database migrations using transactions<p>I'm just learning Rails and have begun the section on database migrations. I built 2 migrations and both migra... |
37,749,891 | Converting GeoJSON response to FeatureCollection<p>Hi I am trying to parse the response from a OSM webservice into feature collection using GeoJson.Net</p>
<p>I am new to GeoJSON and not able to identify how to do so:</p>
<p>The Json response can be find <a href="https://a.data.osmbuildings.org/0.2/anonymous/tile/15/... | <p>I hate to answer my I question but after two days of hit & trial I get it working with both NetTopology and GeoJson</p>
<pre><code>// get the JSON file content
var josnData = File.ReadAllText(destinationFileName);
// create NetTopology JSON reader
var reader = new NetTopologySuite.IO.GeoJsonReader();
// pass ... | Converting GeoJSON response to FeatureCollection | c#|json|geojson|nettopologysuite | 10 | 13,381 | 2 | 37,795,899 | 37,795,899 | 14 | true | 2016-06-10T13:45:31.583Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Converting GeoJSON response to FeatureCollection<p>Hi I am trying to parse the response from a OSM webservice into feature collection using GeoJson.Net</p>
... |
37,841,005 | How to evaluate a string to filter an R data.table?<p>I was hoping for some help on passing a string of filter criteria into a data.table. I've tried all manners of parse and eval, and can't seem to figure it out</p>
<p>I tried to recreate an example using the <em>iris</em> dataset:</p>
<pre><code>iris <- data.ta... | <p>I think <code>eval(parse(text()))</code> will work, you just need some modifications. Try this:</p>
<pre><code>library(data.table)
iris <- data.table(iris)
#Updated so it will have quotes in your string
vars <- '\"setosa\"'
#Update so you can change your vars
filter <- paste0('Species==',vars,'& Pet... | How to evaluate a string to filter an R data.table? | r|data.table | 7 | 3,861 | 3 | 37,841,183 | 37,841,183 | 14 | true | 2016-06-15T16:32:46.270Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to evaluate a string to filter an R data.table?<p>I was hoping for some help on passing a string of filter criteria into a data.table. I've tried all ma... |
37,773,987 | How to start phoenixframework at host 0.0.0.0?<p>I tried to bind phoenix to <code>"0.0.0.0"</code> I tried in <code>config.exs</code> as:</p>
<pre><code>config :app, App.Endpoint,
url: [host: "0.0.0.0"],
</code></pre>
<p>And, I tried in <code>dev.exs</code> as:</p>
<pre><code>config :app, App.Endpoint,
http: [ho... | <p>You need to use the <code>ip</code> key for this in <code>http</code>, with the value being a 4 element tuple of integers representing the IP. In your case, it would look like:</p>
<pre><code>config :app, App.Endpoint,
http: [ip: {0, 0, 0, 0}, port: 4000]
</code></pre>
<p><a href="https://github.com/elixir-lang/... | How to start phoenixframework at host 0.0.0.0? | phoenix-framework | 7 | 2,120 | 1 | 37,777,279 | 37,777,279 | 15 | true | 2016-06-12T12:00:54.057Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to start phoenixframework at host 0.0.0.0?<p>I tried to bind phoenix to <code>"0.0.0.0"</code> I tried in <code>config.exs</code> as:</p>
<pre><code>con... |
37,635,016 | In a `facet_wrap`ed grid, center subplots at 0 while keeping `free_x`<p>In the plot below, I have a faceted grid.</p>
<p>Is there any way to center both subplots at <code>0</code>, while keeping different <code>min</code>/<code>max</code> values for the <code>x</code> axis?</p>
<p>In the case below that would be <cod... | <p>I've also needed something like this to display asymmetric spectra side-by-side,</p>
<p><a href="https://i.stack.imgur.com/oJwNa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oJwNa.png" alt="enter image description here"></a></p>
<p>Try this function,</p>
<pre><code>symmetrise_scale <- function(p, ... | In a `facet_wrap`ed grid, center subplots at 0 while keeping `free_x` | r|ggplot2 | 20 | 1,312 | 5 | 37,635,130 | 37,635,130 | 16 | true | 2016-06-04T21:05:05.993Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In a `facet_wrap`ed grid, center subplots at 0 while keeping `free_x`<p>In the plot below, I have a faceted grid.</p>
<p>Is there any way to center both sub... |
37,688,712 | Get client IP in Koa.js<p>I have a Koa app with a handler like this:</p>
<pre class="lang-js prettyprint-override"><code>router.get('/admin.html', function *(next) {
const clientIP = "?";
this.body = `Hello World ${clientIp}`;
});
</code></pre>
<p>where I need to acquire the client's IP address to form the re... | <p><strong>Koa 1:</strong></p>
<p>Assuming you have no reverse proxy in place, you can use <code>this.request.ip</code> like this:</p>
<pre class="lang-js prettyprint-override"><code>router.get('/admin.html', function *(next) {
const clientIP = this.request.ip;
this.body = `Hello World ${clientIP}`;
});
</cod... | Get client IP in Koa.js | javascript|node.js|koa | 10 | 14,132 | 3 | 37,688,713 | 37,688,713 | 16 | true | 2016-06-07T20:27:31.603Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get client IP in Koa.js<p>I have a Koa app with a handler like this:</p>
<pre class="lang-js prettyprint-override"><code>router.get('/admin.html', function ... |
37,748,949 | How to create desktop application using Angular 2<p>Is it possible to create Desktop(Windows OS) application using Angular 2?</p>
<p>If yes then how can we build setup for desktop? Will it support windows 7 and Earlier? </p>
<p>I noticed that, Angular 2 is for cross platform.</p> | <p>You can try using Electron (by GitHub): <a href="http://electron.atom.io/" rel="noreferrer">http://electron.atom.io/</a></p>
<p>Here an example using Electron + Angular 2: <a href="https://auth0.com/blog/2015/12/15/create-a-desktop-app-with-angular-2-and-electron/" rel="noreferrer">https://auth0.com/blog/2015/12/15... | How to create desktop application using Angular 2 | typescript|angular|desktop-application | 20 | 18,762 | 3 | 37,749,143 | 37,749,143 | 17 | true | 2016-06-10T13:00:22.393Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create desktop application using Angular 2<p>Is it possible to create Desktop(Windows OS) application using Angular 2?</p>
<p>If yes then how can we ... |
37,634,563 | FCM (Firebase Cloud Messaging) how to send to all Phones?<p>I have created a small App that's able to receive Push Notifications from the FCM Console.</p>
<p>What i want to do now is to send a Push-Notifications to all Android Phones that got the app Installed using the API. And this is where i got completely lost.
Is... | <p>Sending a message to all the phones like what you do from the Firebase Web Console is only possible from the Web Console.
If you need this feature from the API you can submit a feature request:
<a href="https://firebase.google.com/support/contact/bugs-features/" rel="noreferrer">https://firebase.google.com/support/c... | FCM (Firebase Cloud Messaging) how to send to all Phones? | android|push-notification|google-api|firebase|firebase-cloud-messaging | 10 | 7,474 | 1 | 37,636,149 | 37,636,149 | 18 | true | 2016-06-04T20:10:44Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
FCM (Firebase Cloud Messaging) how to send to all Phones?<p>I have created a small App that's able to receive Push Notifications from the FCM Console.</p>
<... |
37,806,933 | Firebase Analytics - Open and Closed Funnel Tracking<p>I have been reading a bit about Firebase Analytics now, and because it is mostly an event-based data model, I assume one can not do screen tracking directly?</p>
<p>I was wandering whether one should then just pass the screen type/name as part of the event's param... | <p>Until Screen Tracking and User Flows become available, the closest alternatives are :</p>
<ol>
<li>To log a distinct event for each screen (e.g. "welcome_menu") and to use a <a href="https://support.google.com/firebase/answer/6317523?hl=en&ref_topic=6317489">Funnel</a> to visualize the flow through a sequence o... | Firebase Analytics - Open and Closed Funnel Tracking | firebase-analytics | 17 | 12,860 | 2 | 37,813,768 | 37,813,768 | 18 | true | 2016-06-14T08:37:16.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Firebase Analytics - Open and Closed Funnel Tracking<p>I have been reading a bit about Firebase Analytics now, and because it is mostly an event-based data m... |
37,798,056 | Getting deprecation warning in Sklearn over 1d array, despite not having a 1D array<p>I am trying to use SKLearn to run an SVM model. I am just trying it out now with some sample data. Here is the data and the code:</p>
<pre><code>import numpy as np
from sklearn import svm
import random as random
A = np.array([[rando... | <p>The error is coming from the predict method. Numpy will interpret [1,1] as a 1d array. So this should avoid the warning:</p>
<p><code>clf.predict(np.array([[1,1]]))</code></p>
<p>Notice that:</p>
<pre><code>In [14]: p1 = np.array([1,1])
In [15]: p1.shape
Out[15]: (2,)
In [16]: p2 = np.array([[1,1]])
In [17]: p... | Getting deprecation warning in Sklearn over 1d array, despite not having a 1D array | python|scikit-learn|svm | 15 | 8,713 | 3 | 37,798,323 | 37,798,323 | 20 | true | 2016-06-13T19:51:38.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting deprecation warning in Sklearn over 1d array, despite not having a 1D array<p>I am trying to use SKLearn to run an SVM model. I am just trying it out... |
37,729,066 | Set POJO for Gson when JSON key has a dash<p>The JSON string is:</p>
<pre><code>{
"translation": ["some words"],
"basic": {
"us-phonetic": "'flæbɚɡæstɪd",
"phonetic": "'flæbɚɡæstɪd",
"uk-phonetic": "'flæbəga:stid",
"explains": ["v. some words",
"adj. some words"
... | <p>Create a <code>POJO</code> class to represent your <code>JSON</code> and decorate your fields with the <code>SerializedName</code> annotation.</p>
<p><code>gson</code> uses <code>@SerializedName("json_name")</code> when the name of the <code>JSON</code> field and the name of the java field are different. </p>
<p>I... | Set POJO for Gson when JSON key has a dash | java|android|json|gson | 7 | 3,600 | 1 | 37,729,598 | 37,729,598 | 22 | true | 2016-06-09T14:40:49.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set POJO for Gson when JSON key has a dash<p>The JSON string is:</p>
<pre><code>{
"translation": ["some words"],
"basic": {
"us-phonetic": "... |
37,765,307 | Why use apps.get_model() when creating a data migration?<p>As per the django docs when creating django migrations we should use apps.get_model() rather than importing the models and using them.</p>
<p>Why does a data migration have to use the historical version of a model rather than the latest one?(The historical ver... | <p>It uses the historical versions of the model so that it won't have problems trying to access fields that may no longer exist in the code base when you run your migrations against another database.</p>
<p>If you removed some field from your model and then wanted to run your migrations on some new database, and you w... | Why use apps.get_model() when creating a data migration? | django-models|django-migrations | 12 | 4,885 | 2 | 37,769,213 | 37,769,213 | 23 | true | 2016-06-11T15:16:55.190Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why use apps.get_model() when creating a data migration?<p>As per the django docs when creating django migrations we should use apps.get_model() rather than ... |
37,611,731 | Will FCM Token change periodically like GCM registration ID?<p>I have published apps in playstore that use GCM and I have a plan to migrate using FCM. everything information i needed have found, but i have one question that not find answer yet. my question is when token have been created, are token will be change perio... | <p>Similarly to how GCM works, the FCM token can change due to token-rotation.</p>
<p>You can intercept the token rotation implementing the callback: <code>FirebaseInstanceId.onTokenRefresh()</code></p>
<p><a href="https://firebase.google.com/docs/cloud-messaging/android/client#sample-register" rel="noreferrer">https... | Will FCM Token change periodically like GCM registration ID? | android|firebase|google-cloud-messaging|firebase-cloud-messaging | 16 | 17,197 | 1 | 37,619,900 | 37,619,900 | 24 | true | 2016-06-03T10:17:34.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Will FCM Token change periodically like GCM registration ID?<p>I have published apps in playstore that use GCM and I have a plan to migrate using FCM. everyt... |
37,638,476 | Sequelize query is giving TypeError: undefined is not a function<p>I'm using express and sequelize for my node application. On the controller file, I have the following:</p>
<pre><code>var models = require('../models'),
Property = models.property,
Sequelize = require('sequelize');
module... | <p>You need to be calling <code>query()</code> on a <em><code>Sequelize</code> instance</em> instead:</p>
<pre><code>var Sequelize = require('sequelize');
var sequelize = new Sequelize('database', 'username', 'password');
sequelize.query("SELECT * FROM 'property'", { type:Sequelize.QueryTypes.SELECT})
.then(functi... | Sequelize query is giving TypeError: undefined is not a function | node.js|sequelize.js | 15 | 18,962 | 3 | 37,638,543 | 37,638,543 | 24 | true | 2016-06-05T04:30:51.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sequelize query is giving TypeError: undefined is not a function<p>I'm using express and sequelize for my node application. On the controller file, I have th... |
37,763,170 | Git signed commits - How to suppress "You need a passphrase to unlock the secret key..."<p>I changed my global Git configuration to sign all commits. I also use gpg-agent so that I don't have to type my password every time.</p>
<p>Now every time I make a new commit I see the following five lines printed to my console:... | <p>This is more a gpg configuration issue than a git one.</p>
<p>Since you are using an agent, you could as a workaround add <code>no-tty</code> to your <code>gpg.conf</code>. </p>
<pre><code>echo 'no-tty' >> ~/.gnupg/gpg.conf
</code></pre>
<p>(this seems <a href="https://unix.stackexchange.com/a/212953/7490">... | Git signed commits - How to suppress "You need a passphrase to unlock the secret key..." | git|gnupg|git-commit | 23 | 11,024 | 2 | 37,763,552 | 37,763,552 | 24 | true | 2016-06-11T11:24:54.797Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Git signed commits - How to suppress "You need a passphrase to unlock the secret key..."<p>I changed my global Git configuration to sign all commits. I also ... |
37,690,538 | In laravel how to pass extra data to mutators and accessors<p>What I'm trying to do is to append the comments of each article to the articles object, but the problem is that I need to request different number of comments each time.</p>
<p>and for some reason I need to use <strong>mutators</strong> for that, because so... | <p>Judging from the Laravel source code, no – it's not possible to pass an extra argument to this magic accessor method.</p>
<p>The easiest solution is just to add another, extra method in your class that does accept any parameters you wish – and you can use that method instead of magic property.</p>
<p>Eg. simply re... | In laravel how to pass extra data to mutators and accessors | php|rest|laravel|laravel-5 | 16 | 19,482 | 4 | 37,690,942 | 37,690,942 | 26 | true | 2016-06-07T22:38:24.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In laravel how to pass extra data to mutators and accessors<p>What I'm trying to do is to append the comments of each article to the articles object, but the... |
37,609,749 | How to log type assertion errors in golang?<p>I have an array of some data which I want to map in <code>[]string</code>. I can do it in 2 ways:</p>
<p>a)</p>
<pre><code>// someData
s := someData.([]string)
</code></pre>
<p>In this case, the execution would stop after listing the error on the console.</p>
<p>b)</p>
... | <p>You can construct the log message yourself. There's no need for explicit calls to <code>reflect</code> as there's a printf format string <code>%T</code> that produces the type.</p>
<pre><code>s, ok := someData.([]string)
if !ok {
log.Printf("got data of type %T but wanted []string", someData)
... handle the... | How to log type assertion errors in golang? | go|error-handling|type-assertion | 18 | 14,375 | 2 | 37,610,016 | 37,610,016 | 28 | true | 2016-06-03T08:39:24.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to log type assertion errors in golang?<p>I have an array of some data which I want to map in <code>[]string</code>. I can do it in 2 ways:</p>
<p>a)</p... |
37,700,854 | Why is adding a reference to a rvalue reference not an error?<p>I have the following typedef:</p>
<pre><code>using int_ref = int&&;
</code></pre>
<p>Why does the following code not produce an error (or print <code>false</code>)?</p>
<pre><code>std::cout << is_same< int_ref, int_ref&& >::v... | <p>This is due to <a href="https://stackoverflow.com/questions/13725747/concise-explanation-of-reference-collapsing-rules-requested-1-a-a-2">reference collapsing rules</a>.</p>
<p>Basically, although you can't write a reference to a reference yourself, in some cases (typedefs, template parameters, decltypes) you can a... | Why is adding a reference to a rvalue reference not an error? | c++|c++11 | 15 | 830 | 1 | 37,700,945 | 37,700,945 | 28 | true | 2016-06-08T11:10:09.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is adding a reference to a rvalue reference not an error?<p>I have the following typedef:</p>
<pre><code>using int_ref = int&&;
</code></pre>
<... |
37,636,580 | Heroku + node.js: I have a server which uses multiple ports. How can I get Heroku to allocate them?<p>Umm I'll try to be more clear..</p>
<p>In an application server I have written in node.js, I have inner-proxy for multiple ports:</p>
<ul>
<li>in my <code>8080</code> port I have my <strong>rest api</strong>.</li>
<l... | <p>Okay, after doing some research I've found out that opening ports in Heroku is <strong>disabled</strong> and <strong>not allowed</strong>.</p>
<p>The <strong>only way</strong> around this is to use <strong>sub-domains</strong> and then in-app to use a proxy module (like <code>subdomain-router</code> which I use).</... | Heroku + node.js: I have a server which uses multiple ports. How can I get Heroku to allocate them? | node.js|heroku|deployment|port|subdomain | 39 | 17,731 | 3 | 37,645,044 | 37,645,044 | 33 | true | 2016-06-05T01:26:53.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Heroku + node.js: I have a server which uses multiple ports. How can I get Heroku to allocate them?<p>Umm I'll try to be more clear..</p>
<p>In an applicati... |
37,806,982 | Difference between static function and singleton class in swift<p>I want to create a class where all utility methods will be kept and these methods will be used throughout the app.<br>
<strong>Problem:1</strong><br>
Is it good to create a singleton class and keep all necessary methods there or should I create a class w... | <p>Sure this sounds confusing and can be debated. However, from the best practices i can put some suggestions. </p>
<p><strong>Singleton</strong> is usually used to create a resource intensive and one timer initialisation for instance: a database connector, login handler and such. </p>
<p><strong>Utility class</stron... | Difference between static function and singleton class in swift | ios|swift|singleton|static-methods | 41 | 12,348 | 3 | 37,812,213 | 37,812,213 | 42 | true | 2016-06-14T08:39:54.467Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Difference between static function and singleton class in swift<p>I want to create a class where all utility methods will be kept and these methods will be u... |
37,642,837 | Gradle: Make build version available to Java<p>By default, all gradle java projects have a <code>version</code> property. Typically, this looks something like:</p>
<pre><code>allprojects {
apply plugin: 'java'
// ...
// configure the group and version for this project
group = 'org.example'
version... | <p>Assuming your Gradle script inserts the <code>version</code> into the jar manifest correctly, as shown <a href="https://docs.gradle.org/current/userguide/tutorial_java_projects.html#N14D50" rel="noreferrer">here</a>:</p>
<pre><code>version = '1.0'
jar {
manifest {
attributes 'Implementation-Title': 'Gra... | Gradle: Make build version available to Java | java|gradle|build|version | 20 | 12,869 | 1 | 37,643,233 | 37,643,233 | 43 | true | 2016-06-05T14:08:51.150Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Gradle: Make build version available to Java<p>By default, all gradle java projects have a <code>version</code> property. Typically, this looks something lik... |
37,660,694 | Add legend to geom_vline<p>I know that this question has been asked before but the solutions don't seem to work for me. </p>
<p>What I want to do is represent my median, mean, upper and lower quantiles on a histogram in different colours and then add a legend to the plot. This is what I have so far and I have tried to... | <p>You need to map the color inside the <code>aes</code>:</p>
<pre><code>ggplot(aes(x = Sepal.Length), data = iris) +
geom_histogram(color = 'black', fill = NA) +
geom_vline(aes(xintercept=median(iris$Sepal.Length),
color="median"), linetype="dashed",
size=1) +
geom_vline(aes(xint... | Add legend to geom_vline | r|ggplot2 | 27 | 24,634 | 1 | 37,661,001 | 37,661,001 | 49 | true | 2016-06-06T15:00:46.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add legend to geom_vline<p>I know that this question has been asked before but the solutions don't seem to work for me. </p>
<p>What I want to do is represe... |
37,746,428 | Java Spring - how to handle missing required request parameters<p>Consider the following mapping:</p>
<pre><code>@RequestMapping(value = "/superDuperPage", method = RequestMethod.GET)
public String superDuperPage(@RequestParam(value = "someParameter", required = true) String parameter)
{
return "somePage";
}
</cod... | <p>If a required <code>@RequestParam</code> is not present in the request, Spring will throw a <a href="http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/bind/MissingServletRequestParameterException.html"><code>MissingServletRequestParameterException</code></a> exception. You can define an <... | Java Spring - how to handle missing required request parameters | java|spring|spring-mvc | 44 | 65,808 | 4 | 37,746,557 | 37,746,557 | 65 | true | 2016-06-10T10:53:02.460Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java Spring - how to handle missing required request parameters<p>Consider the following mapping:</p>
<pre><code>@RequestMapping(value = "/superDuperPage", ... |
37,639,276 | When should inline be used in Rust?<p>Rust has an "inline" attribute that can be used in one of those three flavors:</p>
<p><code>#[inline]</code></p>
<p><code>#[inline(always)]</code></p>
<p><code>#[inline(never)]</code></p>
<p>When should they be used?</p>
<p>In the Rust reference, we see <a href="https://doc.ru... | <p>One limitation of the current Rust compiler is that it if you're not using LTO (Link-Time Optimization), it will never inline a function not marked <code>#[inline]</code> across crates. Rust uses a separate compilation model similar to C++ because LLVM's LTO implementation doesn't scale well to large projects. There... | When should inline be used in Rust? | rust|inline|llvm-codegen | 112 | 23,111 | 1 | 37,639,889 | 37,639,889 | 85 | true | 2016-06-05T06:58:18.267Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When should inline be used in Rust?<p>Rust has an "inline" attribute that can be used in one of those three flavors:</p>
<p><code>#[inline]</code></p>
<p><... |
37,707,305 | PySpark: multiple conditions in when clause<p>I would like to modify the cell values of a dataframe column (Age) where currently it is blank and I would only do it if another column (Survived) has the value 0 for the corresponding row where it is blank for Age. If it is 1 in the Survived column but blank in Age column... | <p>You get <code>SyntaxError</code> error exception because Python has no <code>&&</code> operator. It has <code>and</code> and <code>&</code> where the latter one is the correct choice to create boolean expressions on <code>Column</code> (<code>|</code> for a logical disjunction and <code>~</code> for lo... | PySpark: multiple conditions in when clause | python|apache-spark|dataframe|pyspark|apache-spark-sql | 60 | 217,627 | 4 | 37,712,867 | 37,712,867 | 137 | true | 2016-06-08T15:51:36.990Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PySpark: multiple conditions in when clause<p>I would like to modify the cell values of a dataframe column (Age) where currently it is blank and I would only... |
37,683,143 | Extract passphrase from Jenkins' credentials.xml<p>I have added an SSH credential to Jenkins.</p>
<p>Unfortunately, I have forgotten the SSH passphrase and would now like to obtain it from Jenkins' credential archive, which is located at <code>${JENKINS_HOME}/credentials.xml</code>.</p>
<p>That XML document seems to ... | <p>Open your Jenkins' installation's script console by visiting <code>http(s)://${JENKINS_ADDRESS}/script</code>.</p>
<p>There, execute the following Groovy script:</p>
<pre><code>println( hudson.util.Secret.decrypt("${ENCRYPTED_PASSPHRASE_OR_PASSWORD}") )
</code></pre>
<p>where <code>${ENCRYPTED_PASSPHRASE_OR_PASSW... | Extract passphrase from Jenkins' credentials.xml | jenkins | 80 | 81,723 | 5 | 37,683,492 | 37,683,492 | 185 | true | 2016-06-07T15:12:12.043Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extract passphrase from Jenkins' credentials.xml<p>I have added an SSH credential to Jenkins.</p>
<p>Unfortunately, I have forgotten the SSH passphrase and ... |
37,658,957 | No component found for view with name "ARTShape"<p>Just trying to produce an hello-world for using the ART object in React Native, I get the above exception as if part of the library were not linked. I just added the following code:</p>
<pre><code>import {
AppRegistry,
StyleSheet,
Text,
View,
ART
} from 're... | <p>You have to get all your <code>ART</code> components wrapped with the <code>Surface</code> element.</p>
<pre><code>const { Surface, Shape } = ART;
</code></pre>
<p>... </p>
<pre><code><Surface width={ 100 } height={100}>
<Shape></Shape>
</Surface>
</code></pre> | No component found for view with name "ARTShape" | react-native | 14 | 12,066 | 5 | 37,770,638 | 37,770,638 | 2 | true | 2016-06-06T13:36:46.220Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
No component found for view with name "ARTShape"<p>Just trying to produce an hello-world for using the ART object in React Native, I get the above exception ... |
37,796,689 | Python: How can I sort file line by line in lexicographic order and write result to file?<p>I'm a beginner in Python and having trouble understanding this question. Can someone check to see if my code reflects the instructions / how to fix it? Thank you!</p>
<p>Question: Write a function sortFile(src, dst) that sorts ... | <p>I would use file.write(string) to write to the ouput file:</p>
<pre><code>def sortFile(src, dst):
x, y = open(src, 'r'), open(dst, 'w')
b = x.readlines()
x.close()
b.sort()
for i in b:
y.write(i.strip() + "\n")
y.close()
</code></pre>
<p>I tested this and it should produce the corre... | Python: How can I sort file line by line in lexicographic order and write result to file? | python|sorting | -4 | 828 | 1 | 37,796,830 | 37,796,830 | 2 | true | 2016-06-13T18:24:03.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python: How can I sort file line by line in lexicographic order and write result to file?<p>I'm a beginner in Python and having trouble understanding this qu... |
37,802,947 | VisitDecl vs. TraverseDecl (Clang RecursiveASTVisitor)<p>I've read this link but still don't fully understand what's the difference between TraverseDecl and VisitDecl (and their use case) <a href="http://clang.llvm.org/doxygen/classclang_1_1RecursiveASTVisitor.html" rel="noreferrer">http://clang.llvm.org/doxygen/classc... | <p>TraverseDecl tells the frontend library's ASTConsumer to visit declarations recursively from the AST. Then VisitDecl is called where you can extract the relevant information. </p>
<p>Follow these two links for more details and a simple checker example: </p>
<p><a href="http://clang.llvm.org/docs/RAVFrontendAction.... | VisitDecl vs. TraverseDecl (Clang RecursiveASTVisitor) | c++|clang|abstract-syntax-tree|static-analysis|llvm-clang | 7 | 2,826 | 1 | 37,817,218 | 37,817,218 | 4 | true | 2016-06-14T04:23:11.377Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VisitDecl vs. TraverseDecl (Clang RecursiveASTVisitor)<p>I've read this link but still don't fully understand what's the difference between TraverseDecl and ... |
37,603,475 | Use gpg to sign git commits in eclipse<p>There is this nice feature from github to show that a git commit is signed using a gpg key.</p>
<p>I followed the following articles:</p>
<ul>
<li><a href="https://help.github.com/articles/adding-a-new-gpg-key-to-your-github-account/" rel="noreferrer">https://help.github.com/a... | <p>It seems to be a missing feature of EGit, you should probably suggest this enhancement to <a href="http://bugs.eclipse.org" rel="noreferrer">http://bugs.eclipse.org</a> .</p> | Use gpg to sign git commits in eclipse | eclipse|git|gnupg | 9 | 4,391 | 5 | 37,607,388 | 37,607,388 | 6 | true | 2016-06-02T23:01:13.917Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use gpg to sign git commits in eclipse<p>There is this nice feature from github to show that a git commit is signed using a gpg key.</p>
<p>I followed the f... |
37,820,824 | Execute angular code before Karma run all tests?<p>Is it possible to execute some sort of initialization coding in karma? I need to run a code like this before my tests get executed:</p>
<pre><code>angular.module('module.common.brand', []).constant('BRAND', 'brandname');
</code></pre>
<p>My app currently requires thi... | <p>As any other JS file, initialization file should be specified in Karma configuration (<code>files</code> option), right before <code>test/*.spec.js</code>.</p> | Execute angular code before Karma run all tests? | angularjs|karma-runner|karma-jasmine | 7 | 3,900 | 1 | 37,822,503 | 37,822,503 | 6 | true | 2016-06-14T19:46:36.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Execute angular code before Karma run all tests?<p>Is it possible to execute some sort of initialization coding in karma? I need to run a code like this befo... |
37,809,520 | Is an Azure App Service IP Address considered a static IP for DNS purposes?<p>I can't find any information about whether or not the IP address that Azure App Services gives you to add to your DNS A record for custom domains is a truly fixed IP address.</p>
<p>As far as I can tell you can't use Reserved IP's for App Se... | <p>from the <a href="https://azure.microsoft.com/en-us/documentation/articles/web-sites-custom-domain-name/" rel="noreferrer">page</a> you linked to </p>
<blockquote>
<p><strong>Note:</strong><br>
The IP address may change if you delete and recreate your web app, or change the web app mode back to free.</p>
</bloc... | Is an Azure App Service IP Address considered a static IP for DNS purposes? | azure|dns|ip-address|static-ip-address|azure-web-app-service | 10 | 16,927 | 3 | 37,809,996 | 37,809,996 | 8 | true | 2016-06-14T10:32:47.210Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is an Azure App Service IP Address considered a static IP for DNS purposes?<p>I can't find any information about whether or not the IP address that Azure App... |
37,736,496 | SSE: unaligned load and store that crosses page boundary<p>I read somewhere that before performing unaligned load or store next to page boundary (e.g. using <code>_mm_loadu_si128</code> / <code>_mm_storeu_si128</code> intrinsics), code should first check if whole vector (in this case 16 bytes) belongs to the same page,... | <p>Page-line splits are bad for performance, but don't affect correctness of unaligned accesses. <strong>It is enough to make sure you don't read past the end of the buffer</strong>, when you know the length ahead of time.</p>
<hr>
<p>For correctness, you often need to worry about it when implementing something like... | SSE: unaligned load and store that crosses page boundary | c|linux|x86-64|sse|memory-alignment | 8 | 1,293 | 1 | 37,738,743 | 37,738,743 | 10 | true | 2016-06-09T21:27:48.577Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SSE: unaligned load and store that crosses page boundary<p>I read somewhere that before performing unaligned load or store next to page boundary (e.g. using ... |
37,638,519 | Spark Streaming: How to periodically refresh cached RDD?<p>In my Spark streaming application, I want to map a value based on a dictionary that's retrieved from a backend (ElasticSearch). I want to periodically refresh the dictionary periodically, in case it was updated in the backend. It would be similar to Logstash tr... | <p>The best way I've found to do that is to recreate the RDD and maintain a mutable reference to it. Spark Streaming is at its core an scheduling framework on top of Spark. We can piggy-back on the scheduler to have the RDD refreshed periodically. For that, we use an empty DStream that we schedule only for the refresh... | Spark Streaming: How to periodically refresh cached RDD? | apache-spark|spark-streaming | 8 | 3,645 | 2 | 37,653,261 | 37,653,261 | 12 | true | 2016-06-05T04:39:07.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spark Streaming: How to periodically refresh cached RDD?<p>In my Spark streaming application, I want to map a value based on a dictionary that's retrieved fr... |
37,723,401 | How do you run an Openshift Docker container as something besides root?<p>I'm currently running Openshift, but I am running into a problem when I try to build/deploy my custom Docker container. The container works properly on my local machine, but once it gets built in openshift and I try to deploy it, I get the error... | <p>Openshift has strictly security policy regarding custom Docker builds.</p>
<p>Have a look a this <a href="https://hub.docker.com/r/openshift/origin-custom-docker-builder/">OpenShift Application Platform</a></p>
<p>In particular at point 4 into the FAQ section, here quoted.</p>
<blockquote>
<p><strong>4. Why doe... | How do you run an Openshift Docker container as something besides root? | docker|openshift | 11 | 15,940 | 3 | 37,723,815 | 37,723,815 | 14 | true | 2016-06-09T10:29:12Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do you run an Openshift Docker container as something besides root?<p>I'm currently running Openshift, but I am running into a problem when I try to buil... |
37,806,066 | Parquet vs Cassandra using Spark and DataFrames<p>I have come to this dilemma that I cannot choose what solution is going to be better for me. I have a very large table (couple of 100GBs) and couple of smaller (couple of GBs). In order to create my data pipeline in Spark and use spark ML I need to join these tables and... | <p>Cassandra is also a good solution for analytics use cases, but in another way. Before you model your keyspaces, you have to know how you need to read the data. You can also use where and range queries, but in a hard restricted way. Sometimes you will hate this restriction, but there are reasons for these restriction... | Parquet vs Cassandra using Spark and DataFrames | apache-spark|cassandra|spark-dataframe|parquet | 12 | 8,471 | 2 | 37,813,880 | 37,813,880 | 16 | true | 2016-06-14T07:51:10.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parquet vs Cassandra using Spark and DataFrames<p>I have come to this dilemma that I cannot choose what solution is going to be better for me. I have a very ... |
37,715,309 | Two-way SSL or One-way SSL when its one way rest call?<p>I created a client-rest-api which calls a server-rest-api (one way post call). My client-rest-api uses certificates issued by the server-rest-api. However my client-rest-api never issued any certificates to the server-rest-api. Does it come under one-way-ssl or t... | <p>One-way SSL authentication is if the client only verifies the certificate of the server. This validation is done to make sure that it is the expected server, i.e. no man in the middle attack.</p>
<p>Two-way SSL authentication (or better mutual authentication or client authentication) is if the server also verifies ... | Two-way SSL or One-way SSL when its one way rest call? | rest|ssl|ssl-certificate | 9 | 23,816 | 1 | 37,717,125 | 37,717,125 | 20 | true | 2016-06-09T01:01:28.120Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Two-way SSL or One-way SSL when its one way rest call?<p>I created a client-rest-api which calls a server-rest-api (one way post call). My client-rest-api us... |
37,781,073 | Why GitHub suggest "prefix your version names with the letter v?"<p>This is the content at GitHub's right sidebar: </p>
<blockquote>
<p>Tagging suggestions It’s common practice to prefix your version names
with the letter v. Some good tag names might be v1.0 or v2.3.4.</p>
<p>If the tag isn’t meant for produc... | <p>Most open source projects, and many tags on github and other open VCS sites, follow a format called <a href="http://semver.org/">Semantic Versioning</a>, linked also in the quote in your question. This is the versioning model that suggests:</p>
<blockquote>
<p>Given a version number MAJOR.MINOR.PATCH, increment ... | Why GitHub suggest "prefix your version names with the letter v?" | git|github | 21 | 5,168 | 2 | 37,781,173 | 37,781,173 | 20 | true | 2016-06-13T02:36:05.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why GitHub suggest "prefix your version names with the letter v?"<p>This is the content at GitHub's right sidebar: </p>
<blockquote>
<p>Tagging suggestion... |
37,638,034 | Private folder (submodule) in a public repo<p>I have a public repository. In it I want to use a submodule that is private. If i include this submodule into my public repo, will everyone be able to see the contents of that submodule?</p> | <p>No: Including a submodule in a public repository means recording its URL in a public .gitmodules file.</p>
<p>The repository at that URL will not be any more accessible through a recursive clone of your repository than it is on its own.</p>
<p>That is why, for instance, using <a href="https://help.github.com/artic... | Private folder (submodule) in a public repo | git|github|git-submodules | 26 | 9,740 | 2 | 37,638,473 | 37,638,473 | 24 | true | 2016-06-05T03:02:36.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Private folder (submodule) in a public repo<p>I have a public repository. In it I want to use a submodule that is private. If i include this submodule into m... |
37,723,420 | Convert datetime to date of a column in where condition using sequelize<p>Okay,</p>
<p>I want to convert column datetime to date while querying.</p>
<p>Can anyone help me out with sequelize query of below given query ?</p>
<pre><code>select * from ev_events where DATE(event_date) <= '2016-10-10'
</code></pre> | <p>You can use <code>sequelize.fn</code>:</p>
<pre><code>Event.findAll({
where: sequelize.where(sequelize.fn('date', sequelize.col('event_date')), '<=', '2016-10-10')
})
</code></pre>
<p>I've had to guess how you have defined your model.</p> | Convert datetime to date of a column in where condition using sequelize | javascript|node.js|sequelize.js | 15 | 13,320 | 2 | 37,724,671 | 37,724,671 | 24 | true | 2016-06-09T10:30:21.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert datetime to date of a column in where condition using sequelize<p>Okay,</p>
<p>I want to convert column datetime to date while querying.</p>
<p>Can... |
37,842,913 | Tensorflow: Confusion regarding the adam optimizer<p>I'm confused regarding as to how the adam optimizer actually works in tensorflow.</p>
<p>The way I read the <a href="https://www.tensorflow.org/versions/r0.9/api_docs/python/train.html#AdamOptimizer" rel="noreferrer">docs</a>, it says that the learning rate is chang... | <p>I find the documentation quite clear, I will paste here the algorithm in pseudo-code:</p>
<p><strong>Your parameters</strong>:</p>
<ul>
<li><code>learning_rate</code>: between 1e-4 and 1e-2 is standard</li>
<li><code>beta1</code>: 0.9 by default</li>
<li><code>beta2</code>: 0.999 by default</li>
<li><code>epsilon<... | Tensorflow: Confusion regarding the adam optimizer | python|tensorflow | 15 | 12,859 | 2 | 37,843,152 | 37,843,152 | 25 | true | 2016-06-15T18:17:40.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Tensorflow: Confusion regarding the adam optimizer<p>I'm confused regarding as to how the adam optimizer actually works in tensorflow.</p>
<p>The way I read... |
37,759,898 | opacity vs fill-opacity in svg<p>What is the difference in <code>opacity</code> vs <code>fill-opacity</code> in SVG?</p>
<p>I referred the docs for <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-opacity" rel="nofollow noreferrer">fill-opacity</a> and <a href="https://developer.mozilla.org/en-U... | <p>The difference is exactly what the name indicates :). <code>fill-opacity</code> is applicable only to the <code>fill</code> of the element (or in other words, just its background), <code>stroke-opacity</code> is applicable only to the <code>stroke</code> whereas the <code>opacity</code> is applicable to both.</p>
<... | opacity vs fill-opacity in svg | javascript|css|svg | 15 | 24,613 | 4 | 37,759,959 | 37,759,959 | 27 | true | 2016-06-11T04:24:16.067Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
opacity vs fill-opacity in svg<p>What is the difference in <code>opacity</code> vs <code>fill-opacity</code> in SVG?</p>
<p>I referred the docs for <a href="... |
37,618,977 | PySpark computing correlation<p>I want to use <code>pyspark.mllib.stat.Statistics.corr</code> function to compute correlation between two columns of <code>pyspark.sql.dataframe.DataFrame</code> object. <code>corr</code> function expects to take an <code>rdd</code> of <code>Vectors</code> objects. How do I translate a c... | <p>There should be no need for that. For numerical you can compute correlation directly using <code>DataFrameStatFunctions.corr</code>:</p>
<pre><code>df1 = sc.parallelize([(0.0, 1.0), (1.0, 0.0)]).toDF(["x", "y"])
df1.stat.corr("x", "y")
# -1.0
</code></pre>
<p>otherwise you can use <code>VectorAssembler</code>:</p>... | PySpark computing correlation | python|apache-spark|pyspark|apache-spark-sql|apache-spark-mllib | 14 | 34,117 | 4 | 37,619,189 | 37,619,189 | 28 | true | 2016-06-03T16:06:55.343Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PySpark computing correlation<p>I want to use <code>pyspark.mllib.stat.Statistics.corr</code> function to compute correlation between two columns of <code>py... |
37,658,154 | Get command line arguments as string<p>I want to print all command line arguments as a single string. Example of how I call my script and what I expect to be printed:</p>
<pre><code>./RunT.py mytst.tst -c qwerty.c
mytst.tst -c qwerty.c
</code></pre>
<p>The code that does that:</p>
<pre><code>args = str(sys.argv[1:]... | <p>An option:</p>
<pre><code>import sys
' '.join(sys.argv[1:])
</code></pre>
<p>The <code>join()</code> function joins its arguments by whatever string you call it on. So <code>' '.join(...)</code> joins the arguments with single spaces (<code>' '</code>) between them.</p> | Get command line arguments as string | python|command-line-arguments | 17 | 51,525 | 4 | 37,658,207 | 37,658,207 | 31 | true | 2016-06-06T12:58:54.313Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get command line arguments as string<p>I want to print all command line arguments as a single string. Example of how I call my script and what I expect to be... |
37,820,899 | Rails - Cancel destroy on before_destroy callback<p>is there any way, given certain condition, cancel the destroy of an object on the before_destroy callback of active record? Thanks</p> | <p>You should return <code>false</code>.</p>
<h1>Rails 5</h1>
<p>"Canceling callbacks</p>
<p>If a before_* callback throws :abort, all the later callbacks and the associated action are cancelled."</p>
<h1>Rails 4 and lower</h1>
<p>"Canceling callbacks</p>
<p>If a before_* callback returns false, all the ... | Rails - Cancel destroy on before_destroy callback | ruby-on-rails|activerecord | 16 | 9,759 | 5 | 37,821,159 | 37,821,159 | 31 | true | 2016-06-14T19:50:35.990Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rails - Cancel destroy on before_destroy callback<p>is there any way, given certain condition, cancel the destroy of an object on the before_destroy callback... |
37,676,726 | Angular 2 innerHTML (click) binding<p>I had such a large html menu that I decided to binding to be able to make several submenu dropdown and avoid html code duplication. Parent > child (which is parent too) > child... </p>
<p>For the context : In ng2_msList/msList.components.ts, ColumnsManagements.ts is imported as th... | <p>That's by design. Angular doesn't process HTML added by <code>[innerHTML]="..."</code> (except sanitization) in any way. It just passes it to the browser and that's it.</p>
<p>If you want to add HTML dynamically that contains bindings you need to wrap it in a Angular2 component, then you can add it using for exampl... | Angular 2 innerHTML (click) binding | angular | 29 | 54,069 | 7 | 37,676,847 | 37,676,847 | 36 | true | 2016-06-07T10:23:49.087Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular 2 innerHTML (click) binding<p>I had such a large html menu that I decided to binding to be able to make several submenu dropdown and avoid html code ... |
37,737,538 | Merge matplotlib subplots with shared x-axis<p>I have two graphs to where both have the same x-axis, but with different y-axis scalings. </p>
<p>The plot with regular axes is the data with a trend line depicting a decay while the y semi-log scaling depicts the accuracy of the fit.</p>
<pre><code>fig1 = plt.figure(fig... | <p>Look at the code and comments in it:</p>
<pre><code>import matplotlib.pyplot as plt
import numpy as np
from matplotlib import gridspec
# Simple data to display in various forms
x = np.linspace(0, 2 * np.pi, 400)
y = np.sin(x ** 2)
fig = plt.figure()
# set height ratios for subplots
gs = gridspec.GridSpec(2, 1, hei... | Merge matplotlib subplots with shared x-axis | python|matplotlib|subplot | 28 | 76,091 | 3 | 37,738,851 | 37,738,851 | 41 | true | 2016-06-09T23:01:41.717Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Merge matplotlib subplots with shared x-axis<p>I have two graphs to where both have the same x-axis, but with different y-axis scalings. </p>
<p>The plot wi... |
37,708,374 | How do I customize y-axis labels on a Chart.js line chart?<p>I have the following chart and would like to manually set the Y axis labels.
Instead of using 1,2,3,4,5, I want One, Two, Three, Four, Five.<br />
Is there a way to do this?
Here's my <strong>options</strong> structure:</p>
<pre class="lang-js prettyprint-ove... | <p>In the <code>ticks</code> object you can pass a <code>callback</code> that will be given the label it is about to show. From here you just return a string you wish to display in place of the label.</p>
<p><a href="https://jsfiddle.net/leighking2/jfh71ged/" rel="nofollow noreferrer">chart.js-V2.X fiddle exampe</a>
<a... | How do I customize y-axis labels on a Chart.js line chart? | chart.js|chart.js2 | 17 | 24,325 | 1 | 37,719,641 | 37,719,641 | 57 | true | 2016-06-08T16:45:55.833Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I customize y-axis labels on a Chart.js line chart?<p>I have the following chart and would like to manually set the Y axis labels.
Instead of using 1,... |
37,801,407 | Whither dispatch_once in Swift 3?<p>Okay, so I found out about the new <a href="https://stackoverflow.com/q/37801370/957768">Swifty Dispatch API</a> in Xcode 8. I'm having fun using <code>DispatchQueue.main.async</code>, and I've been browsing around the <code>Dispatch</code> module in Xcode to find all the new APIs.</... | <p>Since Swift 1.x, Swift has been using <code>dispatch_once</code> <a href="https://github.com/apple/swift/blob/2daa1400cf79a2965eb07034b48ef7fae02459fd/lib/IRGen/SwiftTargetInfo.cpp">behind the scenes</a> to perform thread-safe lazy initialization of global variables and static properties. </p>
<p>So the <code>stati... | Whither dispatch_once in Swift 3? | swift|grand-central-dispatch|swift3|libdispatch | 57 | 36,175 | 7 | 37,801,408 | 37,801,408 | 59 | true | 2016-06-14T01:02:49.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Whither dispatch_once in Swift 3?<p>Okay, so I found out about the new <a href="https://stackoverflow.com/q/37801370/957768">Swifty Dispatch API</a> in Xcode... |
37,676,522 | React-native: Super expression must either be null or a function, not undefined<p>I have seen similar questions asked but I can't seem to indentify the problem.
I am using react native v 0.27
I have changed all my require methods into imports.</p>
<p>Here's the error I receive:</p>
<p><a href="https://i.stack.imgur.c... | <p>Change your import statement like below and try.</p>
<pre><code>import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Image,
TextInput,
Button,
TouchableHighlight,
} from 'react-native';
</code></pre>
<p>Also constructor should be like below</p>
<pre><code>constr... | React-native: Super expression must either be null or a function, not undefined | reactjs|react-native|ecmascript-6 | 24 | 37,642 | 6 | 37,676,646 | 37,676,646 | 64 | true | 2016-06-07T10:15:18.177Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React-native: Super expression must either be null or a function, not undefined<p>I have seen similar questions asked but I can't seem to indentify the probl... |
37,761,238 | How do I select and store columns greater than a number in pandas?<p>I have a pandas DataFrame with a column of integers. I want the rows containing numbers greater than 10. I am able to evaluate True or False but not the actual value, by doing:</p>
<pre><code>df['ints'] = df['ints'] > 10
</code></pre>
<p>I don't ... | <p>Sample DF:</p>
<pre><code>In [79]: df = pd.DataFrame(np.random.randint(5, 15, (10, 3)), columns=list('abc'))
In [80]: df
Out[80]:
a b c
0 6 11 11
1 14 7 8
2 13 5 11
3 13 7 11
4 13 5 9
5 5 11 9
6 9 8 6
7 5 11 10
8 8 10 14
9 7 14 13
</code></pre>
<p>present only ... | How do I select and store columns greater than a number in pandas? | python|pandas | 43 | 171,023 | 2 | 37,761,260 | 37,761,260 | 72 | true | 2016-06-11T07:41:15.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I select and store columns greater than a number in pandas?<p>I have a pandas DataFrame with a column of integers. I want the rows containing numbers ... |
37,790,427 | Show progress value for volley file download<p>I need to show the progress of file download in percentage.</p>
<p>Currently I am using <strong>Volley</strong> library. I use <code>InputStreamVolleyRequest</code> class to make the download request and <code>BufferedOutputStream</code> to read/write the file.</p>
<p>Ho... | <p>As you have mentioned that you are using <code>InputStreamVolleyRequest</code>, I hope you have written the following code or something similar as well:</p>
<pre><code>@Override
public void onResponse(byte[] response) {
HashMap<String, Object> map = new HashMap<String, Object>();
try {
i... | Show progress value for volley file download | android|download|android-volley | 9 | 9,285 | 2 | 37,792,066 | 37,792,066 | -1 | true | 2016-06-13T12:55:47.217Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Show progress value for volley file download<p>I need to show the progress of file download in percentage.</p>
<p>Currently I am using <strong>Volley</stron... |
37,639,998 | Why can't I install lldb in Android Studio<p>I want to set breakpoint during JNI, but when I edit my configurations, I can't install lldb plugin.</p>
<p><a href="https://i.stack.imgur.com/YGn5N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YGn5N.png" alt="Press fix button but does not have any eff... | <p>LLDB is now available through the SDK Manager integrated into Android Studio which is under settings in Android studio and not through the standalone sdk manager.</p>
<p>To install it you have to Goto setting > Android SDK.</p>
<p>There under the SDK Tools you have LLDB, select the checkbox and install it.</p>
<p... | Why can't I install lldb in Android Studio | android|android-studio|debugging|lldb | 8 | 7,681 | 1 | 37,644,651 | 37,644,651 | 3 | true | 2016-06-05T08:42:17.210Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can't I install lldb in Android Studio<p>I want to set breakpoint during JNI, but when I edit my configurations, I can't install lldb plugin.</p>
<p><a ... |
37,747,801 | Wordpress : Need to set zoom level in google embedded map iframe<p>I am using Map embed <em>iframe</em> with this code in my Website</p>
<pre><code><iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d4911422.152107185!2d-6.743420312530421!3d53.05351610420746!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3... | <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><html>
<head>
<title>Google map</title>
</head>
<body>
<iframe style="height:100%; width:1... | Wordpress : Need to set zoom level in google embedded map iframe | wordpress|iframe | 8 | 28,232 | 4 | 37,747,895 | 37,747,895 | 4 | true | 2016-06-10T12:02:42.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wordpress : Need to set zoom level in google embedded map iframe<p>I am using Map embed <em>iframe</em> with this code in my Website</p>
<pre><code><ifr... |
37,739,755 | C# console application: Main method return value VS Application.ExitCode<p>I am writing a console program for windows task scheduler to run. My <code>Main()</code> method has a return type of <code>int</code> and I return different numbers when exiting to indicate the result of execution, which I can access in a <code>... | <blockquote>
<p>Is the return value of Main() somewhat different to Environment.ExitCode?</p>
</blockquote>
<p>Nope, they are the same, and go to the same place. You can see this by experimenting with a console application that just either returns -1 or sets <code>Environment.ExitCode</code> to -1. You'll see that w... | C# console application: Main method return value VS Application.ExitCode | c#|return-value|exit-code|main-method | 7 | 2,365 | 1 | 37,790,108 | 37,790,108 | 7 | true | 2016-06-10T04:12:15.763Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# console application: Main method return value VS Application.ExitCode<p>I am writing a console program for windows task scheduler to run. My <code>Main()<... |
37,847,284 | Serilog MSSqlServer sink not writing to table<p>I have the following statement in my Startup.cs:</p>
<pre><code>Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.ColoredConsole()
.WriteTo.MSSqlServer("Server=(localdb)\\MSSQLLocalDB;Database=myDb.Logging;Trusted_Connection=True;", "Logs"... | <p>At first glance it doesn't look like you're missing anything. It's likely that an exception is being thrown by the SQL Server Sink when trying to write to the table.</p>
<p>Have you tried checking the output from <a href="https://github.com/serilog/serilog/wiki/Debugging-and-Diagnostics" rel="noreferrer">Serilog's ... | Serilog MSSqlServer sink not writing to table | asp.net-core|serilog|sink | 10 | 6,968 | 1 | 37,847,451 | 37,847,451 | 11 | true | 2016-06-15T23:06:48.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Serilog MSSqlServer sink not writing to table<p>I have the following statement in my Startup.cs:</p>
<pre><code>Log.Logger = new LoggerConfiguration()
.... |
37,796,916 | Pandas read sql integer became float<p>I met a problem that when I use pandas to read Mysql table, some columns (see 'to_nlc') used to be integer became a float number (automatically add .0 after that).
Can anyone figure it out? Or some guessings? Thanks very much!</p>
<p><a href="https://i.stack.imgur.com/1obo8.png" ... | <p>Problem is your data contains <code>NaN</code> values, so <code>int</code> is automatically cast to <code>float</code>.</p>
<p>I think you can check <a href="http://pandas.pydata.org/pandas-docs/stable/gotchas.html#na-type-promotions" rel="noreferrer">NA type promotions</a>:</p>
<blockquote>
<p>When introducing ... | Pandas read sql integer became float | python|mysql|pandas|int | 24 | 14,360 | 3 | 37,797,008 | 37,797,008 | 19 | true | 2016-06-13T18:38:18.900Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas read sql integer became float<p>I met a problem that when I use pandas to read Mysql table, some columns (see 'to_nlc') used to be integer became a fl... |
37,657,260 | how to implement custom metric in keras?<p>I get this error : </p>
<blockquote>
<p>sum() got an unexpected keyword argument 'out'</p>
</blockquote>
<p>when I run this code:</p>
<pre><code>import pandas as pd, numpy as np
import keras
from keras.layers.core import Dense, Activation
from keras.models import Sequenti... | <p>The problem is that <code>y_pred</code> and <code>y_true</code> are not NumPy arrays but either Theano or TensorFlow tensors. That's why you got this error.</p>
<p>You can define your custom metrics but you have to remember that its arguments are those tensors – not NumPy arrays.</p> | how to implement custom metric in keras? | python|neural-network|deep-learning|keras|metrics | 37 | 70,677 | 3 | 37,663,327 | 37,663,327 | 20 | true | 2016-06-06T12:17:34.390Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to implement custom metric in keras?<p>I get this error : </p>
<blockquote>
<p>sum() got an unexpected keyword argument 'out'</p>
</blockquote>
<p>wh... |
37,800,342 | UIControlState.Normal is Unavailable<p>Previously for <code>UIButton</code> instances, you were able to pass in <code>UIControlState.Normal</code> for <code>setTitle</code> or <code>setImage</code>. <code>.Normal</code> is no longer available, what should I use instead?</p>
<pre><code>let btn = UIButton(frame: CGRect... | <p>Swift 3 update:</p>
<p>It appears that Xcode 8/Swift 3 brought <code>UIControlState.normal</code> back:</p>
<pre><code>public struct UIControlState : OptionSet {
public init(rawValue: UInt)
public static var normal: UIControlState { get }
public static var highlighted: UIControlState { get } // use... | UIControlState.Normal is Unavailable | ios|swift|uibutton|swift3|xcode8 | 14 | 12,051 | 4 | 37,800,343 | 37,800,343 | 22 | true | 2016-06-13T22:47:20.060Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UIControlState.Normal is Unavailable<p>Previously for <code>UIButton</code> instances, you were able to pass in <code>UIControlState.Normal</code> for <code>... |
37,749,412 | Select only the first row when merging data frames with multiple matches<p>I have two data frames, "data" and "scores", and want to merge them on the "id" column:</p>
<pre><code>data = data.frame(id = c(1,2,3,4,5),
state = c("KS","MN","AL","FL","CA"))
scores = data.frame(id = c(1,1,1,2,2,3,3,3),
... | <p>Using <code>data.table</code> along with <code>mult = "first"</code> and <code>nomatch = 0L</code>:</p>
<pre><code>require(data.table)
setDT(scores); setDT(data) # convert to data.tables by reference
scores[data, mult = "first", on = "id", nomatch=0L]
# id score state
# 1: 1 66 KS
# 2: 2 86 MN
# 3... | Select only the first row when merging data frames with multiple matches | r|join | 20 | 18,710 | 4 | 37,749,570 | 37,749,570 | 24 | true | 2016-06-10T13:22:45.067Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Select only the first row when merging data frames with multiple matches<p>I have two data frames, "data" and "scores", and want to merge them on the "id" co... |
37,773,356 | Find sum of previous n rows in dataframe<p>I want to find the sum of the previous <code>n</code> rows in a dataframe. E.g:</p>
<pre><code>id = 1:10
vals = c(4,7,2,9,7,0,4,6,1,8)
test = data.frame(id,vals)
</code></pre>
<p>So, for <code>n=3</code>, I'd want to calculate the next column as:</p>
<pre><code>test$sum = c... | <p>You can use the <code>rollsumr</code> function from the <code>zoo</code> package for this:</p>
<pre><code>library(zoo)
test$sums <- rollsumr(test$vals, k = 3, fill = NA)
</code></pre>
<p>which gives:</p>
<blockquote>
<pre><code>> test
id vals sums
1 1 4 NA
2 2 7 NA
3 3 2 13
4 4 9 ... | Find sum of previous n rows in dataframe | r|dataframe | 12 | 17,210 | 1 | 37,773,562 | 37,773,562 | 27 | true | 2016-06-12T10:49:30.200Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find sum of previous n rows in dataframe<p>I want to find the sum of the previous <code>n</code> rows in a dataframe. E.g:</p>
<pre><code>id = 1:10
vals = c... |
37,625,799 | How to write a flowtype for arrow function with generic type<p>How do I write flowtype for the following code?</p>
<p>The function argument is an array of generic type.</p>
<pre><code>const fn = (array) => Promise.resolve(array[0]);
</code></pre> | <pre><code>const fn = <T>(array: Array<T>): Promise<T> => Promise.resolve(array[0]);
</code></pre>
<p>Relevant documentation: <a href="https://flow.org/en/docs/types/generics/" rel="noreferrer">https://flow.org/en/docs/types/generics/</a></p> | How to write a flowtype for arrow function with generic type | flowtype | 22 | 8,475 | 1 | 37,651,652 | 37,651,652 | 41 | true | 2016-06-04T02:39:29.170Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to write a flowtype for arrow function with generic type<p>How do I write flowtype for the following code?</p>
<p>The function argument is an array of g... |
37,648,071 | How to Clear Database in Realm in Android<p>I want to clear whole database when a user press logout button and loads a new data when another user login.I tried many solutions like</p>
<pre><code>try {
Realm.deleteRealm(realmConfiguration);
} catch (Exception ex){
throw ex;
}
</code></pre>
<... | <p>When you call <a href="https://realm.io/docs/java/1.0.0/api/io/realm/Realm.html#deleteRealm-io.realm.RealmConfiguration-"><code>Realm.deleteRealm()</code></a>, you have to make sure all the Realm instances are closed, otherwise an exception will be thrown without deleting anything. By calling this method, all Realm ... | How to Clear Database in Realm in Android | android|realm | 24 | 24,579 | 2 | 37,648,877 | 37,648,877 | 49 | true | 2016-06-06T00:20:33.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Clear Database in Realm in Android<p>I want to clear whole database when a user press logout button and loads a new data when another user login.I tri... |
37,714,558 | How to enable server side SSL for gRPC?<p>New to gRPC and couldn't really find any example on how to enable SSL on the server side. I generated a key pair using openssl but it complains that the private key is invalid.</p>
<pre><code>D0608 16:18:31.390303 Grpc.Core.Internal.UnmanagedLibrary Attempting to load native ... | <p>Here's what I did.</p>
<p>Using <a href="https://slproweb.com/products/Win32OpenSSL.html">OpenSSL</a>, generate certificates with the following:</p>
<pre><code>@echo off
set OPENSSL_CONF=c:\OpenSSL-Win64\bin\openssl.cfg
echo Generate CA key:
openssl genrsa -passout pass:1111 -des3 -out ca.key 4096
echo Genera... | How to enable server side SSL for gRPC? | c#|ssl-certificate|grpc | 17 | 21,540 | 3 | 37,739,265 | 37,739,265 | 62 | true | 2016-06-08T23:26:17.653Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to enable server side SSL for gRPC?<p>New to gRPC and couldn't really find any example on how to enable SSL on the server side. I generated a key pair u... |
37,612,622 | Spark unionAll multiple dataframes<p>For a set of dataframes</p>
<pre><code>val df1 = sc.parallelize(1 to 4).map(i => (i,i*10)).toDF("id","x")
val df2 = sc.parallelize(1 to 4).map(i => (i,i*100)).toDF("id","y")
val df3 = sc.parallelize(1 to 4).map(i => (i,i*1000)).toDF("id","z")
</code></pre>
<p>to union all... | <p>The simplest solution is to <code>reduce</code> with <code>union</code> (<code>unionAll</code> in Spark < 2.0):</p>
<pre><code>val dfs = Seq(df1, df2, df3)
dfs.reduce(_ union _)
</code></pre>
<p>This is relatively concise and shouldn't move data from off-heap storage <s>but extends lineage with each union</s> r... | Spark unionAll multiple dataframes | scala|apache-spark|apache-spark-sql | 59 | 111,616 | 3 | 37,612,978 | 37,612,978 | 69 | true | 2016-06-03T11:00:04.430Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spark unionAll multiple dataframes<p>For a set of dataframes</p>
<pre><code>val df1 = sc.parallelize(1 to 4).map(i => (i,i*10)).toDF("id","x")
val df2 = ... |
37,806,625 | sqlalchemy: create relations but without foreign key constraint in db?<p>Since <code>sqlalchemy.orm.relationship()</code> already implies the relation, and I do not want to create a constraint in db. What should I do?</p>
<p>Currently I manually remove these constraints after alembic migrations.</p> | <p>Instead of defining "schema" level <a href="http://docs.sqlalchemy.org/en/latest/core/constraints.html#sqlalchemy.schema.ForeignKey" rel="noreferrer"><code>ForeignKey</code></a> constraints create a <a href="http://docs.sqlalchemy.org/en/latest/orm/join_conditions.html#creating-custom-foreign-conditions" rel="norefe... | sqlalchemy: create relations but without foreign key constraint in db? | python|orm|sqlalchemy|foreign-keys | 35 | 19,786 | 1 | 37,809,175 | 37,809,175 | 74 | true | 2016-06-14T08:20:08.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
sqlalchemy: create relations but without foreign key constraint in db?<p>Since <code>sqlalchemy.orm.relationship()</code> already implies the relation, and I... |
37,683,558 | Pandas Extract Number from String<p>Given the following data frame:</p>
<pre><code>import pandas as pd
import numpy as np
df = pd.DataFrame({'A':['1a',np.nan,'10a','100b','0b'],
})
df
A
0 1a
1 NaN
2 10a
3 100b
4 0b
</code></pre>
<p>I'd like to extract the numbers from each cell (wher... | <p>Give it a regex capture group:</p>
<pre><code>df.A.str.extract('(\d+)')
</code></pre>
<p>Gives you:</p>
<pre><code>0 1
1 NaN
2 10
3 100
4 0
Name: A, dtype: object
</code></pre> | Pandas Extract Number from String | python|string|python-3.x|pandas | 41 | 94,514 | 3 | 37,683,738 | 37,683,738 | 90 | true | 2016-06-07T15:31:02.040Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas Extract Number from String<p>Given the following data frame:</p>
<pre><code>import pandas as pd
import numpy as np
df = pd.DataFrame({'A':['1a',np.na... |
37,604,275 | How to view event parameters from Firebase console<p>I have just started using Firebase for my app analytics and I'm having some issues trying to view the parameters associated with my events. Upon logging into the console, selecting my app, then I select the <code>iOS</code> version and I'm presented with the dashboar... | <p>It looks like you're logging the correct event and parameters. It should produce a select_content report that looks like the attached. You don't need to create an audience to see this.</p>
<p><a href="https://i.stack.imgur.com/CNfIH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/CNfIH.png" alt="enter i... | How to view event parameters from Firebase console | ios|firebase|firebase-analytics | 53 | 50,734 | 5 | 37,606,008 | 37,606,008 | 8 | true | 2016-06-03T00:44:08.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to view event parameters from Firebase console<p>I have just started using Firebase for my app analytics and I'm having some issues trying to view the pa... |
37,765,796 | How to layout yii2 form fields side by side<p>I would like to place form fields in Yii2 side by side, in a 2x2 grid.</p>
<p>I'm using the bootstrap/ActiveForm as such</p>
<pre><code> <?php $form = ActiveForm::begin([
'layout' => 'horizontal',
'action' => ['index'],
'method' => 'get',
'f... | <p>All you need is to wrap your form columns in another bootstrap <code>row</code>.</p>
<pre><code><?php $form = ActiveForm::begin([
'layout' => 'horizontal',
'action' => ['index'],
'method' => 'get',
'fieldConfig' => [
'horizontalCssClasses' => [
'label' => 'co... | How to layout yii2 form fields side by side | yii|yii2 | 8 | 11,303 | 2 | 37,772,138 | 37,772,138 | 13 | true | 2016-06-11T16:06:32.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to layout yii2 form fields side by side<p>I would like to place form fields in Yii2 side by side, in a 2x2 grid.</p>
<p>I'm using the bootstrap/ActiveFo... |
37,830,098 | Topics on Firebase Cloud Messaging?<p>Is there any constraints about number of different topics for Firebase Cloud Messaging in one app?</p> | <p>Nope. Seeing that FCM has GCM as its core, there is no limit in the number of Topics for any app. There used to be a 1 million limit, but it was removed. You can refer to this <a href="https://developers.googleblog.com/2015/12/google-cloud-messaging-weve-come-long.html?utm_source=Android+Weekly&utm_campaign=1cb8... | Topics on Firebase Cloud Messaging? | android|firebase-cloud-messaging|firebase-notifications | 14 | 7,733 | 2 | 37,848,400 | 37,848,400 | 17 | true | 2016-06-15T08:32:35.860Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Topics on Firebase Cloud Messaging?<p>Is there any constraints about number of different topics for Firebase Cloud Messaging in one app?</p> |
37,689,485 | How to export Firebase analytics data<p>I'm trying to figure out if it's possible to export all the Firebase Analytics data to an excel spreadsheet, similar to how you can do it with Google Analytics. From what I can find the only way to go about doing it is to link with BigQuery then do some SQL statements to build a ... | <p><strong>Update</strong>: You can now export the analytics reports as CSV from the Firebase console by clicking the <kbd>Download CSV</kbd> option from the <kbd>⠇</kbd> overflow menu.</p>
<hr>
<p>In the meantime, you really should give BigQuery another look. The <a href="https://cloud.google.com/bigquery/pricing" ... | How to export Firebase analytics data | firebase|analytics|firebase-analytics | 19 | 25,406 | 4 | 37,690,607 | 37,690,607 | 22 | true | 2016-06-07T21:14:31.137Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to export Firebase analytics data<p>I'm trying to figure out if it's possible to export all the Firebase Analytics data to an excel spreadsheet, similar ... |
37,649,844 | angular2(typescript) export variables from another file<p>In Nodejs I have a page called <code>variables.js</code> which looks something like this:</p>
<pre><code>exports.var1= 'a';
exports.var2= 'b';
</code></pre>
<p>This file holds variables I use within in my application all in one place.</p>
<p>Then inside of an... | <p><strong>variables.ts</strong></p>
<pre><code>export var var1:string = 'a';
export var var2:string = 'b';
</code></pre>
<p><strong>other-file.ts</strong></p>
<pre><code>import {var1, var2} from './variables';
alert(var1);
</code></pre>
<p>or</p>
<pre><code>import * as vars from './variables';
alert(vars.var1);... | angular2(typescript) export variables from another file | javascript|typescript|angular | 12 | 29,235 | 2 | 37,649,888 | 37,649,888 | 24 | true | 2016-06-06T05:03:00.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
angular2(typescript) export variables from another file<p>In Nodejs I have a page called <code>variables.js</code> which looks something like this:</p>
<pre... |
37,705,417 | Map multiple source fields to same type target fields with Mapstruct<p>Consider the following POJOs:</p>
<pre><code>public class SchedulePayload {
public String name;
public String scheduler;
public PeriodPayload notificationPeriod;
public PeriodPayload schedulePeriod;
}
private class Lecture {
pu... | <p>What you can do is create an <code>@AfterMapping</code> method to populate those parts manually:</p>
<pre><code>@Mapper
public abstract class SchedulePayloadMapper
{
@Mappings({
@Mapping(target = "name", source = "scheduleName"),
@Mapping(target = "scheduler", source = "schedulerName"),
... | Map multiple source fields to same type target fields with Mapstruct | java|mapping|mapstruct | 13 | 44,611 | 1 | 37,711,145 | 37,711,145 | 24 | true | 2016-06-08T14:30:37.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Map multiple source fields to same type target fields with Mapstruct<p>Consider the following POJOs:</p>
<pre><code>public class SchedulePayload {
publi... |
37,758,647 | Why so many tasks in my spark job? Getting 200 Tasks By Default<p>I have a spark job that takes a file with 8 records from hdfs, does a simple aggregation and saves it back to hdfs. I notice there are like hundreds of tasks when I do this. </p>
<p>I also am not sure why there are multiple jobs for this? I thought a... | <p>This is a classic Spark question. </p>
<p>The two tasks used for reading (Stage Id 0 in second figure) is the <code>defaultMinPartitions</code> setting which is set to 2. You can get this parameter by reading the value in the REPL <code>sc.defaultMinPartitions</code>. It should also be visible in the Spark UI under... | Why so many tasks in my spark job? Getting 200 Tasks By Default | scala|apache-spark|hadoop|apache-spark-sql|task | 24 | 20,250 | 2 | 37,759,913 | 37,759,913 | 34 | true | 2016-06-11T00:00:35.557Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why so many tasks in my spark job? Getting 200 Tasks By Default<p>I have a spark job that takes a file with 8 records from hdfs, does a simple aggregation an... |
37,777,525 | Delete an item from Redux state<p>I'm wondering if you could help me with this problem if possible. I am trying to delete an item from the Redux state. I have passed in the ID of the item that the user clicks via <code>action.data</code> into the reducer. </p>
<p>I'm wondering how I can match the <code>action.data</co... | <p>Just filter the comments:</p>
<pre><code>case 'DELETE_COMMENT':
const commentId = action.data;
return state.filter(comment => comment.id !== commentId);
</code></pre>
<p>This way you won't mutate the original <code>state</code> array, but return a new array without the element, which had the id <code>commen... | Delete an item from Redux state | javascript|arrays|reactjs|redux | 28 | 50,482 | 5 | 37,777,800 | 37,777,800 | 71 | true | 2016-06-12T18:10:23.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Delete an item from Redux state<p>I'm wondering if you could help me with this problem if possible. I am trying to delete an item from the Redux state. I hav... |
37,689,423 | Convert between NHWC and NCHW in TensorFlow<p>What is the best way to convert a tensor from NHWC format to NCHW format, and vice versa?</p>
<p>Is there an op specifically that does this, or will I need to use some combination of the split/concat type operations?</p> | <p>All you need to do is a permutation of the dimensions from NHWC to NCHW (or the contrary).</p>
<p>The meaning of each letter might help understand:</p>
<ul>
<li><strong>N</strong>: number of images in the batch</li>
<li><strong>H</strong>: height of the image</li>
<li><strong>W</strong>: width of the image</li>
<li>... | Convert between NHWC and NCHW in TensorFlow | tensorflow | 49 | 48,700 | 3 | 37,689,717 | 37,689,717 | 84 | true | 2016-06-07T21:10:13.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert between NHWC and NCHW in TensorFlow<p>What is the best way to convert a tensor from NHWC format to NCHW format, and vice versa?</p>
<p>Is there an o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.