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,805,525
Rails 2.2.2 issue: undefined method `activate_bin_path' for Gem:Module (NoMethodError)<p>I am working on Rails 2.2.2 application. For this I installed rvm with Ruby version 1.9.3p551. There is no Gemfile for this application. So as mentioned in the environment.rb file I created a Gemfile with rails and sqlite3. While ...
<p>For me, (I am working with RVM) it worked just running:</p> <pre><code>gem update --system gem update bundler </code></pre>
Rails 2.2.2 issue: undefined method `activate_bin_path' for Gem:Module (NoMethodError)
ruby-on-rails
23
19,994
5
39,775,255
39,775,255
54
true
2016-06-14T07:24:43.357Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rails 2.2.2 issue: undefined method `activate_bin_path' for Gem:Module (NoMethodError)<p>I am working on Rails 2.2.2 application. For this I installed rvm wi...
37,724,769
How to install a PowerShell module in an Azure Function<p>I need the AWS module, which is available from the PS-Gallery but when I try to run the install step inside an <a href="https://azure.microsoft.com/en-us/services/functions/" rel="noreferrer">Azure Function</a>, it doesn't work. The -verbose argument flag isn't ...
<p>Azure Functions support for PowerShell scripting is currently in an experimental stage. The following scenarios are supported:</p> <ol> <li>Azure Functions will be able to support customers bringing their own modules. These modules will reside in a folder named <code>modules</code> that is located in the same dir...
How to install a PowerShell module in an Azure Function
powershell|azure|azure-functions
11
14,855
4
39,985,646
39,985,646
12
true
2016-06-09T11:31:33.333Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to install a PowerShell module in an Azure Function<p>I need the AWS module, which is available from the PS-Gallery but when I try to run the install ste...
38,054,707
angular 2 azure deploy refresh error : The resource you are looking for has been removed, had its name changed, or is temporarily unavailable<p>I have an Angular 2 rc-2 app with basic routing implemented.The paths are <code>/path1</code> which is the default path and <code>/path2</code>.The home path <code>/</code> red...
<p>You have to add <strong>web.config</strong> file to your root Angular2 app. That's how Azure servers (IIS Server) works.</p> <p> Im using webpack so I put it on <strong>src</strong> folder. Don't forget to copy it to your <strong>dist</strong> folder when you depploy. I used <strong>CopyWebpackPlugin</strong> to se...
angular 2 azure deploy refresh error : The resource you are looking for has been removed, had its name changed, or is temporarily unavailable
angular|azure|angular2-routing
51
30,538
8
40,275,148
40,275,148
79
true
2016-06-27T13:02:18.827Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: angular 2 azure deploy refresh error : The resource you are looking for has been removed, had its name changed, or is temporarily unavailable<p>I have an Ang...
38,038,034
Firebase on Android: How to check Firebase auth failed reason?<p>I use Firebase on Android and Firebase Auth functions.</p> <p>I try <code>FirebaseAuth.signInWithEmailAndPassword</code> and in case it fails I want to know why the signIn process failed?</p> <p>The <code>signInWithEmailAndPassword</code> method has <co...
<p>I was having the same doubts and I found a bit more information on their documentation.</p> <p>For example in you are using this method <strong>createUserWithEmailAndPassword</strong> you can see on their <a href="https://developers.google.com/android/reference/com/google/firebase/auth/FirebaseAuth#signInWithEmailAn...
Firebase on Android: How to check Firebase auth failed reason?
android|firebase|firebase-authentication
17
25,375
4
39,510,310
39,510,310
11
true
2016-06-26T11:26:43.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebase on Android: How to check Firebase auth failed reason?<p>I use Firebase on Android and Firebase Auth functions.</p> <p>I try <code>FirebaseAuth.sign...
37,863,609
VS Code Intellisense don't suggest snippet at first<p>I want to use code snippets in VSCode. But when I type, for example, <code>for</code> in javascript file, the Intellisense doesn't suggest snippet "for-loop" - I need to manually scroll the dropdown and select it. Is there any way to make VSCode to suggest snippets ...
<p>You need to use <code>editor.snippetSuggestions</code> config option with <code>"top"</code> value. Please, see <a href="https://code.visualstudio.com/docs/editor/intellisense#_customizing-intellisense" rel="noreferrer">Customizing IntelliSense</a> article for more tips and tricks.</p>
VS Code Intellisense don't suggest snippet at first
intellisense|visual-studio-code|code-snippets
47
14,638
4
39,399,917
39,399,917
129
true
2016-06-16T15:35:46.417Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VS Code Intellisense don't suggest snippet at first<p>I want to use code snippets in VSCode. But when I type, for example, <code>for</code> in javascript fil...
38,043,757
How to link schema in "GraphQL for .NET" and "Relay"?<p>I want to build a web app with Javascript for the front end and C# for the back end and I want to determine the value of GraphQL.</p> <ul> <li>For my C# back end I use a GraphQL implementation named <a href="https://github.com/graphql-dotnet/graphql-dotnet#graphq...
<ol> <li>You need schema only on the backend and you can download schema.json from your backend using example at the bottom part of this document: <a href="https://facebook.github.io/relay/docs/guides-babel-plugin.html" rel="noreferrer">https://facebook.github.io/relay/docs/guides-babel-plugin.html</a></li> <li>Relay ...
How to link schema in "GraphQL for .NET" and "Relay"?
c#|reactjs|asp.net-core|graphql|relay
9
4,889
1
39,551,463
39,551,463
7
true
2016-06-26T22:22:48.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to link schema in "GraphQL for .NET" and "Relay"?<p>I want to build a web app with Javascript for the front end and C# for the back end and I want to det...
37,964,064
IBInspectable UIEdgeInsets not shown in IBOutlet<p>I am creating a custom class for <code>UIButton</code> to increase the tap area. I need that user can enter the padding in storyboard itself. So I make a <code>IBInspectable</code> property.</p> <pre><code>@IBDesignable class UIIconButton: UIButton { @IBInspectabl...
<p>As of Xcode 7, Interface Builder doesn't understand<code>UIEdgeInsetsZero</code> as an <code>@IBInspectable</code> (bummer!).</p> <p>You can work around this, however, by using <code>CGFloat</code> properties to set edge insets indirectly:</p> <pre><code>public class UIIconButton: UIButton { @IBInspectable publ...
IBInspectable UIEdgeInsets not shown in IBOutlet
ios|storyboard|xcode7|xib|ibinspectable
12
2,846
1
39,128,124
39,128,124
28
true
2016-06-22T09:35:39.127Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IBInspectable UIEdgeInsets not shown in IBOutlet<p>I am creating a custom class for <code>UIButton</code> to increase the tap area. I need that user can ente...
38,045,290
Text Summarization Evaluation - BLEU vs ROUGE<p>With the results of two different summary systems (sys1 and sys2) and the same reference summaries, I evaluated them with both BLEU and ROUGE. The problem is: All ROUGE scores of sys1 was higher than sys2 (ROUGE-1, ROUGE-2, ROUGE-3, ROUGE-4, ROUGE-L, ROUGE-SU4, ...) but t...
<p>In general:</p> <p><strong>Bleu measures precision</strong>: how much the words (and/or n-grams) in the <em>machine generated summaries</em> appeared in the human reference summaries.</p> <p><strong>Rouge measures recall</strong>: how much the words (and/or n-grams) in the <em>human reference summaries</em> appear...
Text Summarization Evaluation - BLEU vs ROUGE
nlp|text-processing|rouge|bleu
52
30,215
3
39,190,391
39,190,391
64
true
2016-06-27T03:02:43.033Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Text Summarization Evaluation - BLEU vs ROUGE<p>With the results of two different summary systems (sys1 and sys2) and the same reference summaries, I evaluat...
37,928,998
How to use a jQuery plugin inside Vue<p>I'm building a web application inside VueJS but I encounter a problem. I want to use a jQuery extension (cropit to be specific) but I don't know how to instantiate/require/import it the right way without getting errors.</p> <p>I'm using de official CLI tool and de webpack templa...
<p><strong>Option #1: Use ProvidePlugin</strong></p> <p>Add the <a href="https://webpack.js.org/plugins/provide-plugin/#usage-jquery" rel="noreferrer">ProvidePlugin</a> to the plugins array in both <code>build/webpack.dev.conf.js</code> and <code>build/webpack.prod.conf.js</code> so that jQuery becomes globally availa...
How to use a jQuery plugin inside Vue
jquery|jquery-plugins|webpack|vue.js
60
142,619
11
39,653,758
39,653,758
68
true
2016-06-20T18:03:35.743Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use a jQuery plugin inside Vue<p>I'm building a web application inside VueJS but I encounter a problem. I want to use a jQuery extension (cropit to be...
38,023,726
How to nest LabelKFold?<p>I have a dataset with ~300 points and 32 distinct labels and I want to evaluate a LinearSVR model by plotting its learning curve using grid search and LabelKFold validation.</p> <p>The code I have looks like this:</p> <pre><code>import numpy as np from sklearn import preprocessing from sklea...
<p>From your question, you are looking for the LabelKFold score on your data, while grid-searching the parameters of your pipeline in each of the iterations of this outer LabelKFold, using again a LabelKFold. Although I was not able to achieve that out-of-the-box it takes only one loop: </p> <pre><code>outer_cv = Labe...
How to nest LabelKFold?
python|scikit-learn|cross-validation
13
539
1
39,374,458
39,374,458
3
true
2016-06-25T00:11:17.660Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to nest LabelKFold?<p>I have a dataset with ~300 points and 32 distinct labels and I want to evaluate a LinearSVR model by plotting its learning curve us...
37,819,278
Android Espresso - Click checkbox if not checked<p>I have <code>onView(withId(R.id.check_box)).perform(click())</code>, but i only want to do this if the check box is not already checked. How can I do this in espresso?</p>
<p>I also wanted to toggle a checkbox/switch depending on it's previous state. At first, I tried this to toggle ON a checkbox that was OFF:</p> <pre><code>onView(withId(R.id.checkbox)).check(matches(isNotChecked())).perform(scrollTo(), click()); </code></pre> <p>...and this to toggle OFF a checkbox that was ON:</p> ...
Android Espresso - Click checkbox if not checked
android|testing|checkbox|android-espresso
27
17,207
6
39,650,813
39,650,813
55
true
2016-06-14T18:12:09.337Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android Espresso - Click checkbox if not checked<p>I have <code>onView(withId(R.id.check_box)).perform(click())</code>, but i only want to do this if the che...
43,998,661
How to increase the font size of method trace view in Android Studio?<p>In Android Studio, I captured a <a href="https://developer.android.com/studio/profile/am-methodtrace.html#trace" rel="noreferrer">Method Trace</a> use <a href="https://developer.android.com/studio/profile/am-cpu.html#running" rel="noreferrer">CPU M...
<p>I figure out they just hardcoded font size to 8. So there is only a very weird solution with patching Android Studio jar files.</p> <p>Steps:</p> <ol> <li>Find <code>/Applications/Android Studio.app/Contents/plugins/android/lib/sdk-tools.jar</code> </li> <li>Copy it somewhere else(do not forget to make a backup in...
How to increase the font size of method trace view in Android Studio?
android-studio
7
291
3
50,592,055
50,592,055
2
true
2017-05-16T10:16:29.847Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to increase the font size of method trace view in Android Studio?<p>In Android Studio, I captured a <a href="https://developer.android.com/studio/profile...
44,142,208
How to view/decrypt Ansible vault credentials files from within a Python script?<p>I'm trying to figure out how to provide the following facilities to a Python script so that it can:</p> <ol> <li>Import Ansible Python modules</li> <li>Open up my defined <code>ansible.cfg</code> and read <code>vault_password_file</code...
<p>Extending Kuba's answer, ansible-vault is a wrapper around VaultLib. It nicely handles the pre Ansible 2.4 version of Vaultlib along with the post 2.4 version. </p> <p>The ansible-vault load() method not only decrypts the file, but it also parses it and returns the contents as a dict. If you want the contents witho...
How to view/decrypt Ansible vault credentials files from within a Python script?
python|encryption|ansible|ansible-vault
13
20,807
7
50,859,586
50,859,586
3
true
2017-05-23T18:16:04.157Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to view/decrypt Ansible vault credentials files from within a Python script?<p>I'm trying to figure out how to provide the following facilities to a Pyth...
37,630,465
sbt: set specific scalacOptions options when compiling tests<p>Normally I use this set of options for compiling Scala code:</p> <pre><code>scalacOptions ++= Seq( "-deprecation", "-encoding", "UTF-8", "-feature", "-unchecked", "-language:higherKinds", "-language:implicitConversions", "-Xfata...
<p>Had the same issue, @Mike Slinn answer didn't work for me. I believe the test options extend the compile options? What eventually did the trick was explicitly removing ignored options from test</p> <p><code>scalacOptions in Test --= Seq( "-Ywarn-dead-code", "-Ywarn-value-discard")</code></p>
sbt: set specific scalacOptions options when compiling tests
scala|sbt
15
3,093
2
43,397,744
43,397,744
14
true
2016-06-04T12:53:35.007Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: sbt: set specific scalacOptions options when compiling tests<p>Normally I use this set of options for compiling Scala code:</p> <pre><code>scalacOptions ++=...
43,970,886
My first Autohotkey runs too slow<p>So it's been about 4 years since i've touched any sort of scripting and I wanted to get back into it for the sake of scripting. I love the problem solving that comes with it. Annnyyyyway.</p> <p>I was making a little bot to test out how far I could go for a first attempt. Now I know...
<p>Nevermind, I completely screwed up and I see now why. Thanks for the help guys....</p> <p>EDIT: VERY WELL.</p> <p>The whole script is just plain terrible like i said in the original post. As for what is wrong with it, not with the help of anyone here, even though I know there is people out there who have seen it a...
My first Autohotkey runs too slow
performance|autohotkey
-5
569
1
43,986,199
43,986,199
0
true
2017-05-15T02:44:17.433Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: My first Autohotkey runs too slow<p>So it's been about 4 years since i've touched any sort of scripting and I wanted to get back into it for the sake of scri...
43,988,632
Using unmanaged c++ objects in /clr<p>I've got some classes like class below written in c++ and i have to implement them into the Windows Forms. Is there any solution to create unmanaged objects in Windows Forms /clr classes?</p> <pre><code>#pragma once #ifndef _HOTEL_H #define _HOTEL_H #include "Room.h" #include "Adr...
<p>It sounds like you might want something along the lines of:</p> <pre><code>namespace SomeCompany { public ref class Hotel { ::Hotel* pHotel; public: Hotel() : pHotel(new ::Hotel()) {} ~Hotel() { delete pHotel; pHotel = nullptr; ...
Using unmanaged c++ objects in /clr
c++|clr|windows-forms-designer
-3
309
1
43,988,902
43,988,902
0
true
2017-05-15T20:53:27.030Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using unmanaged c++ objects in /clr<p>I've got some classes like class below written in c++ and i have to implement them into the Windows Forms. Is there any...
44,022,616
Using a variable to define a resource<p>I want to display 5 random dice, of the 6 sided variety. <br/><br/> I have code that generates 5 random integers between 1 and 6, and I have 5 ImageViews of dice. They have ids set to: d6_image_view_1, d6_image_view_2, etc. In the drawable folder, I have d1.jpg, d2.jpg, etc. S...
<p>There are no dynamic variables in Java. Java variables have to be declared in the source code. So a solution could be to make two arrays of integers for both drawable resources and view id's</p> <p>For example</p> <pre><code>int[] resourceIds = new int[] { R.drawable.d1, R.drawable.d2, R.drawable.d3, R.drawable.d4...
Using a variable to define a resource
java|android
-6
45
1
44,023,612
44,023,612
0
true
2017-05-17T10:43:24.037Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using a variable to define a resource<p>I want to display 5 random dice, of the 6 sided variety. <br/><br/> I have code that generates 5 random integers betw...
44,057,277
A PAGE with plugin of top posts (wordpress)<p>I need a plugin for create "most visited posts" page.</p> <p>NOT NEED ANY PLUGIN FOR A WIDGET, I WAN'T ANY WIDGET IN SIDEBAR.</p> <p>I search a lot but I haven't found anythink.</p> <p>Sorry for my english, thanks.</p>
<p>This will work: <a href="https://en-gb.wordpress.org/plugins/display-posts-shortcode/" rel="nofollow noreferrer">https://en-gb.wordpress.org/plugins/display-posts-shortcode/</a></p> <p>Just put the shortcode into the page you want the recent posts to show.</p>
A PAGE with plugin of top posts (wordpress)
wordpress|plugins
-3
37
1
44,057,366
44,057,366
0
true
2017-05-18T20:32:32.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: A PAGE with plugin of top posts (wordpress)<p>I need a plugin for create "most visited posts" page.</p> <p>NOT NEED ANY PLUGIN FOR A WIDGET, I WAN'T ANY WID...
44,058,605
Include opencv and boost libraries in .exe c++<p>After searching a lot I have been completely unable to find an answer to my issue.</p> <p>I have worked in a c++ source code using boost and opencv libraries, but now I want to create an executable which I can run in another computer with the same OS (Linux in this case...
<p>Up to now you have dynamically linked the libraries, which means that the compiler uses the header files and the linker uses the .lib files to know that there will be .dll files containing th compiled code corresponding to what's declared in the header files.to achieve what you want you need to statically link again...
Include opencv and boost libraries in .exe c++
eclipse|opencv|boost|c++14|static-libraries
-3
319
1
44,058,686
44,058,686
0
true
2017-05-18T22:15:10.467Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Include opencv and boost libraries in .exe c++<p>After searching a lot I have been completely unable to find an answer to my issue.</p> <p>I have worked in ...
44,078,742
calculating simple retention in R<p>For the dataset <code>test</code>, my objective is to find out how many unique users carried over from one period to the next on a period-by-period basis. </p> <pre><code>&gt; test user_id period 1 1 1 2 5 1 3 1 1 4 3 1 5 4 ...
<p>This isn't so elegant but it seems to work. Assuming <code>df</code> is the data frame:</p> <pre><code># make a list to hold unique IDS by uniques = list() for(i in 1:max(df$period)){ uniques[[i]] = unique(df$user_id[df$period == i]) } # hold the retention rates retentions = rep(NA, times = max(df$period)) for...
calculating simple retention in R
r|dplyr|retention
7
1,850
3
44,078,903
44,078,903
0
true
2017-05-19T20:46:23.553Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: calculating simple retention in R<p>For the dataset <code>test</code>, my objective is to find out how many unique users carried over from one period to the ...
43,989,900
What is this logical circuit and how does it work?<p><a href="https://i.stack.imgur.com/9yO2N.jpg" rel="nofollow noreferrer">This is the logic circuit</a> I've drawn a truth table and I've found that when:</p> <p>C and D are true, then Q is true and complement Q is false</p> <p>C is true but D is false, then compleme...
<p>It is a D-latch!</p> <p>When C is true (1) the value of D goes to Q.<br> When C is false (0), anything happens. (The Q dont change)</p> <p>This question isnt for here. Try <a href="https://www.electronicspoint.com" rel="nofollow noreferrer">this</a></p>
What is this logical circuit and how does it work?
logic|circuit
-3
39
1
44,098,629
44,098,629
0
true
2017-05-15T22:42:34.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is this logical circuit and how does it work?<p><a href="https://i.stack.imgur.com/9yO2N.jpg" rel="nofollow noreferrer">This is the logic circuit</a> I'...
44,113,235
Application Installation failed<p>When I attempted to run one of my projects,this I get this error message:</p> <pre><code>Installation failed with message INSTALL_FAILED_INSUFFICIENT_STORAGE. </code></pre> <p>It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, ...
<p>This error show because your device for test the application doesn't have enough storge for install The app. So clean and delete some files and try again to install the app</p>
Application Installation failed
android|android-studio|android-gradle-plugin|installation|apk
-3
289
1
44,113,337
44,113,337
0
true
2017-05-22T12:46:12.427Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Application Installation failed<p>When I attempted to run one of my projects,this I get this error message:</p> <pre><code>Installation failed with message ...
44,112,403
Yahoo Finance API / URL not working: Python fix for Pandas DataReader<p>Yahoo Finance URL has not been accessible using the Pandas DataReader's "yahoo" method since 16 May 2017. I have yet to test this fix-yahoo-finance: <a href="https://pypi.python.org/pypi/fix-yahoo-finance" rel="noreferrer">https://pypi.python.org/p...
<p>I have followed the steps in <a href="https://pypi.python.org/pypi/fix-yahoo-finance" rel="nofollow noreferrer">https://pypi.python.org/pypi/fix-yahoo-finance</a> to: $ pip3 install fix_yahoo_finance --upgrade --no-cache-dir and also upgraded pandas_datareader to be sure.</p> <p>The "fix-yahoo-finance 0.0.6" worked...
Yahoo Finance API / URL not working: Python fix for Pandas DataReader
python|yahoo-finance|pandas-datareader
7
15,399
4
44,166,463
44,166,463
0
true
2017-05-22T12:03:38.067Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Yahoo Finance API / URL not working: Python fix for Pandas DataReader<p>Yahoo Finance URL has not been accessible using the Pandas DataReader's "yahoo" metho...
44,157,502
I got error message Unable to find a target named `YOUR_APPLICATION_TARGET_NAME_HERE`, did find `FoodTracker` and `FoodTrackerTests`. how<pre><code># Uncomment the next line to define a global platform for your project platform :ios, '9.0' target 'FoodTracker' do # Comment the next line if you're not using Swift an...
<pre><code># Uncomment the next line to define a global platform for your project platform :ios, '9.0' target 'FoodTracker' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! source 'https://github.com/CocoaPods/Specs.git' # Pods for FoodTracker p...
I got error message Unable to find a target named `YOUR_APPLICATION_TARGET_NAME_HERE`, did find `FoodTracker` and `FoodTrackerTests`. how
ios|cocoapods
-3
2,580
1
44,173,841
44,173,841
0
true
2017-05-24T11:46:15.473Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I got error message Unable to find a target named `YOUR_APPLICATION_TARGET_NAME_HERE`, did find `FoodTracker` and `FoodTrackerTests`. how<pre><code># Uncomme...
44,179,280
How can one make an audio player for desktop having the knowledge of basic java?<p>I've learned basic java that means the OOP concept,loop,array,variable and some other stuffs.Currently I'm learning thread and I want to make an audio player for desktop using java for my class project.Since I've never made this sort of ...
<p>It wouldn't be too hard. Considering you want to do this project to learn, you should break it in several steps. The simplest audio player would be a command line one. You'll need to parse command line arguments and then play the audio.</p> <ul> <li><a href="https://stackoverflow.com/questions/26305/how-can-i-play-...
How can one make an audio player for desktop having the knowledge of basic java?
java|project|audio-player
-5
39
1
44,179,549
44,179,549
0
true
2017-05-25T11:18:52.300Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can one make an audio player for desktop having the knowledge of basic java?<p>I've learned basic java that means the OOP concept,loop,array,variable and...
44,198,722
Combine two queries in one<p>I should made a report from these datas:</p> <pre><code>|--------|---------------|------------|----------|--------------| | BIL_Id | BIL_BookingId | BIL_Date | BIL_Rate | BIL_Quantity | |--------|---------------|------------|----------|--------------| | 1 | 90 | 2017-04-0...
<p>You just need to mix both select clauses as </p> <pre><code>SELECT COUNT(*) AS total_nights, BIL_Date,SUM(BIL_Rate * BIL_Quantity) AS sumRevAccomodation FROM ___BillableDatas WHERE BIL_Date BETWEEN "2017-04-01" AND "2017-04-30" GROUP BY BIL_Date ASC </code></pre>
Combine two queries in one
mysql
-3
37
2
44,198,877
44,198,877
0
true
2017-05-26T10:00:49.093Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combine two queries in one<p>I should made a report from these datas:</p> <pre><code>|--------|---------------|------------|----------|--------------| | BIL...
44,211,979
i need an example of fixed px size and making the box different sizes<p>can anyone please give me an example of fixed px size and what is the use of it.</p> <p>and also can u please help me wrapping those input and labels inside a div element and making the box different sizes </p> <pre><code> &lt;label fo...
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>#container .subcontainer .label{ display:inline-block; width:100px } #container .subcontainer .input{ display:inline-block; ...
i need an example of fixed px size and making the box different sizes
html|css|input|label
-3
33
2
44,212,489
44,212,489
0
true
2017-05-27T01:14:49.883Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: i need an example of fixed px size and making the box different sizes<p>can anyone please give me an example of fixed px size and what is the use of it.</p> ...
44,217,910
Explain individual role of convertView and View Holder Pattern in ListView<p>Can anyone explain the individual role of convertView and View Holder Pattern in ListView, and how they increased the efficiency of listview?</p> <pre><code>private class PersonsAdapter extends ArrayAdapter&lt;Person&gt; { @Override ...
<ul> <li>convertView</li> </ul> <p>it's a view that was previously inflated (when <code>convertView==null</code>) and was on the screen, but now have been scrolled out of the screen, so you can re-use it to display data from the view that will enter the screen soon.</p> <p>improves performance by reducing view inflat...
Explain individual role of convertView and View Holder Pattern in ListView
android|listview|android-viewholder|convertview
-3
281
2
44,218,027
44,218,027
0
true
2017-05-27T14:16:00.173Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Explain individual role of convertView and View Holder Pattern in ListView<p>Can anyone explain the individual role of convertView and View Holder Pattern in...
44,270,164
Ruby on Rails Image Assets not found<p>On my Application.html.erb page I have my navbar and footer so that they are shared accross all pages. I am referencing images on this page as so </p> <pre><code> src="assets/img-1.jpg" </code></pre> <p>and they appear but only on my index page "localhost:3000". </p> <p>When...
<p>You must use the rails assets helpers to reference your image</p> <pre><code>= image_tag 'img-1.jpg' </code></pre> <p>And please have a look <a href="http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets" rel="nofollow noreferrer">here</a>, it will save you many a headache.</p>
Ruby on Rails Image Assets not found
ruby-on-rails
-4
564
2
44,270,409
44,270,409
0
true
2017-05-30T19:12:00.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ruby on Rails Image Assets not found<p>On my Application.html.erb page I have my navbar and footer so that they are shared accross all pages. I am referenci...
44,275,115
Replace a part of a word using c#<p>I need to change the string "DT1OutPassFail" as "DT4OutPassFail". I need to find "DT1" in the input string and replace it with "DT4" to get the output string. I need to do this using c#. "DT1" is the value in textbox1 and "DT4" is the value in textbox2. I tried the following options....
<pre><code>public string replaceString(string value) { string newValue; string findValue; string replaceValue; findValue = textBox1.Text; replaceValue = textBox2.Text; if(value.StartsWith(findValue)) newValue = value.Replace(findValue, replaceValue); else newValue = value; ...
Replace a part of a word using c#
c#
-5
50
2
44,275,190
44,275,190
0
true
2017-05-31T03:27:55.867Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace a part of a word using c#<p>I need to change the string "DT1OutPassFail" as "DT4OutPassFail". I need to find "DT1" in the input string and replace it...
44,289,368
How to plot with 2 grouping variables in R?<p>How can I plot this in R with Department and Year grouped, with Time as x-axis and Counts as y-axis? And have a line connecting and colors the same groups</p> <pre><code> Department Year Counts Time 1 CPD 2011 24 0 2 CPD 2011 28 1 3 CP...
<p>Do you mean something like this...</p> <pre><code>library(ggplot2) df$depYr &lt;- paste(df$Department,df$Year,sep="_") #set a combined dept_year variable ggplot(df,aes(x=Time,y=Counts,colour=depYr,group=depYr))+geom_line() </code></pre> <p><a href="https://i.stack.imgur.com/78bZh.png" rel="nofollow noreferrer"><i...
How to plot with 2 grouping variables in R?
r|plot
-3
53
1
44,289,505
44,289,505
0
true
2017-05-31T15:52:02.017Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to plot with 2 grouping variables in R?<p>How can I plot this in R with Department and Year grouped, with Time as x-axis and Counts as y-axis? And have a...
44,240,764
how to achieve this layout using collapsing toolbar<p><a href="https://i.stack.imgur.com/j1sPI.png" rel="nofollow noreferrer">https://i.stack.imgur.com/j1sPI.png</a></p> <p><a href="https://i.stack.imgur.com/LBd4O.png" rel="nofollow noreferrer">Please see the link for layout</a></p> <pre><code>&lt;?xml version="1.0" ...
<p>Actually the appbar is already having the elevation that's why it makes all the views to gets inside of itself.</p> <p>So just you need to give app:elevation="0dp" to the appbar layout. It gives all other views freedom to stay over itself.</p>
how to achieve this layout using collapsing toolbar
android|android-layout|listview|android-fragments
-3
74
2
44,306,337
44,306,337
0
true
2017-05-29T10:55:02.587Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to achieve this layout using collapsing toolbar<p><a href="https://i.stack.imgur.com/j1sPI.png" rel="nofollow noreferrer">https://i.stack.imgur.com/j1sPI...
44,340,783
i have a json data and i only return a captains on that data dynamically<pre><code>{ "team": { "players": { "1": { "teamName":"Royal Challenge Bangalore", "shortName":"RCB", "11":{ "name":"Virat Kholi", "Iscaptain":true, "postion":"2", "runs":"6000" }, "12":{ "name":"Chr...
<p>You can do it this way. <code>captains</code> will contain <code>NSDictionary</code> objects with related data</p> <pre><code> NSString *json = @"your json here..."; NSError *error; NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:[json dataUsingEncoding:NSUTF8StringEncoding] ...
i have a json data and i only return a captains on that data dynamically
objective-c
-3
32
1
44,341,473
44,341,473
0
true
2017-06-03T05:47:54.557Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: i have a json data and i only return a captains on that data dynamically<pre><code>{ "team": { "players": { "1": { "teamName":"Royal Challenge Bang...
44,041,827
In which branch should I build a docker image?<p>We have a react project that is based on <a href="https://github.com/kriasoft/react-static-boilerplate" rel="noreferrer">react-static-boilerplate</a> which will follow <a href="https://gist.github.com/djspiewak/9f2f91085607a4859a66" rel="noreferrer">git DMZ flow</a> and ...
<p>This depends on the tradeoffs you want to make. In ideal world, you would want to automate a docker build for every branch for testing. If that takes too much time, then you might want to design a base image to start with.</p> <p>Still, there is nothing wrong ignoring docker but let build without it. At that point,...
In which branch should I build a docker image?
git|reactjs|docker
7
791
1
44,448,905
44,448,905
0
true
2017-05-18T07:56:39.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In which branch should I build a docker image?<p>We have a react project that is based on <a href="https://github.com/kriasoft/react-static-boilerplate" rel=...
43,937,477
My code doesn't works for more than two digit numbers:<p>My code doesn't works for more than two digit numbers: Its simple code to find the minimum and maximum value in a list</p> <pre><code>lew = [input("Enter somthing") for i in range(1, 11)] mini = lew[0] maxi = lew[0] print(mini) print(maxi) for j in range(len(l...
<p><code>input()</code> returns a string in Python 3, therefore your code uses string comparison (<code>'10' &lt; '110'</code>). You should convert each input to an <code>int</code> (or <code>float</code> for that matter):</p> <p><code>lew = [int(input("Enter somthing")) for i in range(1, 11)]</code></p> <p>Also keep...
My code doesn't works for more than two digit numbers:
python-3.x
-3
28
2
43,937,536
43,937,536
1
true
2017-05-12T12:11:01.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: My code doesn't works for more than two digit numbers:<p>My code doesn't works for more than two digit numbers: Its simple code to find the minimum and max...
43,955,545
Understanding part of code<p>Can anyone explain to me what is the geodesic distance please?</p>
<p>A geodesic line is the shortest path between two points on a curved surface.</p>
Understanding part of code
matlab
-4
43
1
43,956,763
43,956,763
1
true
2017-05-13T16:41:16.747Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Understanding part of code<p>Can anyone explain to me what is the geodesic distance please?</p>
43,963,723
change the path of a file in folder<pre><code>file_path = path.relpath(file_path_images) with open(file_path, 'r') as f: for line in f: splitLine = line.split(' ') ls.append(splitLine[1].strip()) img.append(splitLine[0]) </code></pre> <p>when </p> <pre><code>print(img[0:10]) </code></pre> ...
<pre><code>import os abspaths = [os.path.join('/home/Downloads/mnt/ramdisk/max/90kDICT32px',relpath) for relpath in img] for image in abspaths: image=cv2.imread(image) </code></pre>
change the path of a file in folder
python|python-2.7
-3
42
1
43,977,794
43,977,794
1
true
2017-05-14T12:11:04.070Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: change the path of a file in folder<pre><code>file_path = path.relpath(file_path_images) with open(file_path, 'r') as f: for line in f: splitLine...
43,992,444
Rails Server Controller Error<p>I have written a rails application but when running rails server I am getting following error</p> <pre><code>"syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '(' ...? ? render("result") : Your url have a problem );@output_buf... ... ^" &lt;/div&gt; &lt;/div&gt...
<p>You need to enclose strings between <code>" "</code> or <code>' '</code> otherwise they will be treated as variables (or classes); <code>Your url have a problem</code> has no <code>""</code>, so that's causing the problem.</p> <p>Try changing this line:</p> <pre><code>&lt;%= @links.present? ? render("result") : Yo...
Rails Server Controller Error
ruby-on-rails
-4
32
1
43,992,463
43,992,463
1
true
2017-05-16T04:21:24.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rails Server Controller Error<p>I have written a rails application but when running rails server I am getting following error</p> <pre><code>"syntax error, ...
43,993,956
use variables in dict python 3<p>I want, use variables in dict, how can I? ex:</p> <pre><code>field_one= input("Please Enter Field Name? ==&gt; ") field_two= input("Please Enter Field Name? ==&gt; ") fields_data = dict(field_one=data_one, field_two=data_two) print (fields_data) </code></pre> <p>my problem is, the o...
<p>Use a dict literal:</p> <pre><code>fields_data = {field_one: data_one, field_two: data_two} </code></pre>
use variables in dict python 3
python|variables|dictionary
-4
44
1
43,993,986
43,993,986
1
true
2017-05-16T06:29:39.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: use variables in dict python 3<p>I want, use variables in dict, how can I? ex:</p> <pre><code>field_one= input("Please Enter Field Name? ==&gt; ") field_two...
43,992,506
How to fix "couldn't follow symbolic link" in Android Studio?<p>I'm now running an Android App project on Windows and running into the condition </p> <blockquote> <p>Error:Could not list contents of 'D:\source\App\src\main\res\drawable'. Couldn't follow symbolic link.</p> </blockquote> <p>after did the clean buil...
<p>Still do not know the real reason but problem solved by re-checkout source. Clean build did not work so I guess there's just something wrong in the project build-up steps.</p>
How to fix "couldn't follow symbolic link" in Android Studio?
android-studio|symlink
8
11,035
5
44,018,955
44,018,955
1
true
2017-05-16T04:27:28.267Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix "couldn't follow symbolic link" in Android Studio?<p>I'm now running an Android App project on Windows and running into the condition </p> <block...
44,040,939
Unable to change source image on button click event?<pre><code> var a; var b:Sprite; function Start () { a=GetComponent.&lt;UI.Image&gt;(); } function Clicked(){ a.SourceImage=b; } </code></pre> <p>The function clicked is called on a OnClick event. The error I get is: <em>MissingFieldException: Unit...
<p>Your error message is quite self-explanatory...</p> <p>Simply change <code>a.SourceImage=b;</code> to <code>a.sprite=b;</code>.</p> <p>Look for <a href="https://docs.unity3d.com/460/Documentation/ScriptReference/UI.Image.html" rel="nofollow noreferrer"><strong>Image</strong> component manual</a> next time: can be ...
Unable to change source image on button click event?
unity3d|unityscript
-3
54
1
44,041,273
44,041,273
1
true
2017-05-18T07:10:20.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to change source image on button click event?<pre><code> var a; var b:Sprite; function Start () { a=GetComponent.&lt;UI.Image&gt;(); } fu...
44,175,400
How to disable sorting for a specific columns in Ag-grid?<p>I am using <a href="https://www.ag-grid.com/" rel="noreferrer">https://www.ag-grid.com/</a> in one of my AngularJs projects.My requirement is to disable the sorting on any column while any grouping is happening.</p> <p>I know we can disable <code>sorting/filt...
<p>Finally, I solved the problem :), adding answer so it might help others</p> <blockquote> <p><strong>Note:</strong> I am not relying on Ag-Grid grouping I am getting after grouped data from my backend so below details can change for guys depending on Ag-Grids only</p> </blockquote> <p>Ag-Grid provides various e...
How to disable sorting for a specific columns in Ag-grid?
angularjs|ag-grid
7
13,378
3
44,184,821
44,184,821
1
true
2017-05-25T08:03:25.317Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to disable sorting for a specific columns in Ag-grid?<p>I am using <a href="https://www.ag-grid.com/" rel="noreferrer">https://www.ag-grid.com/</a> in on...
44,333,635
android.database.sqlite.SQLiteException: near "": syntax error (code 1): error while reading from database by matching two differ keywords<p>I am trying to get/read data by matching an Integer ID and a specific String, But while compiling the code I am getting this error : ...
<p>String should be between two <code>''</code> so instead :</p> <pre><code>String select_query= "SELECT * FROM " +MID_SEM_ANSWERS_TABLE + " WHERE " + KEY_ID + " = " + answerID +" AND " + KEY_SUBJECT + " = '" + subject + "'"; //----------------------------------------------------------^---------------^ </code></...
android.database.sqlite.SQLiteException: near "": syntax error (code 1): error while reading from database by matching two differ keywords
java|android|sql|database|sqlite
-3
54
1
44,333,682
44,333,682
1
true
2017-06-02T16:33:33.970Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: android.database.sqlite.SQLiteException: near "": syntax error (code 1): error while reading from database by matching two differ keywords<p>I am trying to g...
44,371,280
DIV not displaying all JSON retrieved data<p>Why is this code not displaying all the data. It cuts off the display. </p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { var url = "http://xxxxxxx/integration/json_news.php"; $.getJSON(url, function(result) { ...
<p>Unfortunately your js-generated HTML is not valid. </p> <p>You're appending table rows <code>tr</code> to <code>div</code>. They also contain <code>li</code>.</p> <p><code>tr</code> should be a child node of <code>table</code> and <code>li</code> should be a child node of <code>ul</code> or <code>ol</code>. </p> ...
DIV not displaying all JSON retrieved data
javascript|json|ajax|html|html-framework-7
-3
67
1
44,372,192
44,372,192
1
true
2017-06-05T14:29:44.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: DIV not displaying all JSON retrieved data<p>Why is this code not displaying all the data. It cuts off the display. </p> <pre><code>&lt;script type="text/ja...
44,120,230
Fix the bug! (how to call an asynchronous function inside a synchronous function)<p>The following question is taken from an interview. I was able to solve some parts, but I got stuck:</p> <p>Fix the bug in the following code. <em>DataContainer</em> is a wrapper around the database providing the cache for the data fetc...
<p><code>fetch</code> is synchronous, but <code>getAllData</code> is async, so the question is how do you make <code>getAllData</code> behave as if it were a synchronous function. One (and possibly the only) way you could achieve this is by using <code>async/await</code>:</p> <pre><code>DataContainer.prototype.fetch =...
Fix the bug! (how to call an asynchronous function inside a synchronous function)
javascript|asynchronous|synchronous
-4
266
1
44,120,552
44,120,552
2
true
2017-05-22T18:57:40.500Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fix the bug! (how to call an asynchronous function inside a synchronous function)<p>The following question is taken from an interview. I was able to solve so...
44,167,733
Laravel - how to makeVisible an attribute in a Laravel relation?<p>I use in my model code to get a relation</p> <pre><code>class User extends Authenticatable { // ... public function extensions() { return $this-&gt;belongsToMany(Extension::class, 'v_extension_users', 'user_uuid', 'extension_uuid');...
<p>Well, I got the idea from <a href="https://stackoverflow.com/a/38297876/518704">https://stackoverflow.com/a/38297876/518704</a></p> <p>Since my relation model <code>Extension::class</code> is called by name in my code <code>return $this-&gt;belongsToMany(Extension::class,...</code> I cannot even pass parameter to i...
Laravel - how to makeVisible an attribute in a Laravel relation?
laravel
7
17,201
3
44,169,024
44,169,024
2
true
2017-05-24T20:17:50.897Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel - how to makeVisible an attribute in a Laravel relation?<p>I use in my model code to get a relation</p> <pre><code>class User extends Authenticatabl...
44,190,130
PHP Adding specific key together in multidimensional arrays<p>Let's say I have <strong>Array A</strong></p> <pre><code>Array ( [0] =&gt; Array ( [0] =&gt; 1491292800000 [1] =&gt; 30 ) [1] =&gt; Array ( [0] =&gt; 1491296400000 [1] =&gt; 20...
<p>The simplest solution would be to use <code>array_map</code>.</p> <pre><code>$a = [ [1491292800000, 30], [1491296400000, 20], ]; $b = [ [1491292800000, 15], [1491296400000, 10], ]; $merged = array_map(function ($a, $b) { $a[1] += $b[1]; return $a; }, $a, $b); </code></pre>
PHP Adding specific key together in multidimensional arrays
php|arrays|multidimensional-array
-3
53
1
44,190,215
44,190,215
2
true
2017-05-25T21:28:53.777Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP Adding specific key together in multidimensional arrays<p>Let's say I have <strong>Array A</strong></p> <pre><code>Array ( [0] =&gt; Array (...
44,236,352
which jquery plug-in for bootstrap data grid<p>Any jquery plug-in that can give me an editable data-grid with drop-downs and popups on specific columns? Where I can also have some fixed rows etc.</p> <p>I have a bootstrap table which i just want to look better and let the user do in-line editing (like excel), sorting,...
<p>Use Js-Grid</p> <p>here is official example <a href="http://js-grid.com/demos/" rel="nofollow noreferrer">Js-Grid</a></p>
which jquery plug-in for bootstrap data grid
jquery|twitter-bootstrap|jquery-ui
-3
22
1
44,236,444
44,236,444
2
true
2017-05-29T07:00:57.333Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: which jquery plug-in for bootstrap data grid<p>Any jquery plug-in that can give me an editable data-grid with drop-downs and popups on specific columns? Wher...
44,133,045
c++ class with 'operator=' and vector, I don't know how to use it correctly<p>I tried to use operator= on a specific edge from a vector (of Edge) in a specific Vertex. but I got this error: </p> <blockquote> <p>source_file.cpp: In member function ‘void Graph::addEdges(int, int, int, int)’: source_file.cpp:43:26: e...
<p>In your <code>Vertex</code> class when you do</p> <pre><code>vector&lt;Edge&gt; arr2[maxVer-1]; </code></pre> <p>you don't declare one vector with the size of <code>maxVer-1</code> elements, you declare an <em>array</em> of <code>maxVer-1</code> number of vectors.</p> <p>If you want a single vector then do:</p> ...
c++ class with 'operator=' and vector, I don't know how to use it correctly
c++|class|vector|struct
-3
49
1
44,133,107
44,133,107
3
true
2017-05-23T11:05:08.700Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: c++ class with 'operator=' and vector, I don't know how to use it correctly<p>I tried to use operator= on a specific edge from a vector (of Edge) in a specif...
44,151,670
Search a table in all databases in hive<p>In Hive, how do we search a table by name in all databases?</p> <p>I am a Teradata user. Is there any counterpart of systems tables (present in Teradata) like dbc.tables, dbc.columns which are present in HIVE?</p>
<p>You should query the metastore.</p> <p>You can find the connection properties within <code>hive-site.xml</code></p> <p><strong>bash</strong></p> <pre><code>&lt;$HIVE_HOME/conf/hive-site.xml grep -A1 jdo </code></pre> <hr> <pre><code> &lt;name&gt;javax.jdo.option.ConnectionURL&lt;/name&gt; &lt;value&gt;jd...
Search a table in all databases in hive
hadoop|hive|hdfs|hiveql
10
41,027
7
44,152,074
44,152,074
3
true
2017-05-24T07:25:06.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Search a table in all databases in hive<p>In Hive, how do we search a table by name in all databases?</p> <p>I am a Teradata user. Is there any counterpart ...
44,231,685
Boost python getter/setter with the same name<p>I am wrapping C++ classes with boost-python and I am wondering is there is a better way to do it than what I am doing now.</p> <p>The problem is that the classes have getters/setters that have the same name and there doesn't seem to be a painless way to wrap this with bo...
<p>You can do this by casting to appropriate overload (untested):</p> <pre><code>class_&lt;Foo&gt;("Foo", init&lt;&gt;()) .add_property("x", static_cast&lt; double(Foo::*)() const &gt;(&amp;Foo::x), // getter static_cast&lt; void(Foo::*)(const double) &gt;(&amp;Foo:...
Boost python getter/setter with the same name
python|c++|boost-python
9
1,033
1
44,238,906
44,238,906
3
true
2017-05-28T20:22:45.820Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Boost python getter/setter with the same name<p>I am wrapping C++ classes with boost-python and I am wondering is there is a better way to do it than what I ...
44,235,802
LeafletJS : How to use L.Routing.itinerary in leafletjs and hover event on route?<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var mymap = L.map('mapid').setView([1.369115, 103.8...
<p>You can check Leaflet Label Plugin. Install Leaflet Label Plugin.</p> <p>URL : <a href="https://github.com/Leaflet/Leaflet.label" rel="nofollow noreferrer">https://github.com/Leaflet/Leaflet.label</a></p> <p>Good Luck!!</p>
LeafletJS : How to use L.Routing.itinerary in leafletjs and hover event on route?
javascript|jquery|leaflet
10
3,604
1
44,281,115
44,281,115
3
true
2017-05-29T06:21:08.807Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: LeafletJS : How to use L.Routing.itinerary in leafletjs and hover event on route?<p><div class="snippet" data-lang="js" data-hide="false" data-console="true"...
44,341,327
Javascript - format number to 3 decimals<p>trying to convert the number to a 3 decimals only but .toFixed(3) is being ignored. Any idea? Thx </p> <pre><code>output2=output2.split("\n").filter(/./.test, /Number/).map(line =&gt; line.split(/,|\(|\)/).filter(number =&gt; number != "")[8]).join("\n")*(0.00254).toFixed(...
<p>Wrap all the expression in parentheses as <code>toFixed</code> is called on <code>(0.00254)</code> instead of the multiplication result.</p> <pre><code>output2 = ( output2.split("\n") .filter(/./.test, /Number/) .map(line =&gt; line.split(/,|\(|\)/) .filter(number =&gt; number != "")[8] ) .join("\n")...
Javascript - format number to 3 decimals
javascript|html
-3
31
1
44,341,372
44,341,372
3
true
2017-06-03T07:05:22.750Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript - format number to 3 decimals<p>trying to convert the number to a 3 decimals only but .toFixed(3) is being ignored. Any idea? Thx </p> <pre><c...
37,823,712
Is it possible to format code in Visual Studio Team Services<p>Is there a means to <strong>format code snippets</strong> in any way, ideally a Markdown like syntax, in Visual Studio Team Services (formerly Visual Studio Online)?</p> <p>Using italics just doesn't sit right with me.</p> <p><a href="https://i.stack.imgu...
<p>Just found this extension from the feature request <a href="https://stackoverflow.com/a/37825137/80428">@eddie linked</a>.</p> <h1><a href="https://marketplace.visualstudio.com/items?itemName=cschleiden.markdown" rel="nofollow noreferrer">Markdown</a></h1> <blockquote> <p>Markdown is a custom work item form control,...
Is it possible to format code in Visual Studio Team Services
azure-devops|code-formatting
13
2,833
3
44,449,201
44,449,201
3
true
2016-06-14T23:22:18.540Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to format code in Visual Studio Team Services<p>Is there a means to <strong>format code snippets</strong> in any way, ideally a Markdown like ...
43,975,986
conversion column names into first row<p>I would like to convert the following dataframe into a json . </p> <pre><code>df: A sector B sector C sector TTM Ratio                 --   35.99   12.70  20.63  14.75      23.06 RRM Sales ...
<p>Use assign by <code>list</code> of <code>range</code> and original column names:</p> <pre><code>print (range(len(df.columns))) range(0, 6) #for python2 list can be omit df.columns = [list(range(len(df.columns))), df.columns] </code></pre> <p>Or <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas...
conversion column names into first row
pandas
7
5,682
2
43,976,003
43,976,003
4
true
2017-05-15T09:34:13.820Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: conversion column names into first row<p>I would like to convert the following dataframe into a json . </p> <pre><code>df: A ...
44,077,404
How to skip lines while reading a CSV file as a dataFrame using PySpark?<p>I have a CSV file that is structured this way:</p> <pre><code>Header Blank Row "Col1","Col2" "1,200","1,456" "2,000","3,450" </code></pre> <p>I have two problems in reading this file. </p> <ol> <li>I want to Ignore the Header and Ignore the b...
<p>Answer by Zlidime had the right idea. The working solution is this:</p> <pre><code>import csv customSchema = StructType([ \ StructField("Col1", StringType(), True), \ StructField("Col2", StringType(), True)]) df = sc.textFile("file.csv")\ .mapPartitions(lambda partition: csv.reader([line.replace('...
How to skip lines while reading a CSV file as a dataFrame using PySpark?
apache-spark|pyspark|spark-dataframe|pyspark-sql
10
42,275
5
44,163,892
44,163,892
4
true
2017-05-19T19:09:07.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to skip lines while reading a CSV file as a dataFrame using PySpark?<p>I have a CSV file that is structured this way:</p> <pre><code>Header Blank Row "C...
44,212,531
Gradle DSL method not found: 'testCompile()'<p>I am trying to build a project a Project in Android Studio. When I run the app, I get this error:</p> <pre><code>Error:(10, 0) Gradle DSL method not found: 'testCompile()' Possible causes: -The project 'AccurateCalculator' may be using a version of the Android Gradle plug-...
<p>As the warning suggests, upgrading the plugin to <code>2.3.2</code> should resolve the issue:</p> <pre><code>classpath 'com.android.tools.build:gradle:2.3.2' </code></pre>
Gradle DSL method not found: 'testCompile()'
android|android-studio|gradle|android-gradle-plugin|build.gradle
11
16,950
2
44,212,542
44,212,542
4
true
2017-05-27T03:04:02.633Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Gradle DSL method not found: 'testCompile()'<p>I am trying to build a project a Project in Android Studio. When I run the app, I get this error:</p> <pre><co...
43,965,820
Replacement for AppDomain.GetLoadedAssemblies() in .NET Core?<p>I'm trying to write some logic to mirror some existing logic in an original .NET application. In my <code>OnModelCreating()</code> method I want to load all current types in loaded assemblies to find the ones that need to be registered for entity type conf...
<p>Fixed this by upgrading my <code>.netstandard</code> projects from <code>1.4</code> to <code>1.6</code>. The package <code>Microsoft.Extensions.DependencyModel 1.1.2</code> now works.</p> <p><strong>Edit:</strong></p> <p>Using <code>.netstandard2.0</code> removes the need for an <code>AppDomain</code> polyfill cla...
Replacement for AppDomain.GetLoadedAssemblies() in .NET Core?
c#|.net|asp.net-core|.net-core
7
6,411
2
43,967,091
43,967,091
5
true
2017-05-14T15:40:42.520Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replacement for AppDomain.GetLoadedAssemblies() in .NET Core?<p>I'm trying to write some logic to mirror some existing logic in an original .NET application....
43,927,106
scaleY property not maintained properly for small screens<ul> <li>I am tryng to fix a css bug for mobile screens</li> <li>when I click section 1 content opens and if i move till the bottom of the section one content and after that if I click section 1 content closes.</li> <li>but I dont see section 2 after that I see s...
<p>We need to invoke properly on the select function</p> <pre><code>onSelect() { this.props.onSelect(this.props.id); this.focusDiv(); } </code></pre>
scaleY property not maintained properly for small screens
javascript|html|css|reactjs
11
268
2
43,968,261
43,968,261
5
true
2017-05-11T23:26:12.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: scaleY property not maintained properly for small screens<ul> <li>I am tryng to fix a css bug for mobile screens</li> <li>when I click section 1 content open...
44,000,640
React Navigation on tab change<p>Without using Redux, how do I detect a tab change with a react navigation tab navigator? </p> <p>I know I need to somehow use onNavigationStateChange but I can't figure out how to update the current view. </p> <pre class="lang-js prettyprint-override"><code>export default () =&gt; &lt...
<pre class="lang-js prettyprint-override"><code>export default () =&gt; &lt;MyTabNav ref={(ref) =&gt; { this.nav = ref; }} onNavigationStateChange={(prevState, currentState) =&gt; { const getCurrentRouteName = (navigationState) =&gt; { if (!navigationState) return null; const route = na...
React Navigation on tab change
react-native|react-navigation
13
26,396
5
44,027,538
44,027,538
5
true
2017-05-16T11:48:42.667Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Navigation on tab change<p>Without using Redux, how do I detect a tab change with a react navigation tab navigator? </p> <p>I know I need to somehow u...
44,182,232
Bootstrap 3 table-responsive not working. X-scrollbar appears on whole site rather than table<p>When my screen width decreases smaller than the minimum width my table is able to display, rather than getting a horizontal scrollbar on the <code>table-responsive</code> wrapper, it is increasing the width of my whole site....
<p>Thanks to everyone who offered a solution. All of them seem to involve setting the width of my wrapper to 100%, like this:</p> <pre><code>#aspnet-placeholder-content { flex: 1 0 auto; width: 100%; } </code></pre> <p>The problem is, this nullifies the <code>.container</code> bootstrap styling, which sets hard-c...
Bootstrap 3 table-responsive not working. X-scrollbar appears on whole site rather than table
html|css|twitter-bootstrap|responsive-design
10
2,345
4
44,287,958
44,287,958
5
true
2017-05-25T13:47:49.530Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bootstrap 3 table-responsive not working. X-scrollbar appears on whole site rather than table<p>When my screen width decreases smaller than the minimum width...
44,270,029
Android TalkBack: Is there a Listener to catch all Accessibility Events?<p><strong>Background: What is the problem</strong></p> <p>My app has this acronym for a word let us assume it is</p> <blockquote> <p>ABC</p> </blockquote> <p>When I use Google's voice service it reads out the letters which is great</p> <p>Ho...
<p>No accessibility events/delegates do not apply to Activities, and they don't need to. Every <code>Activity</code> should have a root/content view that is an instance of <code>ViewGroup</code>. This has worked well for me to filter all accessibility events within an activity:</p> <pre><code>@Override protected void ...
Android TalkBack: Is there a Listener to catch all Accessibility Events?
android|talkback|accessibility
7
5,450
2
44,293,968
44,293,968
5
true
2017-05-30T19:04:11.500Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android TalkBack: Is there a Listener to catch all Accessibility Events?<p><strong>Background: What is the problem</strong></p> <p>My app has this acronym f...
44,103,460
Compiling SML projects from multiple files<p>I've got a project with many files in it and I want it to work with most popular compilers.</p> <p>Unfortunately, PolyML and SML/NJ require <code>use</code> statements, while MosML additionally requires explicitly loading basis library structures using <code>load</code>, wh...
<p>The use function is the standard universal &quot;include this file&quot; command, included in the <a href="http://sml-family.org/Basis/top-level-chapter.html" rel="nofollow noreferrer">Top-level environment</a></p> <pre><code>val use : string -&gt; unit implementation dependent </code></pre> <p>I generally mainta...
Compiling SML projects from multiple files
sml|smlnj|polyml|mlton|mosml
8
585
1
44,104,406
44,104,406
6
true
2017-05-22T01:37:10.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Compiling SML projects from multiple files<p>I've got a project with many files in it and I want it to work with most popular compilers.</p> <p>Unfortunatel...
44,265,919
Safe to store access token inside AsyncStorage?<p>I am looking at storing a user access token within a React Native application. Initially I have been looking at Redux but instead I noticed that RN has <code>AsyncStorage</code>, now I am assuming that this in the case of IOS is the equivalent of <code>NSUserDefaults</c...
<p>AsyncStorage may not be the good solution, depend how your server handle your request.</p> <p>However you can use Redux, and Redux-persist, using the transform parameter you can encrypt your data,</p> <p><a href="https://github.com/rt2zz/redux-persist#transforms" rel="nofollow noreferrer">https://github.com/rt2zz/...
Safe to store access token inside AsyncStorage?
reactjs|react-native
7
5,388
4
44,267,815
44,267,815
6
true
2017-05-30T15:10:48.547Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Safe to store access token inside AsyncStorage?<p>I am looking at storing a user access token within a React Native application. Initially I have been lookin...
44,275,202
What state is kept between JavaScript lines?<p>I was wondering what states are kept between two lines of JavaScript code submitted to <code>babel-node</code>. My confusion arises because if you write two lines of code, you can override an variable definition without an error. For example, with <code>babel-node --preset...
<p>Because <code>const</code> and <code>let</code> are new syntaxes, they must be transpiled to the only binding mechanism that was available before ES6: <code>var</code>. In which case, <code>var</code> allows all sorts of haphazard reassignment without generating any kind of warning.</p> <p>So when you type an expre...
What state is kept between JavaScript lines?
javascript|node.js|ecmascript-6|babeljs
7
79
2
44,275,501
44,275,501
6
true
2017-05-31T03:37:44.247Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What state is kept between JavaScript lines?<p>I was wondering what states are kept between two lines of JavaScript code submitted to <code>babel-node</code>...
37,820,454
Read from a channel or timeout?<p>With Rust 1.9, I'd like to read from a <code>mpsc::channel</code> <em>or</em> timeout. Is there a clear idiom to make this work? I've seen the unstable approach described in <a href="https://doc.rust-lang.org/std/sync/mpsc/struct.Select.html"><code>mpsc::Select</code></a> but <a href="...
<p>Rust 1.12 introduced <a href="https://doc.rust-lang.org/std/sync/mpsc/struct.Receiver.html#method.recv_timeout" rel="noreferrer"><code>Receiver::recv_timeout</code></a>:</p> <pre><code>use std::sync::mpsc::channel; use std::time::Duration; fn main() { let (.., rx) = channel::&lt;bool&gt;(); let timeout = D...
Read from a channel or timeout?
multithreading|rust|channels
10
1,565
3
43,941,762
43,941,762
7
true
2016-06-14T19:21:58.677Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Read from a channel or timeout?<p>With Rust 1.9, I'd like to read from a <code>mpsc::channel</code> <em>or</em> timeout. Is there a clear idiom to make this ...
44,089,525
Why can't I mutably borrow a primitive from an enum?<p>I would like to be able to obtain references (both immutable and mutable) to the <code>usize</code> wrapped in <code>Bar</code> in the <code>Foo</code> enum:</p> <pre><code>use Foo::*; #[derive(Debug, PartialEq, Clone)] pub enum Foo { Bar(usize) } impl Foo {...
<p>These examples show the sample problem:</p> <pre><code>fn implicit_reborrow&lt;T&gt;(x: &amp;mut T) -&gt; &amp;mut T { x } fn explicit_reborrow&lt;T&gt;(x: &amp;mut T) -&gt; &amp;mut T { &amp;mut *x } fn implicit_reborrow_bad&lt;T&gt;(x: &amp;mut T) -&gt; &amp;mut T { &amp;mut x } fn explicit_reborro...
Why can't I mutably borrow a primitive from an enum?
enums|rust|borrow-checker
9
804
2
44,097,827
44,097,827
7
true
2017-05-20T18:37:23.897Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why can't I mutably borrow a primitive from an enum?<p>I would like to be able to obtain references (both immutable and mutable) to the <code>usize</code> wr...
44,129,122
Checking if a day is the same day (but not year) with momentjs<p>I'm using <code>momentjs</code> to determine wether or not a date is a persons birthday. But for some reason <code>moment</code> always returns <code>false</code> and I'm not sure why.</p> <p><strong>Used code</strong></p> <pre><code>moment(dateObject)....
<p>If you want to check only day of the month and the month, you can write your own function using <a href="http://momentjs.com/docs/#/get-set/date/" rel="noreferrer"><code>date()</code></a> and <a href="http://momentjs.com/docs/#/get-set/month/" rel="noreferrer"><code>month()</code></a> getters.</p> <p>Here a sample:...
Checking if a day is the same day (but not year) with momentjs
momentjs
7
6,730
2
44,129,344
44,129,344
7
true
2017-05-23T08:03:18.583Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Checking if a day is the same day (but not year) with momentjs<p>I'm using <code>momentjs</code> to determine wether or not a date is a persons birthday. But...
44,180,779
how to give border and border-radius to stacklayout in nativescript<p>I'm new to nativescript.I don't know how to give border and border-radius to stacklayout.</p> <p>Below I have posted what I tried so far:</p> <p><strong>component.html:</strong></p> <pre><code> &lt;StackLayout class ="stackBorder" orientation="hor...
<p>In nativescript supported css properties are border-width, border-color and border-radius. Tag border alone is not possible nor any solid selection.</p> <p>More info:</p> <p><a href="https://docs.nativescript.org/ui/styling" rel="noreferrer">https://docs.nativescript.org/ui/styling</a></p>
how to give border and border-radius to stacklayout in nativescript
css|typescript|nativescript|angular2-nativescript
7
7,487
3
44,181,602
44,181,602
7
true
2017-05-25T12:37:28.760Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to give border and border-radius to stacklayout in nativescript<p>I'm new to nativescript.I don't know how to give border and border-radius to stacklayou...
44,167,577
Using Private API To read WiFi RSSI Value<p>I'm working on something that will not need to be on the App store, so I have no issues with using private APIs to meet my needs I'm trying to use the <code>MobileWiFi. framework to read the RSSI value for the wireless network the phone is currently connected to. I've include...
<p>I ended up using this workaround:</p> <pre><code>+ (int) wifiStrength { UIApplication *app = [UIApplication sharedApplication]; NSArray *subviews = [[[app valueForKey:@"statusBar"] valueForKey:@"foregroundView"] subviews]; NSString *dataNetworkItemView = nil; for (id subview in subviews) { if([subview isKindOf...
Using Private API To read WiFi RSSI Value
ios|swift
8
5,177
4
44,190,108
44,190,108
7
true
2017-05-24T20:07:23.103Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Private API To read WiFi RSSI Value<p>I'm working on something that will not need to be on the App store, so I have no issues with using private APIs t...
44,351,524
May I destroy a mutexattr object before the mutex that was initialized with this mutexattr is used?<p>Consider the following code:</p> <pre><code>pthread_mutexattr_t attr; pthread_mutexattr_init(&amp;attr); pthread_mutexattr_setrobust(&amp;attr, PTHREAD_MUTEX_ROBUST); pthread_mutex_t mut; pthread_mutex_init(&amp;mut,...
<p>Like the <a href="https://linux.die.net/man/3/pthread_mutexattr_init" rel="noreferrer">manual</a> say:</p> <blockquote> <p>After a mutex attributes object has been used to initialize one or more mutexes, any function affecting the attributes object (including destruction) shall not affect any previously initializ...
May I destroy a mutexattr object before the mutex that was initialized with this mutexattr is used?
c|attributes|pthreads|posix|mutex
7
324
1
44,351,585
44,351,585
7
true
2017-06-04T06:52:28.980Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: May I destroy a mutexattr object before the mutex that was initialized with this mutexattr is used?<p>Consider the following code:</p> <pre><code>pthread_mu...
44,182,695
How to auto-generate deploy.cmd in new Azure CLI?<p>I'm following <a href="https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-python-configure" rel="noreferrer">this guide</a> to create a web app with a custom <code>deploy.cmd</code> file. The article suggests that I can get a copy of the current <code>de...
<p>Based on my knowledge, there is not an equivalent to <code>azure site deploymentscript</code> in azure cli(2.0). So, you could not do deploy custom script with Azure CLI 2.0.</p> <p>You had better know the difference between Azure cli 2.0(az) with Azure cli 1.0(azure).</p> <blockquote> <p>Azure CLI 2.0: Our nex...
How to auto-generate deploy.cmd in new Azure CLI?
azure|azure-web-app-service|azure-cli
7
2,885
2
44,192,457
44,192,457
8
true
2017-05-25T14:11:05.800Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to auto-generate deploy.cmd in new Azure CLI?<p>I'm following <a href="https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-python-configure"...
43,946,993
Mock context.Done() in unit test<p>I have a HTTP handler that sets a context deadline on each request:</p> <pre><code>func submitHandler(stream chan data) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { ctx, cancel := context.WithTimeout(r.Context(), 5*time.Second) defer ca...
<p>So, after much trial and error I figured out what I was doing wrong. Instead of trying to create a mock <code>context.Context</code>, I created a new one with an expired deadline and immediately called the returned <code>cancelFunc</code>. I then passed this to <code>req.WithContext()</code> and now it works like a ...
Mock context.Done() in unit test
unit-testing|go
8
8,007
2
43,954,344
43,954,344
9
true
2017-05-12T21:55:24.193Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mock context.Done() in unit test<p>I have a HTTP handler that sets a context deadline on each request:</p> <pre><code>func submitHandler(stream chan data) h...
44,067,851
Expand use block in PhpStorm<p>How to expand "use block" at the top of class in PhpStorm 2017.1 by default to see all imported namespaces? Is there any setting?</p> <p><a href="https://i.stack.imgur.com/9FCei.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9FCei.png" alt="enter image description here"></a></...
<p>You can set these kind of settings in the <code>code folding</code> area. In this case these are <code>Imports</code> so check those off in the settings.</p> <p>Go to: Settings > Editor > General > Code folding</p> <p>See image. <br> <a href="https://i.stack.imgur.com/Vp3J8.png" rel="noreferrer"><img src="https:/...
Expand use block in PhpStorm
php|phpstorm|phpstorm-2017.1
9
792
2
44,068,982
44,068,982
9
true
2017-05-19T10:36:47.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Expand use block in PhpStorm<p>How to expand "use block" at the top of class in PhpStorm 2017.1 by default to see all imported namespaces? Is there any setti...
44,330,291
Converting DDMMYYYY with dateutil.parser<p>I have the following string input : <code>24052017</code>. When I try to do:</p> <pre><code>&gt;&gt;&gt;dateutil.parser.parse("24052017") </code></pre> <p>It tells me that <code>month must be in 1..12</code>.</p> <p>I have even tried doing:</p> <pre><code>&gt;&gt;&gt;dateu...
<p>This format is currently not supported by <code>dateutil</code>. In general, if you know the format of your date and it does not have time zones, you should just use <code>datetime.datetime.strptime</code> to parse your dates, as <code>dateutil.parser.parse</code> has a considerable amount of overhead that it uses ...
Converting DDMMYYYY with dateutil.parser
python|python-dateutil
8
13,891
5
44,330,696
44,330,696
9
true
2017-06-02T13:36:09.630Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting DDMMYYYY with dateutil.parser<p>I have the following string input : <code>24052017</code>. When I try to do:</p> <pre><code>&gt;&gt;&gt;dateutil....
44,332,074
Is cbegin/cend not enough for a range based for loop?<p>I have a class, let's call it ConstVector, that only defines cbegin/cend and not begin/end because I don't want to allow modifications to its members after construction. I tried to use the range based for loop like this:</p> <pre><code>ConstVector const_vector(1,...
<blockquote> <p>Do I have to implement begin/end?</p> </blockquote> <p>Yes.</p> <blockquote> <p>As far as I understood it, it should choose <code>cbegin/cend</code> if it's <code>const auto &amp;x</code> and not <code>auto &amp;x</code>.</p> </blockquote> <p>That's not how the range-based <code>for</code> is def...
Is cbegin/cend not enough for a range based for loop?
c++
9
1,093
1
44,332,397
44,332,397
9
true
2017-06-02T15:06:19.217Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is cbegin/cend not enough for a range based for loop?<p>I have a class, let's call it ConstVector, that only defines cbegin/cend and not begin/end because I ...
43,928,063
Is it possible to pylint for a specific error code?<p>I want to pylint a project against unused imports to make upgrading a module easier (W0611). </p>
<p>just figured it out from some trial and error, a little hard to figure out by reading the docs only:</p> <p><code>pylint --disable=all --enable=W0611</code></p>
Is it possible to pylint for a specific error code?
python|pylint
7
841
1
43,928,076
43,928,076
10
true
2017-05-12T01:46:05.100Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to pylint for a specific error code?<p>I want to pylint a project against unused imports to make upgrading a module easier (W0611). </p>
43,935,818
Is it a good practice to use Realm with try-with-resources?<p>In many places there are recommendations to call <code>Realm.getDefaultInstance()</code> in <code>onCreate</code> method of the <code>Activity</code> and call <code>close</code> on Realm instance in <code>onDestroy</code> (or in corresponding methods of pres...
<blockquote> <p>is it a bad practice to use Realm in such way?</p> </blockquote> <p>No, this is recommended for <strong>background threads</strong>.</p> <p>See <a href="https://realm.io/docs/java/latest/#closing-realm-instances" rel="noreferrer">https://realm.io/docs/java/latest/#closing-realm-instances</a> in the ...
Is it a good practice to use Realm with try-with-resources?
java|realm|try-with-resources
7
832
1
43,937,182
43,937,182
10
true
2017-05-12T10:42:43.253Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it a good practice to use Realm with try-with-resources?<p>In many places there are recommendations to call <code>Realm.getDefaultInstance()</code> in <co...
44,057,003
How to annotate Django view's methods?<p>I'd like to use Python <a href="https://www.python.org/dev/peps/pep-0484/" rel="noreferrer">type hints</a> in my Django project. What's the proper way to annotate <code>get</code>/<code>post</code> methods of a simple <a href="https://docs.djangoproject.com/en/dev/topics/class-b...
<p>There exists this repository which may interest you: <a href="https://github.com/machinalis/mypy-django" rel="noreferrer">https://github.com/machinalis/mypy-django</a> <br> which will allow you to use annotations like so:</p> <pre><code>def get(self, request: HttpRequest, question_id: str) -&gt; HttpResponse: </cod...
How to annotate Django view's methods?
python|django|annotations|type-hinting
9
2,852
3
44,057,290
44,057,290
10
true
2017-05-18T20:13:09.993Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to annotate Django view's methods?<p>I'd like to use Python <a href="https://www.python.org/dev/peps/pep-0484/" rel="noreferrer">type hints</a> in my Dja...
44,109,468
Ansible list of dicts - accessing keys after a list filter<p>Taking this playbook YAML:</p> <pre><code>--- - hosts: localhost become: false vars: list_of_dicts: - { key1: "cccc", key2: "dddd" } - { key1: "aaaa", key2: "bbbb" } tasks: - name: debug list debug: msg: "{{ list_of_di...
<p><em>This is for sure a duplicate, but I can't find corresponding answer. I wish SO had a better search engine.</em></p> <p>You can group expressions in Jinja2, like follows:</p> <pre><code>(list_of_dicts|sort(attribute='key1')|first).key2 </code></pre>
Ansible list of dicts - accessing keys after a list filter
dictionary|ansible|jinja2
7
6,196
1
44,109,965
44,109,965
10
true
2017-05-22T09:32:15.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ansible list of dicts - accessing keys after a list filter<p>Taking this playbook YAML:</p> <pre><code>--- - hosts: localhost become: false vars: li...
44,172,274
Principal Components Analysis:Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric<p>I'm trying to execute a Principal Components Analysis, but I'm getting the error: Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric</p> <p>I know all the columns have to be numeric, but how to handle when you have character...
<p>You can convert a character vector to numeric values by going via <code>factor</code>. Then each unique value gets a unique integer code. In this example, there's four values so the numbers are 1 to 4, in alphabetical order, I think:</p> <pre><code>&gt; d = data.frame(country=c("foo","bar","baz","qux"),x=runif(4),y...
Principal Components Analysis:Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric
r
7
74,532
3
44,174,879
44,174,879
10
true
2017-05-25T04:28:08.797Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Principal Components Analysis:Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric<p>I'm trying to execute a Principal Components Analysis, but I'm getti...
44,252,759
Pandas: How to concatenate dataframes with different columns?<p>I tried to find the answer in the official <a href="http://pandas.pydata.org/pandas-docs/stable/merging.html" rel="noreferrer">Pandas documentation</a>, but found it more confusing than helpful. Basically I have two dataframes with overlapping, but not ide...
<p>You need merge with parameter how = outer</p> <pre><code>df3 = df1.merge(df2, how = 'outer') A B C 0 22.0 34 NaN 1 78.0 42 NaN 2 NaN 76 29.0 3 NaN 11 67.0 </code></pre>
Pandas: How to concatenate dataframes with different columns?
python|pandas|dataframe
11
17,154
3
44,252,775
44,252,775
10
true
2017-05-30T03:03:12.423Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas: How to concatenate dataframes with different columns?<p>I tried to find the answer in the official <a href="http://pandas.pydata.org/pandas-docs/stab...
44,317,462
What is registerOnTouched for?<p>When creating a custom form element that uses <code>ngModel</code>, one must provide <a href="https://angular.io/docs/ts/latest/api/forms/index/NG_VALUE_ACCESSOR-let.html" rel="noreferrer"><code>NG_VALUE_ACCESSOR</code></a>, which in turn requires that the component implements <a href="...
<p><a href="https://github.com/angular/angular/issues/18174" rel="noreferrer">An issue was created</a> and <a href="https://angular.io/api/forms/ControlValueAccessor#registerOnTouched" rel="noreferrer">the documentation for registerOnTouched</a> has since changed:</p> <blockquote> <p>Registers a callback function th...
What is registerOnTouched for?
angular
13
9,497
1
44,317,463
44,317,463
10
true
2017-06-01T21:38:04.470Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is registerOnTouched for?<p>When creating a custom form element that uses <code>ngModel</code>, one must provide <a href="https://angular.io/docs/ts/lat...
43,978,179
how to get data type of a tensor in tensorflow?<p>Which function is used to get the data type of tensors in tensorflow in python? I need to define dynamic data types according to different tensors.</p>
<p>You can get the type using <code>x.dtype</code>, as follows:</p> <pre><code>import tensorflow as tf x=tf.constant([1,2]) x.dtype </code></pre> <p>This prints <code>tf.int32</code></p>
how to get data type of a tensor in tensorflow?
python|tensorflow
7
9,733
2
43,980,274
43,980,274
12
true
2017-05-15T11:21:53.553Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to get data type of a tensor in tensorflow?<p>Which function is used to get the data type of tensors in tensorflow in python? I need to define dynamic da...
44,021,665
Why is a paginated query slower than a plain one with Spring Data?<p>Given I have a simple query:</p> <pre><code>List&lt;Customer&gt; findByEntity(String entity); </code></pre> <p>This query returns 7k records in 700ms.</p> <pre><code>Page&lt;Customer&gt; findByEntity(String entity, Pageable pageable); </code></pre>...
<p>It might indeed be the count query that's expensive here. If you insist on knowing about the total number of elements matching in the collection there's unfortunately no way around that additional query. However there are two possibilities to avoid more of the overhead if you're able to sacrifice on information retu...
Why is a paginated query slower than a plain one with Spring Data?
spring|hibernate|spring-data|spring-data-jpa|jpql
12
5,931
2
44,041,601
44,041,601
12
true
2017-05-17T10:02:29.670Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is a paginated query slower than a plain one with Spring Data?<p>Given I have a simple query:</p> <pre><code>List&lt;Customer&gt; findByEntity(String en...
44,325,464
How to control knitr kable scientific notation?<p>I have a data frame like this:</p> <pre><code>&gt; summary variable value 1 var1 5.810390e-06 2 var2 5.018182e-06 3 var3 5.414286e-06 4 var4 3.000779e+02 5 var5 -2.105123e+01 6 var6 8.224229e-01 </code></pre> <p>I want to print i...
<p>The most general way is to do the formatting yourself, and send a dataframe of character variables to kable. For example, this doesn't give the nicest display, but it shows how to handle the first 3 rows separately:</p> <pre><code>df &lt;- data.frame(variable = paste0("var", 1:6), value =c(5.810390e-06, 5...
How to control knitr kable scientific notation?
r|knitr
20
10,265
2
44,328,328
44,328,328
12
true
2017-06-02T09:30:55.093Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to control knitr kable scientific notation?<p>I have a data frame like this:</p> <pre><code>&gt; summary variable value 1 var1 5.810390e-...
44,328,591
How to change ${USER} value in WebStorm or PhpStorm?<p>How to change <code>${USER}</code> value in JetBrains WebStorm?</p> <p>I was searching under <code>Settings-&gt; File and Code Templates</code> but there I can change only structure of the temple instead of value of variable <code>USER</code>.</p> <pre><code>/** ...
<p>Goto Settings-> File and Code Templates</p> <p>choose desired file type and use set command. </p> <pre><code> #set( $USER = "your desired name" ) </code></pre> <p>For example: For Javascript </p> <pre><code>/** * #set( $USER = "your desired name" ) * Created by ${USER} on ${DATE}. */ </code></pre>
How to change ${USER} value in WebStorm or PhpStorm?
phpstorm|webstorm|jetbrains-ide
12
4,384
2
44,328,592
44,328,592
12
true
2017-06-02T12:08:26.267Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change ${USER} value in WebStorm or PhpStorm?<p>How to change <code>${USER}</code> value in JetBrains WebStorm?</p> <p>I was searching under <code>Se...
43,975,602
Cancel Fingerprint scanner<p>I am working on a program that has a security function including a PIN and a fingerprint, but now I'm having a problem with entering the password (PIN or Fingerprint). Incorporating the correct fingerprints is fine, but when I enter the PIN code, after I exit the PIN and fingerprint activit...
<p>When you start up the fingerprint reader, you pass in a <a href="https://developer.android.com/reference/android/os/CancellationSignal.html" rel="noreferrer">CancellationSignal</a>.</p> <p>When you want to cancel (maybe in the OnPause on your Activity), just call the <code>cancel</code> method of this object.</p> ...
Cancel Fingerprint scanner
android|android-6.0-marshmallow|fingerprint
7
5,965
2
43,975,716
43,975,716
13
true
2017-05-15T09:16:51.343Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cancel Fingerprint scanner<p>I am working on a program that has a security function including a PIN and a fingerprint, but now I'm having a problem with ente...
44,324,944
How to decode jpg image from memory?<p>I can read a jpg image from disk via PIL, Python OpenCV, etc. into a numpy array via some built-in functions such as (in the case of OpenCV) <code>arr= cv2.imread(filename)</code>.</p> <p>But how do I decode a jpg in binary format directly from memory?</p> <p>Use case: I want to...
<p>Assuming that you are storing the image data in your db as a <code>string</code>, you first need to construct a <code>numpy</code> array from that string that can later be converted to an image using <a href="http://docs.opencv.org/3.0-beta/modules/imgcodecs/doc/reading_and_writing_images.html#imdecode" rel="nofollo...
How to decode jpg image from memory?
python|opencv|numpy|binary|jpeg
8
12,574
3
44,325,163
44,325,163
13
true
2017-06-02T09:06:10.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to decode jpg image from memory?<p>I can read a jpg image from disk via PIL, Python OpenCV, etc. into a numpy array via some built-in functions such as (...
43,987,779
python: module 'Crypto.Cipher.AES' has no attribute 'MODE_CCM' even though pycrypto installed<p>pycrypto is installed (when I run <code>pip list</code> one of the result is <code>pycrypto (2.6.1)</code>)</p> <p>and it works but when I would like to use the <code>MODE_CCM</code> it returns: <code>module 'Crypto.Cipher.A...
<p>according to <a href="https://gist.github.com/jbdatko/7425443" rel="noreferrer">https://gist.github.com/jbdatko/7425443</a> the newest version of pycrypto does not have the CCM mode.</p> <p>I solved the problem by installing <code>pip install pycryptodomex</code> and replacing the <code>Crypto</code> package with<co...
python: module 'Crypto.Cipher.AES' has no attribute 'MODE_CCM' even though pycrypto installed
python|package|pycrypto
9
15,638
3
43,987,858
43,987,858
14
true
2017-05-15T19:56:48.303Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python: module 'Crypto.Cipher.AES' has no attribute 'MODE_CCM' even though pycrypto installed<p>pycrypto is installed (when I run <code>pip list</code> one o...
44,212,854
Is there a method in numpy to multiply every element in an array?<p>I want to multiply all elements in a numpy array. If there's an array like <code>[1, 2, 3, 4, 5]</code>, I want to get value of <code>1 * 2 * 3 * 4 * 5</code>.</p> <p>I tried this by making my own method, but size of array is very large, it takes very ...
<p>I believe what you need is, numpy.prod.</p> <p>From the <a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.prod.html" rel="noreferrer">documentation</a>:</p> <blockquote> <p><strong>Examples</strong></p> <p>By default, calculate the product of all elements:</p> <pre><code>&gt;&gt;&gt; np.prod([1.,2....
Is there a method in numpy to multiply every element in an array?
python|numpy|multiplication
10
16,398
3
44,212,880
44,212,880
14
true
2017-05-27T04:03:54.377Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a method in numpy to multiply every element in an array?<p>I want to multiply all elements in a numpy array. If there's an array like <code>[1, 2, 3...
44,225,331
Apply click method to outer div but not inner div<p>In this example I want the alert to be triggered when the black outer div is clicked but not when anything inside the inner div is clicked.</p> <p>Currently when I click the inner button it triggers the alert.</p> <p><div class="snippet" data-lang="js" data-hide="fa...
<p>You just need to check for id of element, as inner is child element, it will always propagate the event to parent element (outer).</p> <pre><code>$("#outer").click(function(event) { if(event.target.id=="outer"){ alert("triggered"); } }); </code></pre>
Apply click method to outer div but not inner div
javascript|jquery
17
13,846
8
44,225,371
44,225,371
14
true
2017-05-28T08:36:48.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apply click method to outer div but not inner div<p>In this example I want the alert to be triggered when the black outer div is clicked but not when anythin...
44,230,855
Python imaplib selecting folders<p>I am bulding a mail client using Django and for extracting emails i'm using imaplib. So far, i can select inbox folder cause in every imap server it's name is "INBOX". But when it comes to selecting other folders like Spam, Sent and others i have troubles because their name come based...
<p>I decided to split the output and use folder names as they are, in the language they came:</p> <pre><code>for i in mail.list()[1]: l = i.decode().split(' "/" ') print(l[0] + " = " + l[1]) </code></pre>
Python imaplib selecting folders
python|imaplib
15
17,716
1
44,231,476
44,231,476
14
true
2017-05-28T18:51:21.183Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python imaplib selecting folders<p>I am bulding a mail client using Django and for extracting emails i'm using imaplib. So far, i can select inbox folder cau...
44,123,575
How to display rows of csv file in django?<p>I have a django app, which allows the user to upload a csv file, say a csv file of rankings of universities. I'd have to process the data that has been uploaded. For example, grey out any column which has string values and calculate the mean and std. deviation of all the val...
<p>Pandas dataframe can be converted to html table by itself. You can try</p> <pre><code>csvfile = request.FILES['csv_file'] data = pd.read_csv(csvfile.name) data_html = data.to_html() context = {'loaded_data': data_html} return render(request, "dataflow/table.html", context) </code></pre> <p>In the html page, use <c...
How to display rows of csv file in django?
django|pandas|django-tables2
8
6,936
2
44,272,577
44,272,577
14
true
2017-05-22T23:31:03.727Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to display rows of csv file in django?<p>I have a django app, which allows the user to upload a csv file, say a csv file of rankings of universities. I'd...
44,044,631
class template specialization with constraint / concept<p>I try to use a constraint for a class specialization:</p> <pre><code>struct A {}; struct B {}; struct C {}; template&lt;typename T&gt; concept bool AorB() { return std::is_same&lt;T, A&gt;::value || std::is_same&lt;T, B&gt;::value; } template&lt;typename ...
<p>This isn't a specialization, you actually redeclared the primary template, which is indeed an error.<br> A specialization would look like this:</p> <pre><code>template&lt;typename T&gt; class X { }; template&lt;AorB T&gt; class X&lt;T&gt; { }; // ^^^ </code></pre>
class template specialization with constraint / concept
c++|c++17|c++-concepts
7
1,024
1
44,044,894
44,044,894
15
true
2017-05-18T10:01:38.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: class template specialization with constraint / concept<p>I try to use a constraint for a class specialization:</p> <pre><code>struct A {}; struct B {}; str...
44,053,752
What is a statement in coverage.py?<p>From <a href="http://coverage.readthedocs.io/en/coverage-4.3.4/cmd.html" rel="noreferrer">http://coverage.readthedocs.io/en/coverage-4.3.4/cmd.html</a> the coverage analysis report is done by:</p> <pre><code>$ coverage report -m Name Stmts Miss Cover Miss...
<p>I realized that statements are the number of lines of code including imports, class and function definitions (not counting the comments).</p>
What is a statement in coverage.py?
python|python-2.7|code-coverage|coverage.py
10
6,442
2
44,053,893
44,053,893
15
true
2017-05-18T16:53:46.650Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is a statement in coverage.py?<p>From <a href="http://coverage.readthedocs.io/en/coverage-4.3.4/cmd.html" rel="noreferrer">http://coverage.readthedocs.i...
44,098,362
using mpatches.Patch for a custom legend<p>I'm using the following code to create a custom matplotlib legend.</p> <pre><code>import matplotlib.patches as mpatches import matplotlib.pyplot as plt colors = ["g", "w"] texts = ["Green Data Description", "RedData Description"] patches = [ mpatches.Patch(color=colors[i], la...
<ol> <li><p>Setting the legend's background color can be done using the <code>facecolor</code> argument to <a href="https://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.legend" rel="noreferrer"><code>plt.legend()</code></a>,</p> <pre><code> plt.legend(facecolor=&quot;plum&quot;) </code></pre> </li> <li><p>To ob...
using mpatches.Patch for a custom legend
python|matplotlib|legend
14
33,836
3
44,113,141
44,113,141
15
true
2017-05-21T15:04:44.943Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: using mpatches.Patch for a custom legend<p>I'm using the following code to create a custom matplotlib legend.</p> <pre><code>import matplotlib.patches as mp...
44,241,521
DataFrame element-wise divide by sum of row inplace<p>I want every element divided by sum of row inplace,code below always go wrong.</p> <p>pandas newbie, thanks!</p> <pre><code>df = pd.DataFrame(np.random.rand(12).reshape(3,4),columns=list('abcd')) df_row_sum = df.apply(lambda x: x.mean(),axis=1) df / df_row_sum </c...
<p>I think you need <code>sum</code> or maybe <code>mean</code> per rows (<code>axis=1</code>) with division by <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.div.html" rel="noreferrer"><code>DataFrame.div</code></a> :</p> <pre><code>np.random.seed(123) df = pd.DataFrame(np.random.rand...
DataFrame element-wise divide by sum of row inplace
python|pandas
9
8,493
2
44,241,565
44,241,565
15
true
2017-05-29T11:33:34.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: DataFrame element-wise divide by sum of row inplace<p>I want every element divided by sum of row inplace,code below always go wrong.</p> <p>pandas newbie, t...
44,354,370
how to read FormData object in Laravel<p>I am trying to ajax submit form to a Laravel 5 controller method. I understand that in php, you can define a FormData object, append the input fields to the object and send it to the server where you can now extract the values using the input field names. </p> <p>Like so:</p> ...
<p>You can do this.</p> <pre><code>// get the `UploadedFile` object $file = $request-&gt;file('file_name'); $file = $request-&gt;file_name; // get the original file name $filename = $request-&gt;file('file_name')-&gt;getClientOriginalName(); $filename = $request-&gt;file_name-&gt;getClientOriginalName(); </code></pre...
how to read FormData object in Laravel
ajax|laravel|file|laravel-5.4
7
41,285
2
44,354,427
44,354,427
15
true
2017-06-04T13:01:11.693Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to read FormData object in Laravel<p>I am trying to ajax submit form to a Laravel 5 controller method. I understand that in php, you can define a FormDat...
44,058,574
How to extend application class in xamarin android<p>I want to extend the Android application and I want to override oncreate method. But for some reason its been very terrible...Only if I remove [Application] I am able to run it but according to this <a href="https://forums.xamarin.com/discussion/2147/what-is-the-reci...
<p>In <strong><em>AssemblyInfo.cs</em></strong></p> <p>comment out </p> <pre><code> #if DEBUG [Application(Debuggable=true)] #else [Application(Debuggable = false)] #endif </code></pre> <p>and move that on top of your application</p> <pre><code>#if DEBUG [Application(Debuggable=true)] #else [App...
How to extend application class in xamarin android
c#|xamarin|xamarin.android|android-manifest|android-application-class
9
7,981
2
44,059,743
44,059,743
16
true
2017-05-18T22:13:00.260Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to extend application class in xamarin android<p>I want to extend the Android application and I want to override oncreate method. But for some reason its...