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,810,235
RStudio doesn't save picture<p>I'm trying to save a plot zoom I got from using R.</p> <p>My Rstudio has the option of saving that plot, but it doesn't seem to be working. There's no error message. I go through everything as normal, and then the pic never shows up in the file that it's supposed to. I've tried open the ...
<p>The best way to do this, pressing zoom button in RStudio, then copy that pic to paint (which works), and then save it.</p>
RStudio doesn't save picture
r|rstudio
15
15,119
6
41,650,806
41,650,806
1
true
2016-06-14T11:05:46.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RStudio doesn't save picture<p>I'm trying to save a plot zoom I got from using R.</p> <p>My Rstudio has the option of saving that plot, but it doesn't seem ...
37,723,238
how to check the actual DOM node using react enzyme<p>Is there a way to get the actual DOM node so I can the query it with the Dom api as opposed to being required to use enzyme's api, it's just for edge cases where for example I need to assert things about the dom node itself.</p>
<p>You can use <code>wrapper.getDOMNode()</code></p> <p><a href="https://github.com/airbnb/enzyme/blob/master/docs/api/ReactWrapper/getDOMNode.md" rel="nofollow noreferrer">Enzyme docs</a></p>
how to check the actual DOM node using react enzyme
javascript|dom|reactjs|enzyme
21
30,507
6
41,643,921
41,643,921
25
true
2016-06-09T10:21:14.563Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to check the actual DOM node using react enzyme<p>Is there a way to get the actual DOM node so I can the query it with the Dom api as opposed to being re...
37,629,929
apache2 using python2.7 & I want to use python3.4<p>I setup my server using python bottle &amp; mod_wsgi my bottle script are all writing by python3.4 but the apache2 server using by default python2.7.6 ?</p> <p>is there a way to make the python3.4 the default python on apache2 </p> <p>I'm stock right now </p>
<p>I think you have installed mod_wsgi for python2 with this command: </p> <pre><code>sudo apt-get install libapache2-mod-wsgi </code></pre> <p>But if you want to use mod_wsgi with python3, you should install correct mod_wsgi with this command: </p> <pre><code>sudo apt-get install libapache2-mod-wsgi-py3 </code></pr...
apache2 using python2.7 & I want to use python3.4
python|apache|ubuntu|mod-wsgi|bottle
13
10,769
2
41,486,668
41,486,668
36
true
2016-06-04T11:53:43.680Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: apache2 using python2.7 & I want to use python3.4<p>I setup my server using python bottle &amp; mod_wsgi my bottle script are all writing by python3.4 but t...
37,997,008
What is the difference between -hivevar and -hiveconf?<p>From hive -h :</p> <pre><code>--hiveconf &lt;property=value&gt; Use value for given property --hivevar &lt;key=value&gt; Variable subsitution to apply to hive commands. e.g. --hivevar A=B </code></pre>
<p>I didn't quite feel like the examples from the documentation were adequate, so here's my attempt at an answer.</p> <p>In the beginning there was only <code>--hiveconf</code> and variable substitution didn't exist. </p> <p>The <code>--hiveconf</code> option allowed users to set <a href="https://cwiki.apache.org/co...
What is the difference between -hivevar and -hiveconf?
hadoop|hive|hiveql
24
34,338
5
41,880,115
41,880,115
52
true
2016-06-23T16:23:39.340Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the difference between -hivevar and -hiveconf?<p>From hive -h :</p> <pre><code>--hiveconf &lt;property=value&gt; Use value for given property --h...
37,805,745
Use of the 'compileOnly' scope in Android projects?<p>I'm using Gradle 2.12 (or newer) with an appropriate version of the Android Gradle plugin in my project. Gradle 2.12 introduced the <code>compileOnly</code> configuration, so why do I get an error when I try to use it?</p> <blockquote> <p>Could not find method co...
<p>Simple use <code>provided</code> instead of <code>compileOnly</code></p> <p>See <a href="https://github.com/google/auto/issues/324#issuecomment-212333044" rel="nofollow noreferrer">https://github.com/google/auto/issues/324#issuecomment-212333044</a></p>
Use of the 'compileOnly' scope in Android projects?
gradle|android-gradle-plugin
10
4,163
2
41,580,677
41,580,677
4
true
2016-06-14T07:34:54.903Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use of the 'compileOnly' scope in Android projects?<p>I'm using Gradle 2.12 (or newer) with an appropriate version of the Android Gradle plugin in my project...
37,959,438
Where can I download the iOS 10 simulator runtime file?<p>I want to test my apps in the iOS 10 simulator, but I'm not sure where to get the <code>.runtime</code> file for iOS 10. I don't see a download for it under Components in Xcode 8. Where can I download the <code>.runtime</code> file for iOS 10 (if it exists)?</p>...
<p>OK, this has been open for long enough and Xcode 8/iOS 10 are out of beta, plus I solved this problem a week after this was asked, so I'll post my own answer. I ended up redownloading and reinstalling the entire Xcode 8 beta which includes the <code>.runtime</code> file in itself. Bit of an overkill, but I didn't ha...
Where can I download the iOS 10 simulator runtime file?
ios-simulator|xcode8|ios10
29
36,391
8
40,599,957
40,599,957
0
true
2016-06-22T05:41:48.850Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Where can I download the iOS 10 simulator runtime file?<p>I want to test my apps in the iOS 10 simulator, but I'm not sure where to get the <code>.runtime</c...
37,689,903
Animators may only be run on Looper threads Android<p>I'm trying to animate something when a task is completed. The problem here is I get this error message: </p> <pre><code>android.util.AndroidRuntimeException: Animators may only be run on Looper threads at android.animation.ValueAnimator.cancel(ValueAnimator.java...
<p>I think, there has been a <strong><a href="https://stackoverflow.com/a/22804163/2065039">solution</a></strong> for this using <code>Handler</code>. You can use <code>postDelayed</code> to minimal as <code>100</code> and run your animating tasks. In your case it would be:</p> <pre><code>new Handler().postDelayed(new...
Animators may only be run on Looper threads Android
java|android|multithreading|android-animation
43
44,552
6
40,508,143
40,508,143
27
true
2016-06-07T21:44:15.637Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Animators may only be run on Looper threads Android<p>I'm trying to animate something when a task is completed. The problem here is I get this error message:...
38,003,467
Disambiguation of higher kinded type vs higher order type<p>In a previous question I asked <a href="https://stackoverflow.com/questions/35951818/why-can-the-monad-interface-not-be-declared-in-java">Why can the Monad interface not be declared in Java?</a>. There, I received a comment from Brian Goetz saying that I shoul...
<p>Following <a href="https://www.stephanboyer.com/post/115/higher-rank-and-higher-kinded-types" rel="nofollow noreferrer">this</a> blog post, the term <em>higher order type</em> seems to be the common term for <em>higher kinded type</em> and <em>higher rank type</em>. <em>higher order kind</em> is probably a term that...
Disambiguation of higher kinded type vs higher order type
type-systems|higher-kinded-types|higher-order-types
7
559
1
40,453,411
40,453,411
4
true
2016-06-23T23:29:29.733Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Disambiguation of higher kinded type vs higher order type<p>In a previous question I asked <a href="https://stackoverflow.com/questions/35951818/why-can-the-...
37,872,542
Is there a Python API for submitting batch get requests to AWS DynamoDB?<p>The package <code>boto3</code> - Amazon's official AWS API wrapper for python - has great support for uploading items to DynamoDB in bulk. It looks like this:</p> <pre><code>db = boto3.resource("dynamodb", region_name = "my_region").Table("my_...
<p>So thankfully there is something that you might find useful - much like the <code>json</code> module which has <code>json.dumps</code> and <code>json.loads</code>, boto3 has a types module that includes a serializer and deserializer. See <a href="http://boto3.readthedocs.io/en/latest/_modules/boto3/dynamodb/types.ht...
Is there a Python API for submitting batch get requests to AWS DynamoDB?
python|amazon-web-services|amazon-dynamodb|boto3
16
9,036
4
40,714,121
40,714,121
12
true
2016-06-17T03:18:31.407Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a Python API for submitting batch get requests to AWS DynamoDB?<p>The package <code>boto3</code> - Amazon's official AWS API wrapper for python - ha...
44,361,878
How to use same power BI dashboard for other client<p>We have two same clients and have the same structure of data. My Question is that How we can use the same dashboard for these clients.</p>
<p>You have to create row level security.so dashboard remain same . but data shown is as per client login user .</p>
How to use same power BI dashboard for other client
powerbi
-6
71
1
44,608,671
44,608,671
0
true
2017-06-05T04:54:08.670Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use same power BI dashboard for other client<p>We have two same clients and have the same structure of data. My Question is that How we can use the sa...
44,310,722
Webserver on Raspberry Pi with ASP.Net Interface<p>My problem: I have developed a Webserver (C#) which runs on the Raspberry Pi (Windows IoT), but it only works with html. I want to use the Website from my ASP.Net (C#) Project.</p> <p>How I do that?</p> <p>Source Code: <a href="http://download1085.mediafire.com/iwe3n...
<p>Check out my post "Step by step: Running ASP.NET Core on Raspberry Pi" here: <a href="https://carlos.mendible.com/2017/03/21/step-by-step-running-aspnet-core-on-raspberry-pi/" rel="nofollow noreferrer">https://carlos.mendible.com/2017/03/21/step-by-step-running-aspnet-core-on-raspberry-pi/</a></p>
Webserver on Raspberry Pi with ASP.Net Interface
c#|asp.net|web-services|raspberry-pi|windowsiot
-3
5,158
2
44,768,567
44,768,567
0
true
2017-06-01T14:47:48.640Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Webserver on Raspberry Pi with ASP.Net Interface<p>My problem: I have developed a Webserver (C#) which runs on the Raspberry Pi (Windows IoT), but it only wo...
44,341,670
Dressing a mannequin with different items in android<p>I am trying to implement similar screen. Unable to add different items at proper place. I want to add shoes at the proper place.</p> <p><img src="https://i.stack.imgur.com/cYLwu.jpg" alt="enter image description here"></p> <p><strong>Layout</strong></p> <pre><co...
<p>Use Constraint Layout it will be easy for you to Design your Requirement</p> <p>Add this dependency in your Project</p> <pre><code> compile 'com.android.support.constraint:constraint-layout:1.0.2' </code></pre> <p>Here I have added a code for your design</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&...
Dressing a mannequin with different items in android
android-layout
-19
553
3
44,519,970
44,519,970
2
true
2017-06-03T07:45:29.913Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dressing a mannequin with different items in android<p>I am trying to implement similar screen. Unable to add different items at proper place. I want to add ...
44,245,375
Correct pulling edxops/forums way<p>I'm making my own devstack for works with <code>OpenEdx</code>.</p> <p>I pulled the official <code>devstack</code> repository from edx and i'm modifying it.</p> <p>I'm trying add <code>forums</code> to my stack but i can't run in since docker compose.</p> <p>I added this to <code>...
<p>I inspected the image and figured out the details that will be helpful in running the container. I will list down my findings as below:</p> <ul> <li><p><strong><a href="http://supervisord.org/" rel="nofollow noreferrer">Supervisord</strong></a>: Supervisord has been used to run the process in the container. Althoug...
Correct pulling edxops/forums way
ruby|docker|docker-compose|edx|openedx
7
298
1
44,619,517
44,619,517
4
true
2017-05-29T14:53:56.403Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Correct pulling edxops/forums way<p>I'm making my own devstack for works with <code>OpenEdx</code>.</p> <p>I pulled the official <code>devstack</code> repos...
38,014,918
How to reuse base64 image repeatedly in HTML file<p>I have an HTML file that will be portable to distribute to clients. It has an index of documents. I want a PDF or Word icon for each document but I don't want to repeat the base64 string 30 times if I can avoid it. How should I do this? Javascript is okay, but my ...
<p>The other answer using CSS gives the right idea, but it is not compatible with all browsers. The <code>content</code> property of the CSS is only allowed in the pseudo-elements <code>::before</code> and <code>::after</code>. The <code>img</code> tag with a class with a content property is empty. The browsers have no...
How to reuse base64 image repeatedly in HTML file
javascript|html|static|base64
10
4,356
4
44,710,590
44,710,590
6
true
2016-06-24T13:43:32.200Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to reuse base64 image repeatedly in HTML file<p>I have an HTML file that will be portable to distribute to clients. It has an index of documents. I wan...
44,123,098
Difference between pip3 and `python3 setup.py install` regarding cmdclass argument<p>I tried to configure my package such that a script is executed on the installation process. Therefore, I inherited from setuptools.command install and created my custom class <code>ActionOnInstall</code> to do stuff when package is ins...
<p>pip calls your setup.py but it redirects stdout/stderr. To test setup.py under pip write to a file in a fixed location:</p> <pre><code>class ActionOnInstall(install): def run(self): print("Call install.run(self) works!", file=open('/tmp/debug.log', 'w')) install.run(self) </code></pre> <p>Look ...
Difference between pip3 and `python3 setup.py install` regarding cmdclass argument
python|installation|pip|package|setuptools
11
5,655
2
44,850,698
44,850,698
9
true
2017-05-22T22:33:22.047Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Difference between pip3 and `python3 setup.py install` regarding cmdclass argument<p>I tried to configure my package such that a script is executed on the in...
37,735,191
How do I extend Django admin's DateFieldListFilter class ?<p>I am a newbie with Django and have a model with a DateTime field which is shown in the django admin.</p> <p>In the list_filter option when I specify the fieldname I get the basic Django filter interface for date fields with 4 links (today, this month, past 7...
<p>Assume we have a model called <code>Book</code> with a <code>published_at</code> field which is a <code>DateTimeField</code>. You could then achieve this type of filtering by doing something like this (code is based on DateFieldListFilter as seen in <a href="https://github.com/django/django/blob/4ad2f862844d35404e4...
How do I extend Django admin's DateFieldListFilter class ?
python|django|django-admin
11
4,122
1
44,961,171
44,961,171
9
true
2016-06-09T20:03:42.890Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I extend Django admin's DateFieldListFilter class ?<p>I am a newbie with Django and have a model with a DateTime field which is shown in the django ad...
44,056,501
How can I remotely connect to docker swarm?<p>Is it possible to execute commands on a docker swarm cluster hosted in cloud from my local mac? If yes, how?</p> <p>I want to execute command such as following on docker swarm from my local:</p> <pre><code>docker create secret my-secret &lt;address to local file&gt; docke...
<p>Answer to the question can be found <a href="https://docs.docker.com/engine/admin/#configure-the-docker-daemon" rel="nofollow noreferrer">here</a>.</p> <p>What one needs to do for ubuntu machine is define <code>daemon.json</code> file at path <code>/etc/docker</code> with following content:</p> <pre><code>{ &quot;...
How can I remotely connect to docker swarm?
docker|docker-swarm|docker-swarm-mode|docker-secrets
16
14,112
5
44,502,200
44,502,200
11
true
2017-05-18T19:40:05.050Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I remotely connect to docker swarm?<p>Is it possible to execute commands on a docker swarm cluster hosted in cloud from my local mac? If yes, how?</p...
44,275,172
Typescript declarations file for Node C++ Addon<p>I have a Node C++ Addon that provides a wrapped class similar to the one in the Node documentation. I can require() my addon and then get the constructor for my class to create an instance.</p> <pre><code>const { MyClass } = require('myaddon'); const obj = new MyClass(...
<p>I think I finally have it. As suggested by @ZachB, I created a myaddon.ts file that has the following:</p> <pre><code>const myaddon = require('./build/release/myaddon') export interface MyClass { myMethod(arg: string): number } export var MyClass: { new(param: string): MyClass } = myaddon.MyClass </code><...
Typescript declarations file for Node C++ Addon
typescript|node.js-addon
10
4,156
4
45,071,267
45,071,267
16
true
2017-05-31T03:34:11.533Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript declarations file for Node C++ Addon<p>I have a Node C++ Addon that provides a wrapped class similar to the one in the Node documentation. I can r...
44,143,110
Visualizing R Function Dependencies<p>There are a lot of resources for people who want to visualize package dependencies, but I'm interested specifically in visualizing functions within a package and their dependencies on one another. There are tools like <a href="https://cran.r-project.org/web/packages/miniCRAN/vignet...
<p>I think a better option (built on top of the mvbutil package's foodweb functions) is the DependenciesGraph package built by datastorm-open on Github on top of their more general <a href="http://datastorm-open.github.io/visNetwork/" rel="noreferrer">visNetwork</a> package. </p> <ul> <li><a href="https://github.com/d...
Visualizing R Function Dependencies
r|function|graph|dependencies
19
6,672
3
45,016,194
45,016,194
22
true
2017-05-23T19:05:59.873Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Visualizing R Function Dependencies<p>There are a lot of resources for people who want to visualize package dependencies, but I'm interested specifically in ...
44,363,530
Difference between autoRemoveFromRecents and excludeFromRecents<p>I have gone through android docs but unable to get clear idea about these tags? When should I use <code>autoRemoveFromRecents</code> and <code>excludeFromRecents</code>? </p>
<p>autoRemoveFromRecents: Whether or not tasks launched by activities with this attribute remains in the overview screen until the last activity in the task is completed. </p> <p>excludeFromRecents: Whether or not the task initiated by this activity should be excluded from the list of recently used applications, the o...
Difference between autoRemoveFromRecents and excludeFromRecents
android|android-manifest
10
3,343
1
44,713,148
44,713,148
16
true
2017-06-05T07:10:30.097Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Difference between autoRemoveFromRecents and excludeFromRecents<p>I have gone through android docs but unable to get clear idea about these tags? When shoul...
44,172,818
Registering User with Laravel Passport<p>I set up password grant (it's backend for an app). Now, I can send a post request to <code>oauth/token</code> and it works on Postman. However, what if I want to register user from the api too?</p> <p>I understand I can use current <code>/register</code> route, however, then wi...
<p>In your API create route as</p> <pre><code>Route::post('register','Api\UsersController@create'); </code></pre> <p>And in UsersController create method <code>create()</code></p> <pre><code>function create(Request $request) { /** * Get a validator for an incoming registration request. * * @param ...
Registering User with Laravel Passport
php|laravel|oauth|laravel-5.4|laravel-passport
24
20,796
3
44,699,693
44,699,693
22
true
2017-05-25T05:20:59.110Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Registering User with Laravel Passport<p>I set up password grant (it's backend for an app). Now, I can send a post request to <code>oauth/token</code> and it...
37,877,860
lodash pick object fields from array<p>I have array of objects:</p> <pre><code>var results= [ { "_type": "MyType", "_id": "57623535a44b8f1417740a13", "_source": { "info": { "year": 2010, "number": "string", }, "type": "sto...
<p>You could do:</p> <pre><code>var mapped = _.map(results, _.partialRight(_.pick, ['_id', 'info', 'type', 'date', 'createdBy'])); </code></pre> <p>A little explanation:</p> <ol> <li><a href="https://lodash.com/docs/4.17.4#map" rel="noreferrer"><code>_.map()</code></a>: Expects a function which takes each item from ...
lodash pick object fields from array
javascript|lodash
26
51,234
5
45,067,184
45,067,184
60
true
2016-06-17T09:24:43.717Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: lodash pick object fields from array<p>I have array of objects:</p> <pre><code>var results= [ { "_type": "MyType", "_id": "57623535...
44,018,089
After installing bulma through NPM, how can I refer it in my project<p>I have pulled in bulma in my project through : </p> <pre><code>$ npm install bulma </code></pre> <p>After that, how can I refer to it in my pages. I really don't know how to work with npm, so please can you guide me. Do I have to refer to it in m...
<p>You can find the final css build at <code>projectName/node_modules/bulma/css/bulma.css</code>.</p> <p>Chances are you're using a file loader with webpack and similar. If, for example in a Vue project, you have that, then you can use import syntax:</p> <p><code>import 'bulma/css/bulma.css'</code></p> <p>within you...
After installing bulma through NPM, how can I refer it in my project
npm|bulma
58
27,960
7
44,736,166
44,736,166
61
true
2017-05-17T07:18:48.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: After installing bulma through NPM, how can I refer it in my project<p>I have pulled in bulma in my project through : </p> <pre><code>$ npm install bulma <...
44,273,455
Parse Cloud - LiveQueries - iOS Client doesn't work<p>I'm trying to use Parse LiveQueries. I use this Parse "Bootstrap": "<a href="https://github.com/parse-community/parse-server" rel="noreferrer">https://github.com/parse-community/parse-server</a>",<br /> I can see the logs: <code>info: Create new client: 1</code>, <b...
<p>The problem with this code is that you are placing this code <code>var subscription: Subscription&lt;PFObject&gt;?</code> inside the function.</p> <p>This object must be able to retain it's memory address in order for it to receive events.</p> <p>For example.</p> <pre><code>class SomeClass { var objects: [PFO...
Parse Cloud - LiveQueries - iOS Client doesn't work
ios|swift|parse-platform|livequery|parse-cloud-code
7
1,094
2
44,721,816
44,721,816
6
true
2017-05-30T23:32:22.563Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parse Cloud - LiveQueries - iOS Client doesn't work<p>I'm trying to use Parse LiveQueries. I use this Parse "Bootstrap": "<a href="https://github.com/parse-c...
44,088,192
When and how should default.nix, shell.nix and release.nix be used?<p>One of the first types of Nix expression one encounters when learning how to use the Nix package manager is <code>default.nix</code>; on the wonderful NixOS IRC channel I learned of the existence of <code>shell.nix</code> and <code>release.nix</code>...
<p>As said by @danbst only <code>default.nix</code> and <code>shell.nix</code> have special meanings for the nix tooling, out of that there is no real standard and everybody is free to use what fits most their needs.</p> <p>That said, it doesn't mean you cannot set your own set of rules, personally for a single deriva...
When and how should default.nix, shell.nix and release.nix be used?
nix|nixos|nixops
73
19,233
2
44,621,588
44,621,588
53
true
2017-05-20T16:18:01.513Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When and how should default.nix, shell.nix and release.nix be used?<p>One of the first types of Nix expression one encounters when learning how to use the Ni...
43,940,857
after upgrade to 2.7 ClassNotFoundException: org.mockito.exceptions.Reporter when run test<p>I try to set up junit, mokito and powermock together but when I ran a test I get ClassNotFoundException :(</p> <pre><code>testCompile 'junit:junit:4.12' testCompile 'org.mockito:mockito-core:2.7.22' androidTestCompile 'org.moc...
<p>That's what worked for me: </p> <pre><code>testCompile 'junit:junit:4.12' testCompile 'org.mockito:mockito-core:2.8.0' testCompile 'org.powermock:powermock-api-mockito2:1.7.0RC2' testCompile 'org.powermock:powermock-module-junit4:1.7.0' testCompile 'org.powermock:powermock-core:1.7.0' testCompile 'org.powermock:pow...
after upgrade to 2.7 ClassNotFoundException: org.mockito.exceptions.Reporter when run test
java|junit|mockito|powermock
34
36,916
4
44,883,638
44,883,638
33
true
2017-05-12T15:00:48.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: after upgrade to 2.7 ClassNotFoundException: org.mockito.exceptions.Reporter when run test<p>I try to set up junit, mokito and powermock together but when I ...
44,324,080
How to store access token? (Oauth 2, Auth code flow)<p>From what i understand the purpose of the Authorization Code flow is to exchange the auth code for access token. This exchange happens between the server which serves the page and authorization server so that the actual access token is not exposed to the client use...
<p>The client, in OAuth terminology, is the component that makes requests to the resource server, in your case, the client is the server of a web application (NOT the browser).</p> <p>Therefore, the access token should be stored on the web application server only. It should not be exposed to the browser, and it doesn't...
How to store access token? (Oauth 2, Auth code flow)
security|authentication|oauth|oauth-2.0
38
67,612
3
44,655,679
44,655,679
56
true
2017-06-02T08:19:22.907Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to store access token? (Oauth 2, Auth code flow)<p>From what i understand the purpose of the Authorization Code flow is to exchange the auth code for acc...
37,606,920
Hi,In 6.0 Permission to make call is asking everytime<p>In 6.0 marshmallow, I want to add permission to making call. below code is working in all devices except Moto G, In Moto G permission is asking everytime when I start making call. </p> <pre><code>if(android.os.Build.VERSION.SDK_INT &gt;= 23){ if(check...
<p>Create intent service like below and add your code in that</p> <pre><code>public class RSSPullService extends IntentService { @Override protected void onHandleIntent(Intent workIntent) { // Gets data from the incoming Intent String dataString = workIntent.getDataString(); ... ...
Hi,In 6.0 Permission to make call is asking everytime
android
-4
58
1
37,613,911
37,613,911
0
true
2016-06-03T05:58:18.913Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hi,In 6.0 Permission to make call is asking everytime<p>In 6.0 marshmallow, I want to add permission to making call. below code is working in all devices exc...
37,613,851
Sending all aspx page as an e-mail body<p>I have an aspx page that give an exam result. I would like to send copy of this page as an e-mail body. I did a lot of search about this situation but i can not find any solution.</p>
<p>To start with, you can't do like this. But instead, what you can do is load data in some DataTable and create HTML body of the email by looping through the rows of that DataTable. What I intend to say is you create email body string from the results and send that to wherever you want to send it.</p>
Sending all aspx page as an e-mail body
c#|asp.net
-5
44
1
37,614,098
37,614,098
0
true
2016-06-03T12:00:37.660Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sending all aspx page as an e-mail body<p>I have an aspx page that give an exam result. I would like to send copy of this page as an e-mail body. I did a lot...
37,623,183
Can I push user input from a program<p>Sorry, title might not make much sense, wasn't sure what to name it.</p> <pre><code>//history of the 10 previous commands char *history[10][140]; while (1) { printf("Enter command:"); fgets(input, MAX, stdin); //Handle other commands //true if user entered comm...
<p>If I understood what you are asking, it must look something like this:</p> <pre><code>char *history[rows][columns]; int user_has_requested_previous_command_flag = 0; while(1) { switch(user_has_requested_previous_command_flag) { case 0: printf("Enter command:"); fgets(input, ...
Can I push user input from a program
c
-3
43
2
37,623,482
37,623,482
0
true
2016-06-03T20:50:24.153Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I push user input from a program<p>Sorry, title might not make much sense, wasn't sure what to name it.</p> <pre><code>//history of the 10 previous comm...
37,636,386
Matching a value in one column to the name of another column<p>I have a char column, where I need to match the value of that column to the name of other column in my data frame in order to extract the value from the other column. I have added a picture as I think it will be easier to understand.</p> <p><a href="https:...
<p>We can use <code>row/column</code> indexing to extract the elements from the first dataset and create the 'result' column in 'd2'</p> <pre><code>d2$result &lt;- d1[-1][cbind(1:nrow(d1), match(d2$mycol, names(d1)[-1]))] d2 # mycol result #1 a 40 #2 bxb 88 #3 bxb 76 #4 ct 33 </code></pre> ...
Matching a value in one column to the name of another column
r
-4
323
1
37,638,017
37,638,017
0
true
2016-06-05T00:45:44.003Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Matching a value in one column to the name of another column<p>I have a char column, where I need to match the value of that column to the name of other colu...
37,650,601
Timeout expired in asp.net with sql server<p>The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.</p>
<p>you may check the connection and query timeout with sql queries which are used in the program, and FYI sql standard connection timeout-15 secs and query timeout-30 secs,</p>
Timeout expired in asp.net with sql server
asp.net
-4
275
1
37,650,724
37,650,724
0
true
2016-06-06T06:11:54.250Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Timeout expired in asp.net with sql server<p>The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all po...
37,682,136
Web service/api for iPhones app<p>I am hiring a freelancer to develop a social networking app for iPhones with event creation, messaging, etc. He asked me if I was going to provide web services/api. I am completely new to app and web development so I am not sure how to answer. If I provide those things, what do I ne...
<p>you need to get it very clear in your head what you want to build before you hire a freelancer. If you don't you'll be in a costly world of pain very quickly.</p> <p>So, sit down and think, if you have a friend developer maybe you can have a chat with him and decide the architecture of the product.</p> <p>What tha...
Web service/api for iPhones app
iphone
-3
22
1
37,682,313
37,682,313
0
true
2016-06-07T14:29:29.240Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Web service/api for iPhones app<p>I am hiring a freelancer to develop a social networking app for iPhones with event creation, messaging, etc. He asked me i...
37,706,281
Cypher: how to create multiple relationship dependent by more elements?<p>is it possible to create a set of relationship between nodes like this? <a href="http://i.stack.imgur.com/rsdFD.png" rel="nofollow">situation in RDBMS DB</a></p> <p>An User can be enabled to a service, a service has a set of accounts which can b...
<p>It is not clear if you actually need a direct relationship between a <code>User</code> and an <code>Account</code> (it might be redundant, given that <code>Service</code>s also have <code>Account</code>s). In this answer, I am going to assume they are not needed.</p> <p>Given my assumption, here is an example of ho...
Cypher: how to create multiple relationship dependent by more elements?
neo4j|relationship
-3
304
1
37,709,328
37,709,328
0
true
2016-06-08T15:04:13.037Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cypher: how to create multiple relationship dependent by more elements?<p>is it possible to create a set of relationship between nodes like this? <a href="ht...
37,761,770
Facebook Custom Button Implementation Issue<p><a href="http://pastebin.com/nTaFjArL" rel="nofollow">connect.js</a></p> <p><a href="http://pastebin.com/19AVWGuE" rel="nofollow">connect.php</a></p> <p>I am trying to create Facebook Login Custom Button Using Facebook SDK. I have created it successfully and able to login...
<p>I got the solution.</p> <p>Here is a "FB.init" function which calls everytime automatically when the page is loaded or refreshed . It has a function "FB.getLoginStatus" which was pretending to destroy the session because it was invoking again and again and new session was creating. On basis of which signin page che...
Facebook Custom Button Implementation Issue
javascript|facebook|facebook-graph-api
-4
330
1
37,767,414
37,767,414
0
true
2016-06-11T08:44:42.267Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Facebook Custom Button Implementation Issue<p><a href="http://pastebin.com/nTaFjArL" rel="nofollow">connect.js</a></p> <p><a href="http://pastebin.com/19AVW...
37,772,524
Lowercase all strings in a list by list comprehension<p>I am confused on how my code is not turning all strings into lowercase? </p> <pre><code>def set_lowercase(strings): """ lower the case 2. """ return [i.lower() for i in strings] strings = ['Right', 'SAID', 'Fred'] set_lowercase(strings) print(strings...
<p>Your function builds a new list and returns it, but the calling code doesn't do anything with the returned value.</p>
Lowercase all strings in a list by list comprehension
python|python-3.x
-3
572
3
37,772,537
37,772,537
0
true
2016-06-12T09:10:03.100Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Lowercase all strings in a list by list comprehension<p>I am confused on how my code is not turning all strings into lowercase? </p> <pre><code>def set_l...
37,823,076
How can I analzye only specific sentences in R?<p>I have a data set of 4,500 long texts that I analyze using R packages. I want to analyze only sentences that contain specific words, how can I do it? and can I use R to create a second set of all the sentences (which will be independent of the original set?) thanks</p>
<p>Data:</p> <pre><code>lorem &lt;- "\nLorem ipsum dolor sit amet, consectetur adipisicing elit,\nsed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi\nut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit\nin v...
How can I analzye only specific sentences in R?
r|text-mining|text-analysis
-4
35
1
37,827,745
37,827,745
0
true
2016-06-14T22:20:42.913Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I analzye only specific sentences in R?<p>I have a data set of 4,500 long texts that I analyze using R packages. I want to analyze only sentences tha...
37,625,571
Java calculator gui number issue<p>When I run the code the gui pops up like it should but when I click on a button it gives this in the textfield box:</p> <blockquote> <p>javax.swing.JButton[,0,65,37x34,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.synth.SynthBorder@5066ef73,flags=41943328,maximumSize=,minim...
<h2>This code is your problem:</h2> <pre><code>private void Button5ActionPerformed(java.awt.event.ActionEvent evt) { String inputNumber = textDisplay.getText()+ Button5; textDisplay.setText(inputNumber); } </code></pre> <h2>Solution:</h2> <p>Change <code>textDisplay.ge...
Java calculator gui number issue
java
-3
60
1
37,625,617
37,625,617
1
true
2016-06-04T01:45:46.377Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java calculator gui number issue<p>When I run the code the gui pops up like it should but when I click on a button it gives this in the textfield box:</p> <...
37,633,442
How to create a file if a condition holds and use it later in the program (under the same condition), in Java?<p>I want to create a file only if condition <code>c</code> is true, and update this file later in a loop (if the same condition is true). But if I create a file inside an if-statement it will not be accessible...
<p>All you have to do is keep your Writer pointer outside the loop as such:</p> <pre><code>Writer w = null; if(c) w= new Writer...; loop{ //Do Stuff if(w!=null)w.append("info"); } </code></pre>
How to create a file if a condition holds and use it later in the program (under the same condition), in Java?
java|file
-3
50
1
37,633,549
37,633,549
1
true
2016-06-04T18:05:00.573Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a file if a condition holds and use it later in the program (under the same condition), in Java?<p>I want to create a file only if condition <c...
37,648,295
iterm2 became slow and drags after installing powerline9k zsh theme<p>I installed the powerline9k theme for oh-my-zsh from <a href="https://github.com/bhilburn/powerlevel9k" rel="nofollow">https://github.com/bhilburn/powerlevel9k</a>.</p> <p>On restarting my iterm2, I found out that it was very slow and drags especial...
<p><code>brew install git</code> did the trick. Doing this overrides the default git that was shipped with my OSX.</p>
iterm2 became slow and drags after installing powerline9k zsh theme
git|iterm2
-3
562
1
37,655,084
37,655,084
1
true
2016-06-06T01:03:13.500Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: iterm2 became slow and drags after installing powerline9k zsh theme<p>I installed the powerline9k theme for oh-my-zsh from <a href="https://github.com/bhilbu...
37,737,285
bootstrap alpha or stable?<p>I'm very new to Bootstrap and Django and I was wondering if I should stick to Bootstrap 3 or use Bootstrap alpha. What do you think? And the other thing is can I use both 3 and 4 on a same site or there will be issues? Thank you for your opinions.</p>
<p>Well that all depends...</p> <ul> <li>Are you creating a project for someone who's paying you that you need to be sure it works. - Use stable.</li> <li>Are you simply experimenting and tinkering with code and not afraid to make small/big changes later and know Bootstrap already? Use alpha.</li> <li>If your complete...
bootstrap alpha or stable?
twitter-bootstrap-3|styling|twitter-bootstrap-4
-5
68
1
37,737,449
37,737,449
1
true
2016-06-09T22:36:18.713Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: bootstrap alpha or stable?<p>I'm very new to Bootstrap and Django and I was wondering if I should stick to Bootstrap 3 or use Bootstrap alpha. What do you th...
37,762,442
Jquery check checkbox value then set checked<p>I had a checkbox </p> <pre><code>&lt;input type="checkbox" name="paid" id="paid-change"&gt; </code></pre> <p>which will have value = "1" or "0".I want to check if checkbox value = "1" the checkbox will add checked status on it. Tks for your help!</p>
<p>Try this. This code is using pure javascript</p> <pre><code>var chkBox = document.getElementById("paid-change"); if (chkBox.value == 0) chkBox.checked = false; else if (chkBox.value == 1) chkBox.checked = true; </code></pre>
Jquery check checkbox value then set checked
javascript|jquery
-3
58
2
37,762,521
37,762,521
1
true
2016-06-11T10:05:15.010Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jquery check checkbox value then set checked<p>I had a checkbox </p> <pre><code>&lt;input type="checkbox" name="paid" id="paid-change"&gt; </code></pre> <p...
37,786,572
Convert date format in SQL SERVER - TSQL<p>I am stuck in a weird requirement. I am just hoping that I might get some help.</p> <p>My requirement is that the incoming data in table is like <code>'Thu Feb 18 11:03:18 GMT 2016'</code> and it's output must be <code>2016-02-18</code> i.e. in YYYY-MM-DD format.</p> <p>Any...
<p>try this with some other sample data,</p> <pre><code>DECLARE @input varchar(50)='Thu Feb 18 11:03:18 GMT 2016' select cast(replace(substring(@input,4,len(@input)),'GMT','') as datetime) select cast(cast(replace(substring(@input,4,len(@input)),'GMT','') as datetime) as date) </code></pre>
Convert date format in SQL SERVER - TSQL
sql-server|tsql
-5
58
2
37,786,965
37,786,965
1
true
2016-06-13T09:48:45.563Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert date format in SQL SERVER - TSQL<p>I am stuck in a weird requirement. I am just hoping that I might get some help.</p> <p>My requirement is that the...
37,789,164
expression produced error: Execution was interrupted, reason: step over. The process has been returned to the state before expression evaluation<p>I am just going to new in swift,</p> <p>I have one button on click of which opening front camera of iPad and clicking the photo of user, and when clicked on use photo,</p> ...
<p>I got the solution, Thanks to my colleague,</p> <p>I am capturing the image from imagePickerController and getting saved in <code>NSData</code>. But the image captured it around 6-7 MB (iPad camera captures the image with this size by default) and when saving it into <code>NSData</code> and then converting it into ...
expression produced error: Execution was interrupted, reason: step over. The process has been returned to the state before expression evaluation
xcode|swift
7
18,185
4
37,804,402
37,804,402
1
true
2016-06-13T11:53:25.877Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: expression produced error: Execution was interrupted, reason: step over. The process has been returned to the state before expression evaluation<p>I am just ...
37,631,416
I want to make something when done from typing EditText<p>what is the method I should use to type what will happen after being finished from typing in the EditText?</p> <p>Please use simple statements and use an example with comments of what happens in that line and what to type in that line.</p> <p>PS</p> <p>I wish...
<p>you need to add a <a href="https://developer.android.com/reference/android/text/TextWatcher.html" rel="nofollow noreferrer">text watcher</a> to the text view</p> <h1>Example:</h1> <pre><code> myEditText.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s,...
I want to make something when done from typing EditText
java|android|android-edittext
-3
33
2
37,631,454
37,631,454
2
true
2016-06-04T14:34:58.380Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to make something when done from typing EditText<p>what is the method I should use to type what will happen after being finished from typing in the Ed...
37,685,334
What is the random code set in the middle of a URL?<p>I have a URL: <a href="http://www.cbonline.co.uk/resources/b63662d3-b27b-4239-821d-844d74ee51f8/something.xls" rel="nofollow">http://www.cbonline.co.uk/resources/b63662d3-b27b-4239-821d-844d74ee51f8/something.xls</a>, and I need to download the file from it automati...
<p>It is an UUID - a random unique ID for the file in question. Basically: you either have that number from some other source (usually an API endpoint, or an HTML page witha listing and links) or you can't have the URL.</p>
What is the random code set in the middle of a URL?
python|url
-3
35
1
37,685,423
37,685,423
2
true
2016-06-07T17:10:07.617Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the random code set in the middle of a URL?<p>I have a URL: <a href="http://www.cbonline.co.uk/resources/b63662d3-b27b-4239-821d-844d74ee51f8/somethi...
37,841,868
How do I differentiate between an old browser and new browser for a style in CSS<p>The issue I'm having is that I don't know what they mean by a style rule that sets a font color to white for older browsers and white with 50% opacity in newer browsers and removes the underlining from the link text.. I didn't realize th...
<p>Use fallback styles. Write the universally understood property first, then the newer version of the property, which the modern browsers will use but the old browsers will simply ignore.</p> <p>Example: set color to white for all browsers; then set color to white with 50% opacity for browsers that understand it.</p>...
How do I differentiate between an old browser and new browser for a style in CSS
css
-3
565
2
37,841,960
37,841,960
2
true
2016-06-15T17:19:59.807Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I differentiate between an old browser and new browser for a style in CSS<p>The issue I'm having is that I don't know what they mean by a style rule t...
37,603,104
Keeping a view at the bottom with the SlidingUpPanel library<p>I am using the <a href="https://github.com/umano/AndroidSlidingUpPanel" rel="noreferrer"><code>SlidingUpPanel</code> library</a> in one of my <code>Media Player</code> apps.</p> <p>In the slide panel, I have the media controls and I would like to display t...
<p>I got it! Brain hadn't been working for the last few days I guess lol. It was just simple Maths!</p> <pre><code>private SlidingUpPanelLayout slidingLayout; @Ovverride public void onCreate(Bundle bundle) { slidingLayout = (SlidingUpPanelLayout) findViewById(R.id.sliding_layout); } @Override public void onPane...
Keeping a view at the bottom with the SlidingUpPanel library
java|android|android-layout
11
3,080
5
37,647,397
37,647,397
3
true
2016-06-02T22:22:48.857Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Keeping a view at the bottom with the SlidingUpPanel library<p>I am using the <a href="https://github.com/umano/AndroidSlidingUpPanel" rel="noreferrer"><code...
37,834,017
Using Application Insights with multiple deployment slots<p>I am beginning to implement Application Insights against an ASP.NET web app with multiple deployments; Prod, Staging, Dev, Dev2. Currently the production slot is sitting empty with deployments in staging, dev and dev2. </p> <p>The application health tile is s...
<p>I have resolved the issue. I was enabling Application Insights through the portal for an already deployed application, which only seems to enable telemetry collections for what is deployed in the 'main' production slot. In my case this was the default 'This web app has been successfully created' blue landing screen....
Using Application Insights with multiple deployment slots
azure-application-insights|azure-web-app-service
10
5,671
2
37,837,539
37,837,539
3
true
2016-06-15T11:21:52.303Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Application Insights with multiple deployment slots<p>I am beginning to implement Application Insights against an ASP.NET web app with multiple deploym...
37,610,457
fixed menu not working<p>I want my menu to stay on its place while I scroll, but when I add the following in my CSS<code>position:fixed;</code> the whole thing goes out of the place from where I want it to be.</p> <p>In this <a href="https://jsfiddle.net/mvmbtcby/" rel="nofollow">jsfiddle</a> you can see how it is now...
<p>Ok, i see what you want and i think you will code this behaviour in Javascript. </p> <p>This kind of solution will be okay for you ?? </p> <p>Démo : <a href="http://jsfiddle.net/cc48t" rel="nofollow">http://jsfiddle.net/cc48t</a></p> <pre><code>$(window).scroll(function () { if ($(window).scrollTop() &gt; 100...
fixed menu not working
html|css
7
1,820
7
37,611,104
37,611,104
4
true
2016-06-03T09:15:33.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: fixed menu not working<p>I want my menu to stay on its place while I scroll, but when I add the following in my CSS<code>position:fixed;</code> the whole thi...
37,627,340
Junit assert double arrays<p>How do I assert that two arrays of <code>double</code>s contain the same elements. There are methods to assert that arrays of integers and other primitive types contain the same elements but not for <code>double</code>s.</p>
<p>If you are not using a version of JUnit that supports double array comparison then the simplest solution would be to use <code>Arrays.equals</code>:</p> <pre><code>assertTrue(Arrays.equals(array1, array2)); </code></pre> <p>However this won't cope with rounding errors in the way the Junit double asserts do.</p>
Junit assert double arrays
java|junit
10
6,193
3
37,627,610
37,627,610
5
true
2016-06-04T06:54:21.913Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Junit assert double arrays<p>How do I assert that two arrays of <code>double</code>s contain the same elements. There are methods to assert that arrays of in...
37,719,304
python imshow, set certain value to defined color<p>I have a RGB Image, which I plot with matplotlib.pyplot.imshow and it works fine. But now I want to change the plot, that where the value of the picture is e.g 1, the color of the plot should change to white at all this positions.</p> <p>Is there a way to do this?</p...
<p>Assuming that your image is a single-channel image rather than a three-channel image, the required task can be performed by defining a palette that maps indices (e.g. gray level intensities or picture values) into colors:</p> <pre><code>import numpy as np import matplotlib.pyplot as plt palette = np.array([[ 0, ...
python imshow, set certain value to defined color
python|image|colors|imshow
12
19,755
3
37,720,602
37,720,602
5
true
2016-06-09T07:20:34.790Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python imshow, set certain value to defined color<p>I have a RGB Image, which I plot with matplotlib.pyplot.imshow and it works fine. But now I want to chang...
37,622,204
Moment-Range: Need to divide day into 15 minute slices<p>At present I can only divide the day into 1 hour blocks. But I need the ranges in 15 minute steps.</p> <p><a href="https://github.com/gf3/moment-range" rel="noreferrer" title="Moment-Range Documentation">Moment-Range Documentation</a></p> <p>This is my present ...
<p>This doesn't use moment and it's not implemented in your function yet, but this is how I would try to get an object of 15min-chunks. I hope, this is what you are looking for.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="sn...
Moment-Range: Need to divide day into 15 minute slices
javascript|momentjs
7
6,476
4
37,623,416
37,623,416
6
true
2016-06-03T19:40:00.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Moment-Range: Need to divide day into 15 minute slices<p>At present I can only divide the day into 1 hour blocks. But I need the ranges in 15 minute steps.</...
37,687,683
Angular 2: Binding to Functions from Component Templates<p>In Angular 1 we avoided calling functions from within template expressions in excess, e.g. <code>ng-repeat="item in vm.getFilteredItems()"</code> because property changes unrelated to the result of <code>getFilteredItems</code> would cause the function to recom...
<p>You could create a pipe. Pipes (if <code>pure</code>) are only called when depending values change.</p> <pre><code>@Pipe({ name: 'search', // pure: 'false' }) class SearchPipe { transform(names, searchTerm) { if (!this.searchTerm) { this.filteredNames = names; return; } return names.fil...
Angular 2: Binding to Functions from Component Templates
angularjs|angular
9
8,241
1
37,688,590
37,688,590
6
true
2016-06-07T19:23:52.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular 2: Binding to Functions from Component Templates<p>In Angular 1 we avoided calling functions from within template expressions in excess, e.g. <code>n...
37,711,776
Making bluetooth discoverable using c code<p>I want to make a bluetooth server that starts and other devices can pair with it.</p> <p>I can get the code to compile fine, the server starts, but I cannot see the advertisement when I scan for bluetooth devices from android phone.</p> <p>I think i need to switch on the d...
<p>Through the BlueZ command line, the command to enable discoverability is achieved through the <a href="http://linux.die.net/man/8/hciconfig" rel="noreferrer">hciconfig</a> tool as follows:</p> <pre><code>hciconfig hciX piscan </code></pre> <p>Where hciX is your HCI device installed on the system, and in most cases...
Making bluetooth discoverable using c code
bluetooth|fedora|bluez
9
2,892
3
37,821,327
37,821,327
6
true
2016-06-08T19:56:57.617Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Making bluetooth discoverable using c code<p>I want to make a bluetooth server that starts and other devices can pair with it.</p> <p>I can get the code to ...
37,609,974
Instagram API: The access_token provided is invalid<p>I have registred a sandbox user. Now I am trying to use it, but I recieve "The access_token provided is invalid". Sample request:</p> <p><a href="https://api.instagram.com/v1/users/search?q=abc&amp;count=2&amp;client_id=7b67cff1a7ab462881298434c08b5ab8" rel="noref...
<p>You need to check for <strong>requirements <a href="https://www.instagram.com/developer/endpoints/" rel="noreferrer">Scope for AP</a>I</strong> you are using and if it's need and Authentications "Valid access Token". where also had some changes. </p> <ul> <li>basic - to read a user’s profile info and media</li> <l...
Instagram API: The access_token provided is invalid
instagram-api
9
40,768
5
37,610,524
37,610,524
7
true
2016-06-03T08:51:03.043Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Instagram API: The access_token provided is invalid<p>I have registred a sandbox user. Now I am trying to use it, but I recieve "The access_token provided is...
37,820,840
Pass Array value in cucumber .feature file<p>I want to pass array value as a parameter from cucumber .feature file, so I can access it from step definition file:</p> <p>I am using this format:</p> <pre><code>Examples: |r1|t1| |abc|[aa,bb,cc]| </code></pre> <p>But I'm getting an error <code>undefined method</code>e...
<p>I don't think you need the square brackets.</p> <pre><code>When I pass this array "aa,bb,cc" </code></pre> <p>You have to split your string up. </p> <pre><code>When(/I pass this array "([^"]*)"$/) do |array| array.split(',').each{|entry| do something } end </code></pre> <p>Note: you may want to strip the entri...
Pass Array value in cucumber .feature file
ruby-on-rails|cucumber|automated-tests|gherkin
7
13,887
2
37,823,013
37,823,013
7
true
2016-06-14T19:47:45.190Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pass Array value in cucumber .feature file<p>I want to pass array value as a parameter from cucumber .feature file, so I can access it from step definition f...
37,833,940
Frequency Response Scipy.signal<p>I'm learning digital signal processing to implement filters and am using python to easily implement a test ideas. So I just started using the scipy.signal library to find the impulse response and frequency response of different filters.</p> <p>Currently I am working through the book "...
<p>The SciPy generated frequency response is correct. In any case, I wouldn't trust the book's figure which appears to have been drawn by hand.</p> <p>If you want to find the frequency response "manually", this can be simply done by defining a function returning the original Z-transform and evaluating it on the unit c...
Frequency Response Scipy.signal
python|scipy|signal-processing
12
9,013
1
37,841,802
37,841,802
7
true
2016-06-15T11:18:26.387Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Frequency Response Scipy.signal<p>I'm learning digital signal processing to implement filters and am using python to easily implement a test ideas. So I just...
37,682,919
RealmSwift: No such module 'RealmSwift'<p>I configured RealmSwift 1.0.0 Latest Using Docs into the Xcode project. After installation i created a class file and getting module error - like: No such module 'RealmSwift' in class file.</p> <p>1.</p> <p><a href="https://i.stack.imgur.com/ocyV0.png" rel="noreferrer"><img s...
<p>It looks like you've added the path to <code>RealmSwift.framework</code> to your framework search paths. The <a href="https://realm.io/docs/swift/latest/#installation-swift-22" rel="noreferrer">Realm Swift installation instructions</a> say to add the <em>parent path</em> of <code>RealmSwift.framework</code> (i.e., t...
RealmSwift: No such module 'RealmSwift'
ios|swift|realm
16
18,734
13
37,686,223
37,686,223
8
true
2016-06-07T15:01:49.543Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RealmSwift: No such module 'RealmSwift'<p>I configured RealmSwift 1.0.0 Latest Using Docs into the Xcode project. After installation i created a class file a...
37,706,596
Is there a way to distinguish between different `Rc`s of the same value?<p>Here's an example:</p> <pre><code>use std::rc::Rc; #[derive(PartialEq, Eq)] struct MyId; pub fn main() { let rc_a_0 = Rc::new(MyId); let rc_a_1 = rc_a_0.clone(); let rc_b_0 = Rc::new(MyId); let rc_b_1 = rc_b_0.clone(); pr...
<p>You can cast <code>&amp;*rc</code> to <code>*const T</code> to get a pointer to the underlying data and compare the value of those pointers:</p> <pre><code>use std::rc::Rc; #[derive(PartialEq, Eq)] struct MyId; pub fn main() { let rc_a_0 = Rc::new(MyId); let rc_a_1 = rc_a_0.clone(); let rc_b_0 = Rc::n...
Is there a way to distinguish between different `Rc`s of the same value?
rust|identity|smart-pointers|reference-counting
11
3,618
3
37,706,796
37,706,796
8
true
2016-06-08T15:18:10.767Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way to distinguish between different `Rc`s of the same value?<p>Here's an example:</p> <pre><code>use std::rc::Rc; #[derive(PartialEq, Eq)] stru...
37,711,766
Java8 Stream - use filter collect foreach in single line<p>Is't possible to use filter(),collect() and foreach() in single statement instead of multiple statements?</p> <p>I have a map and need to filter based on some condition and set some values to the content and return the map. My current looks like below, but i w...
<p>There is no sense in insisting on doing it with one operation. Regardless of how you write it down, these <em>are</em> two operations.</p> <p>But one thing you should consider, is, that there are more ways than <code>entrySet().stream()</code> to process all elements:</p> <pre><code>Map&lt;String, Person&gt; retur...
Java8 Stream - use filter collect foreach in single line
java-8|java-stream
11
68,379
3
37,712,183
37,712,183
9
true
2016-06-08T19:56:16.330Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java8 Stream - use filter collect foreach in single line<p>Is't possible to use filter(),collect() and foreach() in single statement instead of multiple stat...
37,773,852
How to add a inflated view multiple times to a linear Layout?<p>I am trying to add a inflated view inside a LinearLayout container. However i am getting the child already has a parent issue. Following is my xml file having the container multiple times. <strong>activity_main.xml</strong></p> <pre><code>&lt;?xml version...
<p>This happens because you are adding the same view multiple times, to achieve what you want to achieve you have to only add the view once, and hence you have to create a new view each time you want to add a view to the layout.</p> <p>let's suppose you want to add it two times:</p> <pre><code>View childView1, childV...
How to add a inflated view multiple times to a linear Layout?
android
10
8,495
2
37,773,951
37,773,951
9
true
2016-06-12T11:46:55.393Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add a inflated view multiple times to a linear Layout?<p>I am trying to add a inflated view inside a LinearLayout container. However i am getting the ...
37,774,660
How to open the built in Equalizer programmatically in Android?<p>I have seen many apps opening systems in built Equalizer (google play music, Spotify, Samsung stock music player). Directly, without having to write their own from scratch. How do these apps do that? I couldn't find a solution.</p> <pre><code>} else if ...
<p>The following should work to start the default equalizer <code>Activity</code>:</p> <pre><code>Intent intent = new Intent(AudioEffect .ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL); if ((intent.resolveActivity(getPackageManager()) != null)) { startActivityForResult(intent, REQUEST_EQ); } else { // No equa...
How to open the built in Equalizer programmatically in Android?
android|equalizer
9
7,444
3
37,775,098
37,775,098
9
true
2016-06-12T13:12:55.793Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to open the built in Equalizer programmatically in Android?<p>I have seen many apps opening systems in built Equalizer (google play music, Spotify, Samsu...
37,614,489
Comparing pandas DataFrame to Series<p>I've looked at <a href="https://stackoverflow.com/questions/26285661/working-with-comparing-dataframes-and-series-and-generating-new-dataframes-on-th">this</a> and <a href="https://stackoverflow.com/questions/34220521/how-to-extract-pandas-series-element-and-compare-it-with-rows-i...
<p>Use <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.gt.html" rel="noreferrer"><code>.gt</code></a> and pass <code>axis=0</code> to compare row-wise against a Series:</p> <pre><code>In [126]: df.gt(s, axis=0) Out[126]: Stock1 Stock2 index Date1 True True Date2...
Comparing pandas DataFrame to Series
python|pandas
9
3,866
1
37,614,549
37,614,549
10
true
2016-06-03T12:32:12.330Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Comparing pandas DataFrame to Series<p>I've looked at <a href="https://stackoverflow.com/questions/26285661/working-with-comparing-dataframes-and-series-and-...
37,625,983
Why is Integer parameter of Java method mapped to Int and not platform type?<p><sup>Inspired by <a href="https://stackoverflow.com/questions/37625599/kotlin-what-can-i-do-when-a-java-library-has-an-overload-of-primitive-and-boxed/37625834#37625834">another question</a>.</sup></p> <p>In <code>fastutil</code> library th...
<p>I suspect that it is a kotlin compiler bug. Problem here is in interface <code>IntStack</code> which is implemented by <code>IntArrayList</code>:</p> <pre><code>interface Stack&lt;T&gt; { void push(T t); } interface IntStack extends Stack&lt;Integer&gt; { void push(int i); } </code></pre> <p>Kotlin sees o...
Why is Integer parameter of Java method mapped to Int and not platform type?
java|parameters|kotlin|fastutil
8
517
1
37,629,293
37,629,293
10
true
2016-06-04T03:16:58.987Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is Integer parameter of Java method mapped to Int and not platform type?<p><sup>Inspired by <a href="https://stackoverflow.com/questions/37625599/kotlin-...
37,728,528
How to get the schema name when I have table name?<p>I have a table name but I am not sure in which schema that table exists. How to find the schema name? </p>
<pre><code>Select owner from dba_tables where table_name = 'YOUR_TABLE_NAME' </code></pre> <p><a href="https://docs.oracle.com/cd/B28359_01/server.111/b28310/tables014.htm" rel="noreferrer">Here</a> you can find something more.</p>
How to get the schema name when I have table name?
sql|oracle
7
32,828
2
37,728,579
37,728,579
10
true
2016-06-09T14:16:48.627Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the schema name when I have table name?<p>I have a table name but I am not sure in which schema that table exists. How to find the schema name? </...
37,791,680
Scipy.optimize.minimize SLSQP with linear constraints fails<p>Consider the following (convex) optimization problem:</p> <pre><code>minimize 0.5 * y.T * y s.t. A*x - b == y </code></pre> <p>where the optimization (vector) variables are <code>x</code> and <code>y</code> and <code>A</code>, <code>b</code> are a matr...
<p>You've run into the <a href="http://docs.python-guide.org/en/latest/writing/gotchas/#late-binding-closures" rel="noreferrer">"late binding closures" <em>gotcha</em></a>. All the calls to <code>cons_i</code> are being made with the second argument equal to 19.</p> <p>A fix is to use the <code>args</code> dictionary...
Scipy.optimize.minimize SLSQP with linear constraints fails
python|numpy|optimization|scipy
7
7,721
1
37,792,650
37,792,650
10
true
2016-06-13T13:58:38.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Scipy.optimize.minimize SLSQP with linear constraints fails<p>Consider the following (convex) optimization problem:</p> <pre><code>minimize 0.5 * y.T * y s....
37,761,078
Are applicative transformers really superfluous?<p>There is a lot of talk about <code>Applicative</code> <em>not</em> needing its own transformer class, like this:</p> <pre><code>class AppTrans t where liftA :: Applicative f =&gt; f a -&gt; t f a </code></pre> <p>But I can define applicative transformers that don...
<p>Great question! I believe there are two different parts of this question:</p> <ol> <li><strong>Composing</strong> existing applicatives or monads into more complex ones.</li> <li><strong>Constructing all</strong> applicatives/monads from some given starting set.</li> </ol> <p>Ad 1.: <strong>Monad transformers are ...
Are applicative transformers really superfluous?
haskell|stream|typeclass
22
586
1
37,807,878
37,807,878
10
true
2016-06-11T07:17:51.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Are applicative transformers really superfluous?<p>There is a lot of talk about <code>Applicative</code> <em>not</em> needing its own transformer class, like...
37,825,630
Save dictionary in userdefaults in swift 3 with xcode 8<p>I am using the following code to save an object to UserDefaults (previously NSUserDefaults) using xcode 8:</p> <pre><code>let defaults = UserDefaults.standard() defaults.set(someObject, forKey: "someObject") print(defaults.object(forKey: "someObject")) </code><...
<p>This problem seems to be caused by having two versions of xcode/simulator installed. </p> <p>What worked for me was uninstalling xcode 7 and just keeping xcode 8 beta on my system. Emptying trash, resetting the simulator and running. I also restarted my computer.</p> <p>After following these steps the simulator...
Save dictionary in userdefaults in swift 3 with xcode 8
nsuserdefaults|swift3|xcode8|ios10
59
93,697
5
37,839,664
37,839,664
10
true
2016-06-15T03:33:06.640Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Save dictionary in userdefaults in swift 3 with xcode 8<p>I am using the following code to save an object to UserDefaults (previously NSUserDefaults) using x...
37,842,260
pandas dataframe resample per day without date time index<p>I have a dataframe in pandas of the following form:</p> <pre><code> timestamps light 7 2004-02-28 00:58:45 150.88 26 2004-02-28 00:59:45 143.52 34 2004-02-28 01:00:45 150.88 42 2004-02-28 01:01:15 150.88 59 2004-02-28 01:02:15 150.88 </code...
<p>You are right - need <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DatetimeIndex.html" rel="noreferrer"><code>DatetimeIndex</code></a>, <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.TimedeltaIndex.html" rel="noreferrer"><code>TimedeltaIndex</code></a> or <code>PeriodIn...
pandas dataframe resample per day without date time index
python|pandas|dataframe|time-series
11
23,621
3
37,842,295
37,842,295
10
true
2016-06-15T17:42:59.013Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pandas dataframe resample per day without date time index<p>I have a dataframe in pandas of the following form:</p> <pre><code> timestamps ligh...
37,705,553
How to export a csv from Google Sheet API?<p>I can't find any reference to an API that enables Rest API clients to export an existing Google Sheet to a csv file.</p> <p><a href="https://developers.google.com/sheets/" rel="noreferrer">https://developers.google.com/sheets/</a></p> <p>I believe there should be a way to ...
<p>You can use the Drive API to do this today -- see <a href="https://developers.google.com/drive/v3/web/manage-downloads#downloading_google_documents" rel="noreferrer">https://developers.google.com/drive/v3/web/manage-downloads#downloading_google_documents</a>, however that will limit you to the first sheet of the doc...
How to export a csv from Google Sheet API?
google-sheets|r-googlesheets|google-sheets-api
22
32,261
5
37,710,232
37,710,232
11
true
2016-06-08T14:35:16.700Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to export a csv from Google Sheet API?<p>I can't find any reference to an API that enables Rest API clients to export an existing Google Sheet to a csv f...
37,829,617
Get HTTP version of incoming request<p>How can I extract the HTTP version of an incoming request using express?</p> <p>I need something like:</p> <pre><code>app.use('/', (req, res, next) =&gt; { req.getHttpVersion() // 'HTTP 1.0'/'HTTP 1.1'/'HTTP 2.0' }); </code></pre>
<p>Try this:</p> <pre><code>app.use('/', (req, res, next) =&gt; { console.log('Request HTTP Version: ', req.httpVersion) }); </code></pre>
Get HTTP version of incoming request
node.js|http|express
8
3,398
2
37,834,301
37,834,301
11
true
2016-06-15T08:09:21.150Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get HTTP version of incoming request<p>How can I extract the HTTP version of an incoming request using express?</p> <p>I need something like:</p> <pre><cod...
37,724,029
ReportLab Paragraph and text formatting<p>My issue is that when using reportlab to generate a simple text document it loses all of the formatting. I've run it through a few times to try and debug it and the issue seems to be, when passing the <code>msgStr</code> to <code>Paragraph</code> it loses all of the formatting ...
<p>I hope this is what you are looking for :) </p> <pre><code># PDF GENERATION LIBRARIES # import the report lab PDF generation tools from reportlab.lib.pagesizes import letter from reportlab.lib.styles import ParagraphStyle from reportlab.lib.units import inch from reportlab.platypus import SimpleDocTemplate, Paragra...
ReportLab Paragraph and text formatting
python|pdf|reportlab|text-formatting
10
27,427
3
37,730,755
37,730,755
12
true
2016-06-09T10:58:10.727Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ReportLab Paragraph and text formatting<p>My issue is that when using reportlab to generate a simple text document it loses all of the formatting. I've run i...
37,767,307
Push notifications if app is closed (React-Native)<p>I'm developing React-native app (iOS &amp; Android).<br> Server connected through web-socket. Server sends notifications about some specific events. App suppose to notify user (using alerts). What if I need to notify user even if app is running in background or close...
<p>The library you referenced will indeed allow you to notify users even if the app is closed as it utilised <strong>Push Notifications</strong>. These are delivered to your users' devices no matter the state of your app.</p> <p>When a user opens a push notification they are taken to your app. <a href="https://www.ray...
Push notifications if app is closed (React-Native)
android|ios|push-notification|react-native
7
14,123
2
37,768,693
37,768,693
12
true
2016-06-11T18:39:55.717Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Push notifications if app is closed (React-Native)<p>I'm developing React-native app (iOS &amp; Android).<br> Server connected through web-socket. Server sen...
37,775,537
How to convert string array to long array?<p>I am in bust at the moment, I have this string array:</p> <pre><code>string[] StringNum = { "4699307989721714673", "4699307989231714673", "4623307989721714673", "4577930798721714673" }; </code></pre> <p>I need to convert them To long array data type in C#:</p> <pre><code>...
<p>You could use simple <code>Linq</code> extension functions.</p> <pre><code>long[] LongNum = StringNum.Select(long.Parse).ToArray(); </code></pre> <p>or you can use <code>long.TryParse</code> on each string.</p> <pre><code>List&lt;long&gt; results = new List&lt;long&gt;(); foreach(string s in StringNum) { long...
How to convert string array to long array?
c#|.net|arrays
7
17,441
5
37,775,550
37,775,550
12
true
2016-06-12T14:44:54.780Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert string array to long array?<p>I am in bust at the moment, I have this string array:</p> <pre><code>string[] StringNum = { "469930798972171467...
37,814,627
Cake NuGetPack Configuration<p>I'm trying to create a NuGet package using a Cake script:</p> <pre><code>var configuration = Argument("configuration", "Release"); var binDir = Directory("./bin") ; var nugetPackageDir = Directory("./artifacts"); var nugetFilePaths = GetFiles("./**/*.csproj").Concat(GetFiles("./**/*.nu...
<p>You need to add the following command line argument <code>-Prop Configuration=Release</code> to the <code>nuget pack</code> command:</p> <pre><code>var nuGetPackSettings = new NuGetPackSettings { BasePath = binDir + Directory(configuration), OutputDirectory = nugetPackageDir, ArgumentCustomization = args =...
Cake NuGetPack Configuration
nuget-package|cakebuild
10
2,583
2
37,814,762
37,814,762
12
true
2016-06-14T14:17:03.377Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cake NuGetPack Configuration<p>I'm trying to create a NuGet package using a Cake script:</p> <pre><code>var configuration = Argument("configuration", "Relea...
37,826,507
how set focus in angular md-autocomplete?<p>I have a dialog with few field to set, the first field is a <code>md-autocomplete</code>, when I click ok all these fields are cleaned, so, I want set focus true in the <code>md-autocomplete</code>, for starting to filling data again.</p>
<p>Try this :</p> <p><strong>JS:</strong></p> <pre class="lang-js prettyprint-override"><code>$scope.setFocus = function() { setTimeout(function() { document.querySelector('#autoCompleteId').focus(); }, 0); } </code></pre> <p><strong>HTML:</strong> </p> <pre class="lang-html prettyprint-override"><code>&l...
how set focus in angular md-autocomplete?
angularjs|angular-material|md-autocomplete
10
10,539
2
37,826,964
37,826,964
12
true
2016-06-15T05:01:20.393Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how set focus in angular md-autocomplete?<p>I have a dialog with few field to set, the first field is a <code>md-autocomplete</code>, when I click ok all the...
37,672,926
How do I set cookie expiration to session in C#<p>I am creating a website, and I'm not sure how to use sessions with cookies. </p> <p>When sessions timeout, I want to show the username and time of the user; for e.g., username stored in cookies and session. When sessions timeout the username must be retrived from the ...
<p>Lets put things in perspective first. A session is the session a user is experiencing when he is using the website. How it works is basically a user starts a session with the web server, the web server then gives it a key of the session and sets a timeout for the session which are stored as a cookie.</p> <p>Since ...
How do I set cookie expiration to session in C#
c#|session|cookies
7
27,434
1
37,673,123
37,673,123
14
true
2016-06-07T07:20:56.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I set cookie expiration to session in C#<p>I am creating a website, and I'm not sure how to use sessions with cookies. </p> <p>When sessions timeout...
37,733,966
Get the given date format (the string specifying the format) in javascript or momentjs<p>Given a datestring, how can I get the format string describing that datestring?</p> <p>Put another way, how can I get the format string that Date() or MomentJS (might be different for each, that's fine) would use to parse that dat...
<p>Consolidating information from <a href="https://stackoverflow.com/a/37735700/3391108">Matt Johnson's answer</a>, some comments, and my own contribution.</p> <p>With Moment.js (version 2.10.7+), you can use the <a href="http://momentjs.com/docs/#/parsing/creation-data/" rel="noreferrer">Creation Data API</a>. Someth...
Get the given date format (the string specifying the format) in javascript or momentjs
javascript|date|parsing|format|momentjs
9
7,962
2
37,754,073
37,754,073
14
true
2016-06-09T18:49:30.833Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get the given date format (the string specifying the format) in javascript or momentjs<p>Given a datestring, how can I get the format string describing that ...
37,752,133
Nested iteration in Rust macros<p>I'm playing with macros in Rust and want to do nested expansion, i.e. combinatorics.</p> <p>This is the code I've written:</p> <pre><code>macro_rules! nested { ( $(arg $arg:ident;)* $(fun $fun:ident;)* ) =&gt; { $( $fun($($arg),*); ...
<p>It seems that it is not possible to do this kind of expansion. Here is a workaround:</p> <pre><code>macro_rules! nested { ($(arg $arg:ident;)* $(fun $fun:ident;)*) =&gt; { // expand arg to a tuple that will be matched as tt // in @call_tuple an will be decomposed back to // a list of arg...
Nested iteration in Rust macros
rust
13
3,911
3
37,754,096
37,754,096
14
true
2016-06-10T15:37:52.253Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nested iteration in Rust macros<p>I'm playing with macros in Rust and want to do nested expansion, i.e. combinatorics.</p> <p>This is the code I've written:...
37,770,911
Tensorflow: Creating a graph in a class and running it outside<p>I believe I am having a hard time understanding how graphs work in tensorflow and how to access them. My intuition is that the lines under 'with graph:' will form the graph as a single entity. Hence, I decided to create a class that would build a graph wh...
<p>The nodes <code>prediction</code>, <code>cost</code>, and <code>optimizer</code> are local variables created in the method <code>__init__</code>, they cannot be accessed in the method <code>launchG</code>.</p> <p>The easiest fix would be to declare them as attributes of your class <code>Graph</code>:</p> <pre clas...
Tensorflow: Creating a graph in a class and running it outside
python|class|session|graph|tensorflow
10
8,487
1
37,774,076
37,774,076
14
true
2016-06-12T05:04:52.600Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tensorflow: Creating a graph in a class and running it outside<p>I believe I am having a hard time understanding how graphs work in tensorflow and how to acc...
37,836,660
How to return value from debounced function in javascript?<p>I have a code like that:</p> <pre><code>var originalFunction = function() { return 'some value'; }; var debouncedFunction = _.debounce(originalFunction, 3000); console.log('debouncedFunction() result: ', debouncedFunction()); console.log('originalFunc...
<p>that's because debounced functions are called asynchronously - you can't return a value from them, although you can call another function passing the result:</p> <pre><code>var originalFunction = function() { console.log('some value'); // or something like: callback(result) }; var debouncedFunction = _.deb...
How to return value from debounced function in javascript?
javascript|jquery|underscore.js|throttling|debouncing
15
11,590
1
37,836,720
37,836,720
14
true
2016-06-15T13:19:11.983Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to return value from debounced function in javascript?<p>I have a code like that:</p> <pre><code>var originalFunction = function() { return 'some va...
37,772,322
Laravel Eloquent ORM - Nested with statements<p>So I'm creating an API for a web application I'm creating and I'm trying to keep it within the Eloquent ORM. There is a parent-child relationship that I have going on:</p> <p>User -> Site Logs -> Sites </p> <p>Site class code: </p> <pre><code>class Site extends Model {...
<p>Eloquent allows you to do that easily :)</p> <p><a href="https://laravel.com/docs/5.2/eloquent-relationships#eager-loading" rel="noreferrer">https://laravel.com/docs/5.2/eloquent-relationships#eager-loading</a></p> <p>If you also need the user related with each log you just have to eager load it like this</p> <p>...
Laravel Eloquent ORM - Nested with statements
php|laravel|join|orm|eloquent
7
6,956
2
37,772,490
37,772,490
15
true
2016-06-12T08:45:55.480Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel Eloquent ORM - Nested with statements<p>So I'm creating an API for a web application I'm creating and I'm trying to keep it within the Eloquent ORM. ...
37,849,028
What is the use of 'WHERE TRUE' in MySQL<p>I'm working on my colleague's old project and I found on her code <code>WHERE TRUE AND ID='1' AND STAT='1'</code>. I've tried to removed <code>TRUE AND</code> so the query become <code>WHERE ID='1' AND STAT='1'</code> and get the same result.</p> <p>I know we can use <code>T...
<p>It has no specific functional purpose. Your colleague may have included it if they were adhering to a specific style guide that recommends that all SELECT queries have explicit WHERE clauses. If an explicit WHERE clause is not provided, the default is to select all rows. Adding a WHERE clause that is always true wil...
What is the use of 'WHERE TRUE' in MySQL
mysql
12
22,328
3
37,849,060
37,849,060
15
true
2016-06-16T02:43:19.973Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the use of 'WHERE TRUE' in MySQL<p>I'm working on my colleague's old project and I found on her code <code>WHERE TRUE AND ID='1' AND STAT='1'</code>....
37,701,995
Rmarkdown Retain .tex file<p>In R, when compiling a markdown document using <code>rmarkdown::render(...)</code>, how can I retain the intermediate <code>.tex</code> file that is produced from knitting.</p> <p>I have tried setting the <code>clean=FALSE</code> argument, but this retains the figures, not the final tex fi...
<p>You can specify it in your YML header with:</p> <pre><code>output: pdf_document: keep_tex: true --- </code></pre> <p>More options <a href="http://rmarkdown.rstudio.com/pdf_document_format.html#keeping_intermediate_tex" rel="noreferrer">on the rmarkdown site</a>.</p>
Rmarkdown Retain .tex file
r|r-markdown|tex
14
3,886
1
37,702,315
37,702,315
16
true
2016-06-08T12:05:03.230Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rmarkdown Retain .tex file<p>In R, when compiling a markdown document using <code>rmarkdown::render(...)</code>, how can I retain the intermediate <code>.tex...
37,719,632
Should the .babelrc file be gitignored?<p>I have a project that uses babel, and I was curious if a .babelrc file is typically gitignored or not. I am using a couple of presets that are apart of the package.json file that I have in the .babelrc file so it seems like a .babelrc file should be in source control, but not t...
<p><strong>tldr;</strong> you should not ignore it.</p> <p>In case you have some codebase which can be compiled only under relevant babel configuration, you need to specify appropriate configuration for babel. So it becomes obvious that everyone who will run this project from scratch will need to have that pre-defined...
Should the .babelrc file be gitignored?
node.js|git|babeljs|gitignore
10
3,603
1
37,719,896
37,719,896
16
true
2016-06-09T07:35:46.413Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Should the .babelrc file be gitignored?<p>I have a project that uses babel, and I was curious if a .babelrc file is typically gitignored or not. I am using a...
37,640,027
Add text label to d3 node in Force layout<p>This is my code look like, you can also have full code on <a href="https://jsfiddle.net/ShuanWu/7pvhxfzg/" rel="noreferrer">JsFiddle</a> . I want to have labels on every node, but I can't. By the way, labels can be embedded in the circle in the <a href="http://i.stack.imgur.c...
<p>Right now, you are appending the <code>text</code> elements to the <code>circle</code> elements, and that simply won't work.</p> <p>When you write...</p> <pre><code>var label = nodes.append("svg:text") </code></pre> <p>You're appending the texts to the <code>nodes</code>selection. However, you have to keep in min...
Add text label to d3 node in Force layout
javascript|d3.js|text|label|force-layout
9
10,275
1
37,640,083
37,640,083
17
true
2016-06-05T08:45:24.573Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add text label to d3 node in Force layout<p>This is my code look like, you can also have full code on <a href="https://jsfiddle.net/ShuanWu/7pvhxfzg/" rel="n...
37,717,174
WARNING: Module ini file doesn't exist under /etc/php/7.0/mods-available<p>I have uninstalled php7 and all its modules from ubuntu, and when I try to reinstall the modules, I get the following error for each php module, and although the module is installed, because of this error, it is not activated and I cannot use th...
<p>The problem was because of deleting php with <code>sudo apt-get remove [package]</code> and with this form, configuration files won't clean from computer and the next time you try to install the package, Ubuntu won't let the package configuration files to overwrite. the solution is to delete the package completely w...
WARNING: Module ini file doesn't exist under /etc/php/7.0/mods-available
php|php-extension|php-7
26
70,415
4
37,719,238
37,719,238
17
true
2016-06-09T05:00:56.663Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: WARNING: Module ini file doesn't exist under /etc/php/7.0/mods-available<p>I have uninstalled php7 and all its modules from ubuntu, and when I try to reinsta...
37,639,470
Count with Condition in laravel Eloquent<p>I want to count users who have stripe_plan = platinum_monthly </p> <pre><code>$platinum=User::count('stripe_plan','platinum_monthly'); </code></pre> <p>But its returning all users who have selected any available plan how to solve this issue need help?</p>
<p>Try adding the condition in a where clause </p> <pre><code>$platinum=User::where('stripe_plan','platinum_monthly')-&gt;count(); </code></pre>
Count with Condition in laravel Eloquent
database|eloquent|laravel-5.1|aggregate
8
27,158
3
37,639,484
37,639,484
18
true
2016-06-05T07:25:00.157Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Count with Condition in laravel Eloquent<p>I want to count users who have stripe_plan = platinum_monthly </p> <pre><code>$platinum=User::count('stripe_plan'...
37,836,882
Django 1.9 Bulk Create New Users Not hashing Passwords Correctly<p>I want to read in some data from a file to quickly create many test accounts. I'd prefer to use the bulk_create method since this is typically much faster for adding many records to a model. However, when using the bulk_create method with Django's User ...
<p>Use <a href="https://docs.djangoproject.com/en/1.9/topics/auth/passwords/#django.contrib.auth.hashers.make_password" rel="noreferrer"><code>make_password</code></a>. This ensures that hashed passwords are stored in your database. If <code>make_password</code> is too slow, <a href="https://stackoverflow.com/a/1827317...
Django 1.9 Bulk Create New Users Not hashing Passwords Correctly
python|django
8
3,596
2
37,837,187
37,837,187
18
true
2016-06-15T13:28:16.363Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django 1.9 Bulk Create New Users Not hashing Passwords Correctly<p>I want to read in some data from a file to quickly create many test accounts. I'd prefer t...
37,682,372
Why does angular-cli create component/shared/index.ts?<p>If I run this: </p> <pre><code>ng g component components/blogs </code></pre> <p>I get </p> <pre><code>app +--components | +--blogs | | +--shared | | | +--index.ts // what's this for? | | +--blogs.component.css | | +--blogs.component.html | ...
<p>The idea of the <code>index.ts</code> file in the shared dir is something called a barrel.</p> <p>The goal of the barrel it to consolidate imports. It will export the items contained within shared to make the imports in <code>blogs.component.ts</code> cleaner...</p> <p><strong>app/components/blogs/shared/blogs.ser...
Why does angular-cli create component/shared/index.ts?
angular|shared|angular-cli
11
4,879
1
37,688,570
37,688,570
19
true
2016-06-07T14:39:15.840Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does angular-cli create component/shared/index.ts?<p>If I run this: </p> <pre><code>ng g component components/blogs </code></pre> <p>I get </p> <pre...
37,722,619
JavaScript Curly braces argument as function parameter<p>I am not very experienced with javascript and have a question relating to curly braces used around a function parameter, since its not a JSON structure. </p> <p>I am learning nuclear js, and I found some code as example, but I don't understand it well - why is "...
<p>This is an ES2015 (also called ES6) shorthand to create objects.</p> <p><code>{ product }</code> is equivalent to <code>{ product: product }</code>.</p> <p>Basically, you end up with an object with a property called <code>"product"</code> that has the value of the <code>product</code> variable.</p> <p><div class=...
JavaScript Curly braces argument as function parameter
javascript|curly-braces
12
7,194
2
37,722,746
37,722,746
20
true
2016-06-09T09:55:12.143Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaScript Curly braces argument as function parameter<p>I am not very experienced with javascript and have a question relating to curly braces used around a...
37,688,257
Choosing between /dev/tty.usbserial vs /dev/cu.usbserial<p>A PL2303 serial-over-USB device is configured to receive-only data. There is an explanation of <em>tty</em> vs. <em>cu</em> here:</p> <p><em><a href="https://stackoverflow.com/questions/8632586/macos-whats-the-difference-between-dev-tty-and-dev-cu">MacOS: what...
<p>The distinction only matters when you use a modem that provides the DCD signal and you're interested in sharing the device between two or more processes: one or more that can occasionally call out, and exactly one that wants to answer calls. In practice, it probably matters for historical things like <code>uucp</cod...
Choosing between /dev/tty.usbserial vs /dev/cu.usbserial
macos|serial-port|serial-communication
16
12,296
1
37,688,347
37,688,347
21
true
2016-06-07T19:59:49.480Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Choosing between /dev/tty.usbserial vs /dev/cu.usbserial<p>A PL2303 serial-over-USB device is configured to receive-only data. There is an explanation of <e...
37,752,337
Cursor in android studio select rectangle area<p>My cursor have some issue when i select area. It not select from right to left, from bottom to top, it seem to be select rectangle area. my problem is showed in below picture.</p> <p><a href="https://i.stack.imgur.com/31RE6.png" rel="noreferrer"><img src="https://i.stac...
<p>If you are using Windows use this :</p> <p><kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>Insert</kbd> to switch into selection mode.</p> <p><strong>Update</strong></p> <p>For Mac :</p> <p><kbd>Shitf</kbd> + <kbd>Command</kbd> + <kbd>8</kbd></p>
Cursor in android studio select rectangle area
android
7
2,604
1
37,752,552
37,752,552
21
true
2016-06-10T15:48:24.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cursor in android studio select rectangle area<p>My cursor have some issue when i select area. It not select from right to left, from bottom to top, it seem ...
37,792,206
How do I initialize a final field in Kotlin?<p>Let's say I declared a final field with <code>private final String s</code> (Java) or <code>val s</code> (Kotlin). During initialization I want to initialize the field with the result of a call to a remote service. In Java I would be able to initialize it in the constructo...
<p>You can set <code>val</code> value in init block:</p> <pre><code>class MyClass { val s: String init { s = "value" } } </code></pre>
How do I initialize a final field in Kotlin?
kotlin
16
11,784
4
37,792,491
37,792,491
21
true
2016-06-13T14:21:59.430Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I initialize a final field in Kotlin?<p>Let's say I declared a final field with <code>private final String s</code> (Java) or <code>val s</code> (Kotl...
37,790,198
How to dynamically include a layout in Android?<p>I wanted to include a dynamic content to take advantage of all layout already created without having to have an xml with all the features for each actitivy.</p> <p>I noticed that the android has an wanted to use this to determine what will be my content, according to ...
<p>You could define an empty layout in your XML where you would like you dynamic content to be and add it's content from code.</p> <p>Something like this:</p> <pre><code>&lt;android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@...
How to dynamically include a layout in Android?
java|android|xml
12
11,584
1
37,790,333
37,790,333
22
true
2016-06-13T12:44:32.093Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to dynamically include a layout in Android?<p>I wanted to include a dynamic content to take advantage of all layout already created without having to hav...
37,827,279
Add a State property to an Inline Style in React<p>I have a react element that has an inline style like this: (Shortened version)</p> <pre><code> &lt;div className='progress-bar' role='progressbar' style={{width: '30%'}}&gt; &lt;/div&gt; </code></pre> <p>I want to replace the width wi...
<p>You can do it like this</p> <pre><code>style={ { width: `${ this.state.percentage }%` } } </code></pre> <p><a href="https://jsfiddle.net/9manu4vs/" rel="noreferrer"><code>Example</code></a></p>
Add a State property to an Inline Style in React
css|reactjs|styles|state
7
18,442
2
37,827,390
37,827,390
22
true
2016-06-15T06:04:43.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add a State property to an Inline Style in React<p>I have a react element that has an inline style like this: (Shortened version)</p> <pre><code> &lt;d...
37,689,935
What's the difference between query_string and multi_match?<p>When running this queries:</p> <pre><code>{ "query_string" : { "query" : "text", "fields": ["field1", "field2"] } } </code></pre> <p>-</p> <pre><code>{ "multi_match" : { "query" : "text", "fields": ["field1", "field2"] } } </code><...
<p><a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html" rel="noreferrer"><code>query_string</code> supports Lucene syntax to interpret the text</a>, where as <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html" ...
What's the difference between query_string and multi_match?
elasticsearch|lucene
17
10,304
1
37,690,741
37,690,741
24
true
2016-06-07T21:46:23.903Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the difference between query_string and multi_match?<p>When running this queries:</p> <pre><code>{ "query_string" : { "query" : "text", "fi...
37,799,694
Django admin list_filter - filter field by is empty (None or empty string "")<p>In models.py I have:</p> <pre><code>class User(modals.Model): name = models.CharField(max_length=255) image = models.ImageField(blank=True, null=True) </code></pre> <p>And in admin.py:</p> <pre><code>class UserAdmin(admin.ModelAd...
<p>admin.py</p> <pre><code>class ImageListFilter(admin.SimpleListFilter): title = _('Has photo') parameter_name = 'has_photo' def lookups(self, request, model_admin): return ( ('yes', _('Yes')), ('no', _('No')), ) def queryset(self, request, queryset): ...
Django admin list_filter - filter field by is empty (None or empty string "")
django|django-admin
16
8,777
5
37,799,973
37,799,973
24
true
2016-06-13T21:48:58.460Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django admin list_filter - filter field by is empty (None or empty string "")<p>In models.py I have:</p> <pre><code>class User(modals.Model): name = mod...
37,619,848
Why do I get "List index out of range" when trying to add consecutive numbers in a list using "for i in list"?<p>Given the following list</p> <pre><code>a = [0, 1, 2, 3] </code></pre> <p>I'd like to create a new list <code>b</code>, which consists of elements for which the current and next value of <code>a</code> are s...
<ol> <li><p>In your <code>for</code> loop, you're iterating through the elements of a list <code>a</code>. But in the body of the loop, you're using those items to index that list, when you actually want indexes.<br /> Imagine if the list <code>a</code> would contain 5 items, a number 100 would be among them and the fo...
Why do I get "List index out of range" when trying to add consecutive numbers in a list using "for i in list"?
python|list|loops|python-3.x
15
188,430
4
37,620,170
37,620,170
25
true
2016-06-03T17:00:29.077Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do I get "List index out of range" when trying to add consecutive numbers in a list using "for i in list"?<p>Given the following list</p> <pre><code>a = ...