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
38,025,074
How to accumulate an array by index in numpy?<p>I have an array:</p> <pre><code>a = np.array([0,0,0,0,0,0]) </code></pre> <p>I want to add some other array into each index of a, while the index can appear more than one times. I want to get the some of each index. I write:</p> <pre><code>a[np.array([1,2,2,1,3])] += n...
<p>Using pure <code>numpy</code>, AND avoiding a for loop:</p> <pre><code>np.add.at(a, np.array([1,2,2,1,3]), np.array([1,1,1,1,1])) </code></pre> <p>Output:</p> <pre><code>&gt;&gt;&gt; a = np.array([0,0,0,0,0,0]) &gt;&gt;&gt; np.add.at(a, np.array([1,2,2,1,3]), np.array([1,1,1,1,1])) &gt;&gt;&gt; a array([0, 2, 2, ...
How to accumulate an array by index in numpy?
python|arrays|numpy|vectorization
7
1,576
4
38,025,257
38,025,257
15
true
2016-06-25T04:49:43.817Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to accumulate an array by index in numpy?<p>I have an array:</p> <pre><code>a = np.array([0,0,0,0,0,0]) </code></pre> <p>I want to add some other array...
37,853,810
Difference between /topic, /queue for SimpleMessageBroker in Spring Websocket + SockJS<p>Is there a clarification, what is the differences between /topic, /queue etc. for Spring Websocket + SockJS in case I am using "simple broker" ? E.g. here <a href="https://stackoverflow.com/questions/22367223/sending-message-to-sp...
<p>You should take a look at <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#websocket-stomp-message-flow" rel="noreferrer">this part of the reference documentation</a>. In a nutshell, <code>"/topic"</code> and <code>"/queue"</code> are both prefixes configured to the same destin...
Difference between /topic, /queue for SimpleMessageBroker in Spring Websocket + SockJS
java|spring|stomp|spring-websocket|sockjs
17
17,192
3
37,862,917
37,862,917
16
true
2016-06-16T08:27:52.433Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Difference between /topic, /queue for SimpleMessageBroker in Spring Websocket + SockJS<p>Is there a clarification, what is the differences between /topic, /...
38,036,229
Cannot convert value of type NSMutableDictionary? to expected argument type [NSObject: AnyObject]!<p>i wanted to jump over to use Xcode 8 beta and convert my code, but I'm facing some kind of problem here, i am using Google Analytics SDK to send events,and this is how i used to use it in Swift 2.2 : </p> <pre><code> ...
<p>You need to make a variable to hold your <code>NSMutableDictionary</code> then pass it to <code>send()</code> method. </p> <pre><code>let dictionary = (builder?.build())! as NSMutableDictionary tracker?.send(dictionary as [NSObject: AnyObject]!) </code></pre> <p><strong>UPDATE:</strong> Another clean way to use in...
Cannot convert value of type NSMutableDictionary? to expected argument type [NSObject: AnyObject]!
ios|google-analytics|swift3
10
3,908
3
38,036,319
38,036,319
17
true
2016-06-26T07:35:47.853Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot convert value of type NSMutableDictionary? to expected argument type [NSObject: AnyObject]!<p>i wanted to jump over to use Xcode 8 beta and convert my...
38,028,268
__RefactorLog table in SQL Server - safe to drop it?<p>SSDT (I suspect) creates a table called __RefactorLog in any database you point it towards.</p> <p>If I've hit a release is there any harm in deleting this table as I don't see any benefit in including it in schema creation scripts at the time of deployment?</p> ...
<p>It is created by SSDT when you use a refactor in SSDT (like Refactor -> Rename) if you do a deployment and just clear out the table it will retry to do any old refactorings which could just fail or cause a disaster!</p> <p>If you clear the table make sure you also remove the entries from the refactorlog.xml in your...
__RefactorLog table in SQL Server - safe to drop it?
sql-server|sql-server-data-tools
13
6,185
1
38,028,859
38,028,859
18
true
2016-06-25T11:57:43.337Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: __RefactorLog table in SQL Server - safe to drop it?<p>SSDT (I suspect) creates a table called __RefactorLog in any database you point it towards.</p> <p>If...
38,051,198
NGINX: How to setup multiple port in one server or domain name?<p>I am new to nginx. I am having trouble with my setup, I want my server to run with multiple port on public.</p> <p>For example:</p> <pre><code>server { listen 443 ssl; server_name &lt;https - mydomainname&gt;; ssl_certificate &lt;location cert&gt;;...
<p>You can have multiple <code>listen</code> directives per <code>server</code>:</p> <pre><code>server { listen 5005 ssl; listen 6006 ssl; server_name &lt;https - mydomainname&gt;; ssl_certificate &lt;location cert&gt;; ssl_certificate_key &lt;location key&gt;; location /tags.txt { add_header 'Access-Contro...
NGINX: How to setup multiple port in one server or domain name?
nginx
11
51,001
1
38,054,382
38,054,382
18
true
2016-06-27T10:09:05.023Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NGINX: How to setup multiple port in one server or domain name?<p>I am new to nginx. I am having trouble with my setup, I want my server to run with multiple...
37,829,941
Use SVG icon as marker in OpenLayers<p>I tried to svg icon as marker in Openlayers-3. Here in my code.</p> <pre><code>var svg = '&lt;?xml version="1.0"?&gt;' + '&lt;svg viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg"&gt;' + '&lt;circle cx="60" cy="60" r="60"/&gt;' ...
<p>Here is an example that shows inline SVG in an icon symbolizer: <a href="http://jsfiddle.net/eze84su3/" rel="noreferrer">http://jsfiddle.net/eze84su3/</a></p> <p>Here is the relevant code:</p> <pre><code>var svg = '&lt;svg width="120" height="120" version="1.1" xmlns="http://www.w3.org/2000/svg"&gt;' + '&lt;ci...
Use SVG icon as marker in OpenLayers
svg|styles|openlayers|marker
13
14,885
3
37,873,260
37,873,260
19
true
2016-06-15T08:25:15.800Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use SVG icon as marker in OpenLayers<p>I tried to svg icon as marker in Openlayers-3. Here in my code.</p> <pre><code>var svg = '&lt;?xml version="1.0"?&gt;...
37,984,216
Bootstrap accordion with arrows<p>I have a simple question regarding the Bootstrap accordion.</p> <p>I created an accordion which is clickable on the header to expand. This works well but my problem is that the arrows are not showing in the header.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-conso...
<p>Problem is in space between selectors:</p> <pre><code>.panel-heading [data-toggle="collapse"]:after ^------- // remove this space to make this selector work </code></pre> <p>Now you are selecting all elements having <code>data-toggle</code> attribute which are descendants of <code>.panel-heading</cod...
Bootstrap accordion with arrows
html|css|twitter-bootstrap
9
66,335
2
37,984,338
37,984,338
19
true
2016-06-23T06:52:08.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bootstrap accordion with arrows<p>I have a simple question regarding the Bootstrap accordion.</p> <p>I created an accordion which is clickable on the header ...
37,912,161
How can I compute element-wise conditionals on batches in TensorFlow?<p>I basically have a batch of neuron activations of a layer in a tensor <code>A</code> of shape <code>[batch_size, layer_size]</code>. Let <code>B = tf.square(A)</code>. Now I want to compute the following conditional on each element in each vector i...
<p>You may want to look at <a href="https://www.tensorflow.org/api_docs/python/tf/where" rel="noreferrer"><code>tf.where(condition, x, y)</code></a></p> <p>For your issue:</p> <pre class="lang-py prettyprint-override"><code>A = tf.placeholder(tf.float32, [batch_size, layer_size]) B = tf.square(A) condition = tf.less...
How can I compute element-wise conditionals on batches in TensorFlow?
tensorflow
12
7,680
1
37,912,379
37,912,379
20
true
2016-06-19T21:46:07.687Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I compute element-wise conditionals on batches in TensorFlow?<p>I basically have a batch of neuron activations of a layer in a tensor <code>A</code> ...
37,886,302
2 way syncing with Google Calendar/Outlook<p>I am using <a href="http://fullcalendar.io/docs/google_calendar/" rel="noreferrer">FullCalendar</a> in my application to display events created via our own application. </p> <p>I have an add/edit form for creating/updating events. These events are stored in the db used by a...
<p>To be able to create reliable sync solution you need several things. Most important is that the other party (google calendar and outlook in this case) should cooperate with you and provide an api to perform incremental synchronization. I didn't look at Outlook, but Google Calendar api provides you all you need.</p> ...
2 way syncing with Google Calendar/Outlook
java|c#|outlook|calendar|fullcalendar
10
3,114
1
37,937,103
37,937,103
20
true
2016-06-17T16:29:25.493Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 2 way syncing with Google Calendar/Outlook<p>I am using <a href="http://fullcalendar.io/docs/google_calendar/" rel="noreferrer">FullCalendar</a> in my applic...
38,043,555
Capybara expect page.selector to_have<p>I need to validate the presence of some text in a specific part of the page.</p> <p><code>expect(page).to</code> will output too much text, it is especially annoying for the page which hold the terms of agreement, which are always so long.</p> <p>I'd like to transform <code>exp...
<p>You have multiple choices here, either</p> <pre><code>section = find(:css, '#id') #the :css may be optional depending on your Capybara.default_selector setting # or - section = find_by_id('id') expect(section).to have_text(...) </code></pre> <p>or</p> <pre><code>expect(page).to have_css('#id', text: '...') </code...
Capybara expect page.selector to_have
rspec|capybara|rspec-rails|ruby-on-rails-5
9
13,334
1
38,044,315
38,044,315
20
true
2016-06-26T21:54:41.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Capybara expect page.selector to_have<p>I need to validate the presence of some text in a specific part of the page.</p> <p><code>expect(page).to</code> wil...
37,813,467
Sequelize.js insert a model with one-to-many relationship<p>I have two sequelize models with one-to-many relationship. Let's call them Owner and Property.</p> <p>Assume they are defined using the sails-hook-sequelize as such (simplified).</p> <pre><code>//Owner.js module.exports = { options: { tableName: 'owner' },...
<p>You can't associate property existing records when you create the owner, you have to do that right after, with promise chain.</p> <pre><code>Owner.create({name:'nice owner'}).then(function(owner){ owner.setProperties([{name:'nice property'}, {name:'ugly property'}]).then(/*...*/); }); </code></pre> <p>To avoi...
Sequelize.js insert a model with one-to-many relationship
javascript|sql|node.js|orm|sequelize.js
9
26,954
1
37,866,958
37,866,958
21
true
2016-06-14T13:27:04.237Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sequelize.js insert a model with one-to-many relationship<p>I have two sequelize models with one-to-many relationship. Let's call them Owner and Property.</p...
37,878,115
How to return a composite object in Neo4j/Cypher<p>I'd like to return a composite object from Neo4j using cypher to tidy up my queries.</p> <p>To give an example, I have a user account object that has permissions stored as relationships. The permissions are complex objects so can't be nested, they are now linked by th...
<p>You can design the objects as you need:</p> <pre><code>MATCH(user:UserAccount)-[:HasPermission]-&gt;(permission:Permission) WITH { username:user.username, email: user.email, permissions:collect(permission) } AS UserAccount RETURN UserAccount </code></pre> <p><strong>Update</strong></p> <p>You...
How to return a composite object in Neo4j/Cypher
neo4j|cypher
8
6,951
3
37,878,692
37,878,692
21
true
2016-06-17T09:35:22.540Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to return a composite object in Neo4j/Cypher<p>I'd like to return a composite object from Neo4j using cypher to tidy up my queries.</p> <p>To give an ex...
37,995,394
GraphQL object property should be a list of strings<p>How do I make a schema for an object property that is an array of strings in GraphQL? I want the response to look like this:</p> <pre><code>{ name: "colors", keys: ["red", "blue"] } </code></pre> <p>Here is my Schema</p> <pre><code>var keysType = new graphql...
<p>I figured out the answer. The key is to pass the <code>graphql.GraphQLString</code> into <code>graphql.GraphQLList()</code></p> <p>The schema becomes:</p> <pre><code>var ColorType = new graphql.GraphQLObjectType({ name: 'colors', fields: function() { return { name: { type: graphql.GraphQLString }, ...
GraphQL object property should be a list of strings
javascript|node.js|graphql|graphql-js
9
11,532
1
38,001,676
38,001,676
21
true
2016-06-23T15:04:33.057Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GraphQL object property should be a list of strings<p>How do I make a schema for an object property that is an array of strings in GraphQL? I want the respo...
38,022,658
Selenium Python - Handling No such element exception<p>I am writing automation test in Selenium using Python. One element may or may not be present. I am trying to handle it with below code, it works when element is present. But script fails when element is not present, I want to continue to next statement if element i...
<p>You can see if the element exists and then click it if it does. No need for exceptions. Note the plural "s" in <code>.find_elements_*</code>.</p> <pre><code>elem = driver.find_elements_by_xpath(".//*[@id='SORM_TB_ACTION0']") if len(elem) &gt; 0 elem[0].click() </code></pre>
Selenium Python - Handling No such element exception
python|python-3.x|selenium|selenium-webdriver
27
83,502
5
38,023,345
38,023,345
21
true
2016-06-24T21:56:48.827Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selenium Python - Handling No such element exception<p>I am writing automation test in Selenium using Python. One element may or may not be present. I am try...
37,994,441
How to use FS module inside Electron.Atom\WebPack application?<p>I need write some data in the file, using FS module (fs.writeFile). My stack is webpack + react + redux + electron.</p> <p>The first problem was: <strong>Cannot resolve module 'fs'</strong>. I tried to use </p> <pre><code>target: "node", --- node: { ...
<p>Problem is solved.</p> <p>Need use in electron app (where you add the bundle):</p> <pre><code>var remote = require('electron').remote; var electronFs = remote.require('fs'); var electronDialog = remote.dialog; </code></pre>
How to use FS module inside Electron.Atom\WebPack application?
javascript|node.js|reactjs|npm|electron
14
37,963
2
38,021,584
38,021,584
22
true
2016-06-23T14:23:54.537Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use FS module inside Electron.Atom\WebPack application?<p>I need write some data in the file, using FS module (fs.writeFile). My stack is webpack + re...
37,983,125
Padding / space in Toolbar between icon and title (Android 24)<p>With the new Android 24, I found out that the icon and title on the <code>Toolbar</code> has a wider padding and I can't find any way to resolve this. </p> <p><strong>Example:</strong></p> <p><img src="https://i.stack.imgur.com/TK03c.png" alt="Additiona...
<p>You can add this attribute in toolbar to avoid this padding.</p> <pre><code>app:contentInsetStartWithNavigation="0dp" </code></pre>
Padding / space in Toolbar between icon and title (Android 24)
android|padding|toolbar|appbar
8
5,136
2
38,098,273
38,098,273
22
true
2016-06-23T05:35:52.253Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Padding / space in Toolbar between icon and title (Android 24)<p>With the new Android 24, I found out that the icon and title on the <code>Toolbar</code> has...
37,891,752
Angular2 - Add class to item on click<p>I have a bunch of list items and would like to highlight each one once it's clicked. This is easy for me to do in jQuery or even JavaScript but I'm lost when it comes to Angular2.</p> <pre><code>&lt;ul&gt; &lt;li [attr.data-selected]="false" (click)="highlightItem($event)" [c...
<p>You need to make an array in your class to store highlight status of an item:</p> <pre><code>hightlightStatus: Array&lt;boolean&gt; = []; </code></pre> <p>Declare local variable in the template associated with ngFor:</p> <pre><code>&lt;ul&gt; &lt;li [attr.data-selected]="false" (click)="hightlightStatu...
Angular2 - Add class to item on click
angular
25
66,378
5
37,891,984
37,891,984
23
true
2016-06-17T23:31:52.277Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular2 - Add class to item on click<p>I have a bunch of list items and would like to highlight each one once it's clicked. This is easy for me to do in jQu...
37,884,769
UnsatisfiedLinkError: dalvik.system.PathClassLoader<p>I'm making an application for AndroidTV and get the error </p> <pre><code>java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/mytv.mytv-2/base.apk" </code></pre> <p>on a NexusPlayer with Android 6.0.1. Curious that it ...
<p>So this is the solution for UnsatisfiedLinkError for my case but I think it's general. </p> <p>Put in gradle.properties this line</p> <pre><code>android.useDeprecatedNdk=true; </code></pre> <p>and in build.gradle this line in defaultConfig field</p> <pre><code>ndk { abiFilters "armeabi", "armeabi-v7a...
UnsatisfiedLinkError: dalvik.system.PathClassLoader
android|android-tv|nexus-player
12
18,476
1
37,990,725
37,990,725
29
true
2016-06-17T15:00:15.517Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UnsatisfiedLinkError: dalvik.system.PathClassLoader<p>I'm making an application for AndroidTV and get the error </p> <pre><code>java.lang.UnsatisfiedLinkEr...
37,904,597
Nodejs Hapi - How to enable cross origin access control<p>I am working HapiJs Restful web service and trying to enable cors so any client even from different domain can consume my services. I tried cors=true in server connection object but didn't work. </p>
<p>Where did you put <code>cors=true</code>? Could you add some code? </p> <p>Without know exactly where you've put <code>cors = true</code>, this bit of code may help you:</p> <pre><code>server.connection({ routes: { cors: true } }) </code></pre> <p>Or try adding the allowed cors in the config section of your route...
Nodejs Hapi - How to enable cross origin access control
javascript|node.js|hapi.js
17
26,161
3
37,904,791
37,904,791
35
true
2016-06-19T06:35:22.750Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nodejs Hapi - How to enable cross origin access control<p>I am working HapiJs Restful web service and trying to enable cors so any client even from different...
37,890,582
How to continue "on error" using Fastlane<p>I am trying to automate deployments into TestFlight using Fastlane. I want it to continue "on error" even if one of the lanes errors out.</p> <p>For example, if I run "doall" below and "item1" errors out, I want it to still run "item2" and "item3".</p> <p>Is this possible,...
<p>You can use Ruby error handling to do that</p> <pre><code>lane :item1 do # Do some stuff end lane :item2 do # Do some stuff end lane :item3 do # Do some stuff end lane :doall do begin item1 # This causes an error rescue =&gt; ex UI.error(ex) end begin item2 rescue =&gt; ex UI.error(ex) end ...
How to continue "on error" using Fastlane
automation|fastlane
16
10,285
2
37,902,034
37,902,034
37
true
2016-06-17T21:24:13.047Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to continue "on error" using Fastlane<p>I am trying to automate deployments into TestFlight using Fastlane. I want it to continue "on error" even if one...
37,981,269
How to search string values in GraphQL<p>How do you query using GraphQL in a manor similar to SQL's <code>like</code> operator?</p> <p>Example: What users have a first name starting with <code>jason</code>?</p> <p><code>select * from users where first_name like "jason%"</code></p>
<p>The short answer is: you don't.</p> <p>The longer answer is that you have to write that code yourself. GraphQL isn't a database query language like SQL, it's an application query language. What that means is that GraphQL won't let you write arbitrary queries out of the box. It will only support the types of queries...
How to search string values in GraphQL
graphql
49
46,619
2
37,981,802
37,981,802
73
true
2016-06-23T02:19:52.217Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to search string values in GraphQL<p>How do you query using GraphQL in a manor similar to SQL's <code>like</code> operator?</p> <p>Example: What users h...
37,878,951
How to clear Laravel route caching on server<p>This is regarding route cache on localhost</p> <h1>About Localhost</h1> <p>I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a small problem below.</p> <p>if I comment any one route in m...
<p>If you want to remove the routes cache on your server, remove this file:</p> <p><code>bootstrap/cache/routes.php</code></p> <p>And if you want to update it just run <code>php artisan route:cache</code> and upload the <code>bootstrap/cache/routes.php</code> to your server.</p>
How to clear Laravel route caching on server
laravel|laravel-routing
74
241,722
5
37,879,020
37,879,020
74
true
2016-06-17T10:15:46.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to clear Laravel route caching on server<p>This is regarding route cache on localhost</p> <h1>About Localhost</h1> <p>I have 2 routes in my route.php f...
37,869,418
Espresso intent test failing<p>I'm learning android instrumentation testing with espresso. I have an app which has a drawer menu and there is a menu called About. I was testing click on that menu item and contents of activity. </p> <p>testfunction:</p> <pre><code> @Test public void testNavigationDrawerAboutMenu() { ...
<p>I had the same problem and solved it by using <code>IntentsTestRule</code> instead of <code>ActivityTestRule</code>. <code>IntentsTestRule</code> is a subclass of <code>ActivityTestRule</code>. Set up your <code>@Rule</code> which creates the activity like so:</p> <pre><code>@Rule public IntentsTestRule&lt;MyActivi...
Espresso intent test failing
android|android-intent|android-testing|android-espresso
35
15,426
4
38,045,379
38,045,379
81
true
2016-06-16T21:11:56.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Espresso intent test failing<p>I'm learning android instrumentation testing with espresso. I have an app which has a drawer menu and there is a menu called A...
38,033,723
Angular 2 observable subscription not triggering<p>I have an issue with a subscription to an observable not triggering.</p> <p>I have a layout using the side nav layout directive looking like this:</p> <pre><code>&lt;md-sidenav-layout class="nav-bar"&gt; &lt;md-sidenav #start&gt; &lt;nav&gt; ...
<p>The same service instance isn't being shared across your App and Home components because you have listed <code>SidenavService</code> as a provider for both.</p> <p>When you define service provider in the <code>providers</code> entry of a Component decorator, that service is then available to that component and all ...
Angular 2 observable subscription not triggering
angular|rxjs
29
30,500
2
38,034,298
38,034,298
96
true
2016-06-25T23:08:11.827Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular 2 observable subscription not triggering<p>I have an issue with a subscription to an observable not triggering.</p> <p>I have a layout using the sid...
37,890,405
Is there a way to simplify converting an Option into a Result without a macro?<p>I have something like this (the real function is <code>Ini::Section::get</code> from <a href="https://github.com/zonyitoo/rust-ini" rel="noreferrer">rust-ini</a>):</p> <pre><code>impl Foo { pub fn get&lt;K&gt;(&amp;'a mut self, key: &...
<p>The <a href="https://doc.rust-lang.org/std/option/enum.Option.html#method.ok_or" rel="noreferrer"><code>ok_or</code></a> and <a href="https://doc.rust-lang.org/std/option/enum.Option.html#method.ok_or_else" rel="noreferrer"><code>ok_or_else</code></a> methods convert <code>Option</code>s to <code>Result</code>s, and...
Is there a way to simplify converting an Option into a Result without a macro?
rust
77
38,662
2
37,890,739
37,890,739
118
true
2016-06-17T21:09:54.253Z
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 simplify converting an Option into a Result without a macro?<p>I have something like this (the real function is <code>Ini::Section::get</co...
38,054,747
Running chmod command as root with "."<pre><code>Line#1 pwd Line#2 /Users/jigarnaik/Documents/test Line#3 sh-3.2# chown -R jigarnaik . </code></pre> <p>What will be the effect of line no 3 ? Will it change owner of the entire device in linux OS OR the current folder and it's sub-folders OR all the folders and fil...
<p>It will change the owner of the current directory and all subdirectories.</p>
Running chmod command as root with "."
linux
-4
65
1
38,055,038
38,055,038
0
true
2016-06-27T13:04:13.043Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Running chmod command as root with "."<pre><code>Line#1 pwd Line#2 /Users/jigarnaik/Documents/test Line#3 sh-3.2# chown -R jigarnaik . </code></pre> <p>Wha...
37,997,944
Is it possible to upgrade from Solr 4.x directly to Solr 6.1?<p>We are looking to upgrade from SolrCloud 4.10.3 to SolrCloud 6.1. The documentation for Solr 6.1 is not very clear on backward compatibility.</p> <p>I came across <a href="https://support.lucidworks.com/hc/en-us/articles/203776523-How-to-upgrade-between-...
<p>I was able to find this on the <a href="https://cwiki.apache.org/confluence/display/solr/Major+Changes+from+Solr+5+to+Solr+6" rel="nofollow">Apache website</a>.</p> <blockquote> <p>Solr 6 has no support for reading Lucene/Solr 4.x and earlier indexes. Be sure to run the Lucene IndexUpgrader included with Solr 5...
Is it possible to upgrade from Solr 4.x directly to Solr 6.1?
solr|lucene|solrcloud
7
5,407
2
37,999,861
37,999,861
3
true
2016-06-23T17:14:42.773Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to upgrade from Solr 4.x directly to Solr 6.1?<p>We are looking to upgrade from SolrCloud 4.10.3 to SolrCloud 6.1. The documentation for Solr...
38,037,013
PygraphViz Import Error With PyCharm<p>I believe I have installed pygraphviz on my Debian build. I can import it if I run Python from the command line:</p> <pre><code>jon@debian:~/anaconda3/bin$ ipython Python 3.5.1 |Continuum Analytics, Inc.| (default, Dec 7 2015, 11:17:45) Type "copyright", "credits" or "license" ...
<p><a href="https://www.jetbrains.com/help/pycharm/2016.1/quick-start-guide.html#init" rel="nofollow">This guide</a> should help you configuring everything including custom paths to your libraries. </p> <p>The interpreter is ok, it is already pointing to Anaconda's distribution. But under "Default Project" settings th...
PygraphViz Import Error With PyCharm
python|pycharm|anaconda|graphviz|pygraphviz
10
1,855
2
38,206,220
38,206,220
3
true
2016-06-26T09:25:20.897Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PygraphViz Import Error With PyCharm<p>I believe I have installed pygraphviz on my Debian build. I can import it if I run Python from the command line:</p> ...
37,912,597
React Redux Responsibilities<p>I started learning react-redux-immutable couple of days ago and I am still quite confused about structuring my application. I have php (symfony/laravel MVC background) so it is not easy to get my head around some javascript concepts.</p> <p>1) I have lines WrapperComponent:</p> <pre><co...
<p>You should keep your reducers as pure functions. It means that if you call them multiple times with the same arguments, they will have the same expected result, depending only on the arguments.</p> <p>That said, the place you must put that type of logic is called <strong>action creator</strong>, which is actually yo...
React Redux Responsibilities
javascript|reactjs|redux|react-redux|immutable.js
7
546
1
37,912,767
37,912,767
4
true
2016-06-19T22:47:28.033Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Redux Responsibilities<p>I started learning react-redux-immutable couple of days ago and I am still quite confused about structuring my application. I ...
38,007,674
Firebase Notification white circle issue<p>I've a problem with <code>Firebase Notification</code>, If I send notification when app is running on screen the notification show correctly like this:</p> <p><a href="https://i.stack.imgur.com/UM8wY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/UM8wY.png" alt="en...
<p>This is bug in Firebase which is not resolved yet. Link here: <a href="https://stackoverflow.com/a/37332514/1507602">https://stackoverflow.com/a/37332514/1507602</a></p> <p>Another alternative is to not to use Firebase console to send notification, instead use POST API, that way your notification will be delivered ...
Firebase Notification white circle issue
java|android|firebase|firebase-cloud-messaging
7
1,795
2
38,008,136
38,008,136
4
true
2016-06-24T07:15:08.790Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebase Notification white circle issue<p>I've a problem with <code>Firebase Notification</code>, If I send notification when app is running on screen the n...
38,010,495
C# ADAL AcquireTokenAsync() without pop-up box<p>We are writing a WCF service which has to integrate with Dynamics CRM 2016 Online. I'm trying to authenticate using ADAL, using method <code>AcquireTokenAsync()</code>. Problem is, it displays a pop-up box, prompting the user for credentials. Naturally, our application b...
<pre><code>private static string API_BASE_URL = "https://&lt;CRM DOMAIN&gt;.com/"; private static string API_URL = "https://&lt;CRM DOMAIN&gt;.com/api/data/v8.1/"; private static string CLIENT_ID = "&lt;CLIENT ID&gt;"; static void Main(string[] args) { var ap = AuthenticationParameters.CreateFromResourceUrlAsync( ...
C# ADAL AcquireTokenAsync() without pop-up box
c#|wcf|active-directory|dynamics-crm|adal
7
9,293
3
38,018,594
38,018,594
4
true
2016-06-24T09:52:13.477Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# ADAL AcquireTokenAsync() without pop-up box<p>We are writing a WCF service which has to integrate with Dynamics CRM 2016 Online. I'm trying to authenticat...
37,922,628
Swift - Apply local css to web view<p>I'm loading a html page in a web view and I want to apply a local css file. I'm receiving the html in a string from a server and the css will be in my app. For example here I want to display "Hello!" in red. </p> <pre><code>self.articleView = UIWebView(frame : CGRect(x : self.a...
<p>Add delegate method of <code>UIWebView</code> like this</p> <pre><code>func webViewDidFinishLoad(webView: UIWebView) { if let path = Bundle.main.path(forResource: "styles", ofType: "css") { let javaScriptStr = "var link = document.createElement('link'); link.href = '%@'; link.rel = 'stylesheet'; docu...
Swift - Apply local css to web view
ios|css|swift
7
7,950
2
37,922,877
37,922,877
6
true
2016-06-20T12:29:07.230Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swift - Apply local css to web view<p>I'm loading a html page in a web view and I want to apply a local css file. I'm receiving the html in a string from a s...
37,898,987
Append "_id" to foreign key fields in Django Rest Framework<p>I have a model like so:</p> <pre><code>class MyModel(models.Model): thing = models.ForeignKey('Thing') </code></pre> <p>Serializers and ViewSet like so:</p> <pre><code>class ThingSerializer(serializers.ModelSerializer): class Meta: model ...
<p>Found same request and solution here:</p> <p><a href="https://github.com/tomchristie/django-rest-framework/issues/3121" rel="noreferrer">https://github.com/tomchristie/django-rest-framework/issues/3121</a></p> <p><a href="https://gist.github.com/ostcar/eb78515a41ab41d1755b" rel="noreferrer">https://gist.github.com...
Append "_id" to foreign key fields in Django Rest Framework
django|django-rest-framework
8
2,876
5
37,908,893
37,908,893
7
true
2016-06-18T16:06:17.783Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Append "_id" to foreign key fields in Django Rest Framework<p>I have a model like so:</p> <pre><code>class MyModel(models.Model): thing = models.Foreign...
37,977,444
Inconsistent "Cannot find name 'x'" Typescript errors in VS Code<p>My app compiles (transpiles) just fine, but Visual Studio Code is still showing a lot of errors:</p> <p><a href="https://i.stack.imgur.com/KmAkW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KmAkW.png" alt="enter image description here"></a...
<p>After many sad days of chasing this problem - I finally found a <a href="https://github.com/Microsoft/vscode/issues/7018#issuecomment-225505892" rel="noreferrer">GitHub Issue</a> on the VS Code GitHub that explains what is going on.</p> <h1>tl;dr</h1> <p>My <code>tsconfig.json</code> file was configured incorrectly....
Inconsistent "Cannot find name 'x'" Typescript errors in VS Code
angularjs|typescript|ionic-framework|angular|visual-studio-code
12
7,239
3
37,977,472
37,977,472
9
true
2016-06-22T20:15:03.060Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Inconsistent "Cannot find name 'x'" Typescript errors in VS Code<p>My app compiles (transpiles) just fine, but Visual Studio Code is still showing a lot of e...
37,952,111
Deserializing field from nested objects within JSON response with Jackson<p>This seems like it should be a fairly solved/well-addressed issue, but I'm not finding much guidance on it -- hoping this isn't a dupe. </p> <p>My scenario is basically that I am consuming paginated JSON responses that look something like this...
<blockquote> <p>Is there a jackson annotation that would let me skip all of this?</p> </blockquote> <p>You can use <code>JsonDeserialize</code> and define custom JsonDeserializer. </p> <pre><code>class MetaDeserializer extends JsonDeserializer&lt;String&gt; { @Override public String deserialize(JsonParser j...
Deserializing field from nested objects within JSON response with Jackson
java|json|jackson|deserialization
10
4,628
1
38,020,033
38,020,033
9
true
2016-06-21T18:36:15.967Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Deserializing field from nested objects within JSON response with Jackson<p>This seems like it should be a fairly solved/well-addressed issue, but I'm not fi...
38,046,564
How can I put a BackgroundImage in Xamarin.Forms UWP?<p>Good Day everyone. I'm currently creating the UWP part of my Xamarin.Forms Project and I want to put a BackgroundImage in it. I've noticed that the images I used in Xamarin.Forms.Droid are not being displayed on my UWP. Why is that so? </p> <p>I used this code <s...
<p>Check the image and make sure that you place your images in the <strong>application's root directory</strong> with <code>Build Action: Content</code>.</p> <hr> <h2><strong>Edit :</strong></h2> <p>I suggest you to modify the code as :</p> <pre><code>BackgroundImage="//Assets/filename.jpg" </code></pre>
How can I put a BackgroundImage in Xamarin.Forms UWP?
xaml|xamarin|xamarin.forms|uwp|uwp-xaml
7
581
1
38,046,701
38,046,701
9
true
2016-06-27T05:37:38.240Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I put a BackgroundImage in Xamarin.Forms UWP?<p>Good Day everyone. I'm currently creating the UWP part of my Xamarin.Forms Project and I want to put ...
37,912,399
glmnet: How do I know which factor level of my response is coded as 1 in logistic regression<p>I have a logistic regression model that I made using the <code>glmnet</code> package. My response variable was coded as a factor, the levels of which I will refer to as "a" and "b".</p> <p>The mathematics of logistic regress...
<p>Have a look at <code>?glmnet</code> (page 9 of <a href="https://cran.r-project.org/web/packages/glmnet/glmnet.pdf" rel="noreferrer">https://cran.r-project.org/web/packages/glmnet/glmnet.pdf</a>):</p> <pre><code>y response variable. ... For family="binomial" should be either a factor with two levels, or a two-colum...
glmnet: How do I know which factor level of my response is coded as 1 in logistic regression
r|regression|logistic-regression|glmnet
11
2,861
1
37,912,506
37,912,506
11
true
2016-06-19T22:19:53.950Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: glmnet: How do I know which factor level of my response is coded as 1 in logistic regression<p>I have a logistic regression model that I made using the <code...
37,952,747
Firebase multiple WHERE clause in query<p>I'm trying to retreive data where flight data is returned only when the arrival date and airport match. I can't seem to figure out the best solution for this. I can only pull data where either the airport or arrival date is the same, not both (can only use <code>equalTo()</code...
<p>The Realtime Database does not support multiple where clauses but you can create an extra key to make it possible.</p> <p>A "flight" in your <code>"flight"</code> list can have a combined key for <code>"arrivalDate"</code> and <code>"code"</code>.</p> <pre><code>"1ddf3c02-1f2e-4eb7-93d8-3d8d4f9e3da2" : { "airpor...
Firebase multiple WHERE clause in query
java|android|firebase
8
18,740
2
37,952,868
37,952,868
11
true
2016-06-21T19:12:15.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebase multiple WHERE clause in query<p>I'm trying to retreive data where flight data is returned only when the arrival date and airport match. I can't see...
38,020,679
Jupyter: Write a custom magic that modifies the contents of the cell it's in<p>In a Jupyter notebook there are some built-in magics that change the contents of a notebook cell. For example, the <code>%load</code> magic replaces the contents of the current cell with the contents of a file on the file system.</p> <p>How...
<p><strong><em>EDIT</strong>: After a little further digging, I found that the current build of notebook cannot do both.</em></p> <p>Well, this is a little tricky... Looking at the IPython code, it looks like you need to use <code>set_next_input</code> if you want to replace the cell, and <code>run_cell</code> if you...
Jupyter: Write a custom magic that modifies the contents of the cell it's in
python|ipython-notebook|jupyter|jupyter-notebook
15
3,147
1
38,103,336
38,103,336
13
true
2016-06-24T19:21:00.497Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jupyter: Write a custom magic that modifies the contents of the cell it's in<p>In a Jupyter notebook there are some built-in magics that change the contents ...
37,873,501
Get return value for multi-processing functions in python<p>I have two functions to run in parallel and each of them returns a value. I need to wait for both functions to finish and then process the returns from them. How could I achieve this in python. Assume</p> <pre><code>def fun1(): #do some calculation# ret...
<p>Using <code>concurrent.futures</code>:</p> <pre><code>from concurrent.futures import ProcessPoolExecutor as Executor #from concurrent.futures import ThreadPoolExecutor as Executor # to use threads with Executor() as executor: future1 = executor.submit(fun1, arg1, arg2, ...) future2 = executor.submit(fun2, ...
Get return value for multi-processing functions in python
python|python-multithreading|python-multiprocessing
9
10,769
1
37,873,950
37,873,950
14
true
2016-06-17T05:03:34.330Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get return value for multi-processing functions in python<p>I have two functions to run in parallel and each of them returns a value. I need to wait for both...
38,012,592
jQuery load function after video loaded<p>I have a HTML code like this: </p> <pre><code>... &lt;video id="abc" preload="auto" autoplay="autoplay" loop="loop" webkit-playsinline=""&gt; &lt;source src="3.mp4" type="video/mp4"&gt; &lt;/video&gt; ... </code></pre> <p>And I used this JS code:</p> <pre><code>$(docume...
<p>HTML element <code>video</code> does not have <code>load</code> event. It has others, like <code>loadstart</code>, <code>loadeddata</code> or <code>loadedmetadata</code>. See a full list of possible viedo events <a href="http://www.w3schools.com/tags/ref_av_dom.asp" rel="noreferrer">here</a>.</p> <p><div class="sni...
jQuery load function after video loaded
javascript|jquery
10
31,240
2
38,012,659
38,012,659
14
true
2016-06-24T11:40:20.377Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jQuery load function after video loaded<p>I have a HTML code like this: </p> <pre><code>... &lt;video id="abc" preload="auto" autoplay="autoplay" loop="loo...
37,889,607
Stripe, PayPal, integration with django-rest-framework<p>I want to integrate Stripe, PayPal or Braintree into django project, and I want to use 'django-rest-framework`, now I'm confused about one thing and that is - Should I "touch" my database?</p> <p>What I mean, I want only to charge once to my customers, it's a fe...
<p>(Disclaimer: I'm a Stripe employee, so I'll only talk about Stripe here.)</p> <p>Stripe makes it easy to be PCI compliant. With a proper integration, you will never have access to your customers' payment information.</p> <p>A typical payment flow with Stripe can be divided in two steps:</p> <ol> <li><p>Collect th...
Stripe, PayPal, integration with django-rest-framework
python|django|rest|paypal|stripe-payments
7
6,674
1
37,890,296
37,890,296
16
true
2016-06-17T20:06:10.223Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stripe, PayPal, integration with django-rest-framework<p>I want to integrate Stripe, PayPal or Braintree into django project, and I want to use 'django-rest-...
37,903,824
How can i make infinite flowing background with only CSS?<p>I'm just started to web programming, cuz many cooooool pages on awwwards.com - definitely caught my mind.</p> <p>anyway, the first page what i aim for make is the pinterest (www.pinterest.com); <strong>slowly moving background</strong> with blur effect, float...
<p>This should fit your slowly moving+infinite flowing+responsively fit to height background criteria. <div class="snippet" data-lang="js" data-hide="false" data-console="true"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>html, body { height: 100%; margin: 0; paddi...
How can i make infinite flowing background with only CSS?
html|css|css-animations
9
21,298
3
37,904,519
37,904,519
17
true
2016-06-19T04:04:26.303Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i make infinite flowing background with only CSS?<p>I'm just started to web programming, cuz many cooooool pages on awwwards.com - definitely caught ...
38,005,864
Service Fabric tooling for Visual Studio 2015 Update 2 seems to be broken<p>I've installed the SF SDK 2.1.150 (VS2015), cloned the <a href="https://github.com/Azure-Samples/service-fabric-dotnet-getting-started" rel="nofollow noreferrer">https://github.com/Azure-Samples/service-fabric-dotnet-getting-started</a> and ope...
<p>Clearing the Visual Studio component cache according to the following steps helped:</p> <p><a href="https://github.com/Codealike/Codealike-KnowledgeBase/blob/master/clear-visual-studio-component-cache.md">https://github.com/Codealike/Codealike-KnowledgeBase/blob/master/clear-visual-studio-component-cache.md</a> :</...
Service Fabric tooling for Visual Studio 2015 Update 2 seems to be broken
visual-studio-2015|azure-service-fabric
8
1,545
1
38,007,325
38,007,325
17
true
2016-06-24T04:58:01.417Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Service Fabric tooling for Visual Studio 2015 Update 2 seems to be broken<p>I've installed the SF SDK 2.1.150 (VS2015), cloned the <a href="https://github.co...
38,015,319
How to create a numpy array from a pydub AudioSegment?<p>I'm aware of the following question: <a href="https://stackoverflow.com/questions/35735497/how-to-create-a-pydub-audiosegment-using-an-numpy-array">How to create a pydub AudioSegment using an numpy array?</a></p> <p>My question is the right opposite. If I have ...
<p>Pydub has a facility for getting the <a href="https://github.com/jiaaro/pydub/blob/master/API.markdown#audiosegmentget_array_of_samples" rel="noreferrer">audio data as an array of samples</a>, it is an <code>array.array</code> instance (not a numpy array) but you should be able to convert it to a numpy array relativ...
How to create a numpy array from a pydub AudioSegment?
python|arrays|numpy|wave|pydub
30
18,455
4
38,021,664
38,021,664
19
true
2016-06-24T14:03:37.457Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a numpy array from a pydub AudioSegment?<p>I'm aware of the following question: <a href="https://stackoverflow.com/questions/35735497/how-to-c...
38,033,068
Android AudioRecord won't initialize<p>I'm trying to implement an app that listens to microphone input (specifically, breathing), and presents data based on it. I'm using the Android class AudioRecord, and when trying to instantiate AudioRecord I get three errors.</p> <pre><code>AudioRecord: AudioFlinger could not cre...
<p>I found the answer myself. It had to do with permissions.</p> <p>The problem was that I am running API version 23 (Android 6.0.1) on my phone, which no longer uses only the manifest file to handle permissions. From version 23, permissions are granted in run-time instead. I added a method that makes sure to request ...
Android AudioRecord won't initialize
java|android|multithreading|audiorecord
9
11,795
1
38,037,227
38,037,227
19
true
2016-06-25T21:19:23.257Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android AudioRecord won't initialize<p>I'm trying to implement an app that listens to microphone input (specifically, breathing), and presents data based on ...
37,977,320
How to mock a Kotlin singleton object?<p>Given a Kotlin singleton object and a fun that call it's method</p> <pre><code>object SomeObject { fun someFun() {} } fun callerFun() { SomeObject.someFun() } </code></pre> <p>Is there a way to mock call to <code>SomeObject.someFun()</code>?</p>
<p>Just make you object implement an interface, than you can mock you object with any mocking library. Here example of Junit + Mockito + <a href="https://github.com/nhaarman/mockito-kotlin" rel="noreferrer">Mockito-Kotlin</a>:</p> <pre><code>import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.wh...
How to mock a Kotlin singleton object?
mocking|mockito|kotlin|powermock|powermockito
48
43,287
6
37,978,020
37,978,020
20
true
2016-06-22T20:07:37.710Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to mock a Kotlin singleton object?<p>Given a Kotlin singleton object and a fun that call it's method</p> <pre><code>object SomeObject { fun someFun()...
38,017,058
How to return current date in a different timezone in PostgreSQL<p>I'm working on an application which uses Eastern time with a database set to Pacific time. This has been causing some issues, but we're told that it can't be any other way, so we just have to work around it. </p> <p>Anyway, one of the things I'm having...
<p><code>select current_date at time zone 'UTC',current_date::timestamp ;</code> or any other zone</p> <p><a href="https://i.stack.imgur.com/E2b6y.png" rel="noreferrer"><img src="https://i.stack.imgur.com/E2b6y.png" alt="enter image description here"></a></p> <p><strong>update</strong>:</p> <p><code>select (current...
How to return current date in a different timezone in PostgreSQL
postgresql|date|timezone
11
23,835
2
38,017,113
38,017,113
20
true
2016-06-24T15:33:22.633Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to return current date in a different timezone in PostgreSQL<p>I'm working on an application which uses Eastern time with a database set to Pacific time....
37,998,065
Understanding Ryu OpenFlow Controller, mininet, WireShark and tcpdump<p>I am a newbie to OpenFlow and SDN. I need help setting up the Ryu OpenFlow controller on a Ubuntu or Debian machine and understand a basic Ryu application.</p> <p><strong>Note</strong>: this question already has an answer.</p>
<p>This is probably one of the longest posts I have written on Stack Overflow. I have been learning about OpenFlow, SDN and Ryu and would like to document my knowledge for a beginner here. Please correct/edit my post if needed.</p> <p>This short guide assumes you already have knowledge of computer networks and major ne...
Understanding Ryu OpenFlow Controller, mininet, WireShark and tcpdump
ubuntu|debian|sdn|openflow|ryu
10
11,565
2
37,998,066
37,998,066
21
true
2016-06-23T17:22:32.530Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Understanding Ryu OpenFlow Controller, mininet, WireShark and tcpdump<p>I am a newbie to OpenFlow and SDN. I need help setting up the Ryu OpenFlow controller...
37,927,728
Where are inodes stored at?<p>I recently started learning about the Linux kernel and I just learned about inodes, which are data-structures containing meta-data of a file.</p> <p>Now, how do the OS find the associated inode of a file? (Let's say a string of a path). Moreover, where are those inode stored at? I mean, o...
<p>It depends on file system implementation. For example ext2fs/ext3fs choose to store inodes before data blocks within Block Group. <a href="http://www.science.unitn.it/~fiorella/guidelinux/tlk/node95.html" rel="noreferrer">The Second Extended File system (EXT2)</a></p> <p>Remember inodes stored across all Block Gr...
Where are inodes stored at?
linux|linux-kernel|operating-system|filesystems
13
11,539
1
37,927,922
37,927,922
24
true
2016-06-20T16:43:36.357Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Where are inodes stored at?<p>I recently started learning about the Linux kernel and I just learned about inodes, which are data-structures containing meta-d...
37,993,924
Replace specific values based on another dataframe<p>First, let's start with DataFrame 1 (DF1) :</p> <pre><code>DF1 &lt;- data.frame(c("06/19/2016", "06/20/2016", "06/21/2016", "06/22/2016", "06/23/2016", "06/19/2016", "06/20/2016", "06/21/2016", "06/22/2016", "06/23/2016"), ...
<p>You could use the join functionality of the <a href="/questions/tagged/data.table" class="post-tag" title="show questions tagged &#39;data.table&#39;" rel="tag">data.table</a>-package for this:</p> <pre><code>library(data.table) setDT(DF1) setDT(DF2) DF1[DF2, on = .(date, id), `:=` (city = i.city, sales = i.sales)...
Replace specific values based on another dataframe
r|dataframe|lookup
14
5,176
3
37,994,369
37,994,369
31
true
2016-06-23T14:03:27.700Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace specific values based on another dataframe<p>First, let's start with DataFrame 1 (DF1) :</p> <pre><code>DF1 &lt;- data.frame(c("06/19/2016", "06/20/...
38,006,584
How to clone and integrate external (from git) cmake project into local one<p>I faced with a problem when I was trying to use Google Test. </p> <p>There are lot of manuals on how to use <code>ExternalProject_Add</code> for the adding gtest into the project, however most of these describe a method based on downloading ...
<p>I would go with the first approach. You don't need to specify a build command because cmake is used by default. This could look like:</p> <pre><code>cmake_minimum_required(VERSION 3.0) project(GTestProject) include(ExternalProject) set(EXTERNAL_INSTALL_LOCATION ${CMAKE_BINARY_DIR}/external) ExternalProject_Add(g...
How to clone and integrate external (from git) cmake project into local one
c++|git|cmake|googletest
19
36,687
1
38,026,254
38,026,254
37
true
2016-06-24T06:06:33.710Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to clone and integrate external (from git) cmake project into local one<p>I faced with a problem when I was trying to use Google Test. </p> <p>There are...
37,934,124
Escape VueJS data binding syntax in Laravel Blade?<p>Laravel templating language Blade and VueJS data binding syntax are very similar.</p> <p>How can I escape VueJS data binding syntax when in a <code>*.blade.php</code> file?</p> <p>Example: </p> <pre><code>&lt;div&gt; &lt;!-- Want it with VueJS --&gt; {{ select...
<p>While asking the question I discovered that you can escape Laravel's Blade by prepending an <code>@</code> sign before the double brackets <code>{{}}</code> or the <code>{!! !!}</code> html rendering brackets.</p> <p>So here is the answer: </p> <pre><code>&lt;div&gt; &lt;!-- HTML rendering with VueJS --&gt; @{...
Escape VueJS data binding syntax in Laravel Blade?
laravel|laravel-blade|vue.js
16
9,481
2
37,934,125
37,934,125
42
true
2016-06-21T01:12:55.540Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Escape VueJS data binding syntax in Laravel Blade?<p>Laravel templating language Blade and VueJS data binding syntax are very similar.</p> <p>How can I esca...
38,005,762
angular2 Observable Property 'debouceTime' does not exist on type 'Observable<any>'<p>I use <strong>"angular2 webpack"</strong> and <strong>"angular2/form,Observable"</strong> , but met an error ,need help ..</p> <p>There is a custom form validator --</p> <pre><code>import {Observable} from 'rxjs/Rx'; import {REACTIV...
<p>Be sure you've initiated that in main.ts <em>(where the app is bootstraped)</em></p> <pre><code>import "rxjs/add/operator/map"; import "rxjs/add/operator/debounceTime"; ... </code></pre> <p>or all at once</p> <pre><code>import "rxjs/Rx"; </code></pre> <p>EXTEND</p> <p>there is <a href="http://plnkr.co/edit/gk8a...
angular2 Observable Property 'debouceTime' does not exist on type 'Observable<any>'
angular|rxjs|observable|angular2-forms
21
27,686
8
38,005,838
38,005,838
45
true
2016-06-24T04:47:03.207Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: angular2 Observable Property 'debouceTime' does not exist on type 'Observable<any>'<p>I use <strong>"angular2 webpack"</strong> and <strong>"angular2/form,Ob...
37,948,504
Set href in attribute directive in Angular<p>I'm trying to set up a Bootstrap tab strip with Angular 2. I have the tabs rendering in an <code>ngFor</code> but I'm getting template errors when I try to put the <code>#</code> infront of the <code>href</code> expression. So this template compiles but isn't what I want:<...
<p>There is no need to prefix with <code>#</code></p> <p>In this code</p> <pre><code>&lt;ul class="nav nav-tabs" role="tablist"&gt; &lt;li *ngFor="let aType of resourceTypes; let i = index" [ngClass]="{'active': i == 0}" role="presentation"&gt; &lt;a [attr.href]="aType.Name" [attr.aria-contro...
Set href in attribute directive in Angular
angular
25
68,626
3
37,948,559
37,948,559
49
true
2016-06-21T15:23:53.607Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set href in attribute directive in Angular<p>I'm trying to set up a Bootstrap tab strip with Angular 2. I have the tabs rendering in an <code>ngFor</code> b...
38,040,327
How to pass rustc flags to cargo?<p>I am trying to disable dead code warnings. I tried the following</p> <pre><code>cargo build -- -A dead_code </code></pre> <blockquote> <p>➜ rla git:(master) ✗ cargo build -- -A dead_code error: Invalid arguments.</p> </blockquote> <p>So I am wondering how would I pass rustc a...
<p>You can pass flags through Cargo by several different means:</p> <ul> <li><code>cargo rustc</code>, which only affects your crate and not its dependencies.</li> <li>The <a href="https://doc.rust-lang.org/cargo/reference/environment-variables.html" rel="noreferrer"><code>RUSTFLAGS</code></a> environment variable, wh...
How to pass rustc flags to cargo?
rust|rust-cargo
32
27,412
2
38,040,431
38,040,431
49
true
2016-06-26T15:55:13.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pass rustc flags to cargo?<p>I am trying to disable dead code warnings. I tried the following</p> <pre><code>cargo build -- -A dead_code </code></pre...
37,860,282
How to word with UISearchBar Delegate and an array?<p>I want to implement a <code>UIsearchBar</code> with an array. I have an array with city names. How do I implement it with a table view?</p>
<p>First you should set the delegate of <code>UISearchBar</code> and to create an other <code>NSMutableArray</code> with filtered results. The dataSource for your <code>UITableView</code> will now release uppon this new array.</p> <p>Then, add the delegate method like this : </p> <pre><code>-(void)searchBar:(UISearch...
How to word with UISearchBar Delegate and an array?
objective-c|swift|uitableview|delegates|uisearchbar
-3
48
1
37,860,577
37,860,577
0
true
2016-06-16T13:10:01.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to word with UISearchBar Delegate and an array?<p>I want to implement a <code>UIsearchBar</code> with an array. I have an array with city names. How do...
37,956,106
python: PyPi public modules: How to determine if secure and safe?<p>I am have completed my python 3 application, and it is using multiple public modules from PyPi.</p> <p>However, before I deploy it to run within my company's enterprise which will be handling credentials of our customers and accessing 3rd party APIs, ...
<p>These are 3 separate questions, so:</p> <ol> <li><p>You'll have to audit the package (or get someone else to do that) to know if it's secure. No easy way around it.</p></li> <li><p>All pypi packages have md5 signature attached (link in parentheses after the file). Some of them also attach the pgp signature which sh...
python: PyPi public modules: How to determine if secure and safe?
python|security|docker|pypi
10
3,377
1
37,956,292
37,956,292
3
true
2016-06-21T23:18:58.357Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python: PyPi public modules: How to determine if secure and safe?<p>I am have completed my python 3 application, and it is using multiple public modules from...
37,949,620
postgresql jsonb case insensitive query<p>I have a table like:</p> <pre><code>CREATE TABLE cityData ( item character varying, data jsonb ); </code></pre> <p>it contains values like </p> <pre><code>ITEM DATA test1 [{"rank":"1", "city":"New York"},{"rank":"3", "city":"Sidney"}] test2 [{"rank":"...
<pre><code>where lower(data::text)::jsonb @&gt; lower('[{"city":"New York"}]')::jsonb </code></pre>
postgresql jsonb case insensitive query
postgresql|jsonb
9
8,515
2
37,950,045
37,950,045
10
true
2016-06-21T16:17:55.977Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: postgresql jsonb case insensitive query<p>I have a table like:</p> <pre><code>CREATE TABLE cityData ( item character varying, data jsonb ); </code></pre...
37,854,359
Using nogil with cpdef class method in cython<p>I want to design a cdef class whose methods can be run in parallel and therefore I need to set them as <code>nogil</code>. I see I can do this for <code>cdef</code> methods, but for some reason I cannot understand I am not allowed to do the same with <code>cpdef</code> m...
<p>If you look at the C code generated (omitting <code>nogil</code>) you'll see that the first thing the method does is check to see whether the it has been overridden by a Python subclass. This requires the GIL.</p> <p>(Note that this can't happen for a <code>cdef</code> function since it is never known about by Pyth...
Using nogil with cpdef class method in cython
parallel-processing|cython
8
3,594
1
37,869,168
37,869,168
13
true
2016-06-16T08:54:28.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using nogil with cpdef class method in cython<p>I want to design a cdef class whose methods can be run in parallel and therefore I need to set them as <code>...
37,890,412
Increment matplotlib color cycle<p>Is there a simple way to increment the matplotlib color cycle without digging into axes internals?</p> <p>When plotting interactively a common pattern I use is:</p> <pre><code>import matplotlib.pyplot as plt plt.figure() plt.plot(x,y1) plt.twinx() plt.plot(x,y2) </code></pre> <p>T...
<p>You could call </p> <pre><code>ax2._get_lines.get_next_color() </code></pre> <p>to advance the color cycler on color. Unfortunately, this accesses the private attribute <code>._get_lines</code>, so this is not part of the official public API and not guaranteed to work in future versions of matplotlib.</p> <p>A sa...
Increment matplotlib color cycle
python|matplotlib|jupyter-notebook
12
9,230
3
37,891,126
37,891,126
13
true
2016-06-17T21:10:38.660Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Increment matplotlib color cycle<p>Is there a simple way to increment the matplotlib color cycle without digging into axes internals?</p> <p>When plotting i...
37,893,252
Get row data failed, error of Cannot create property 'guid' on string<p>I'm using jquery datatables. I got error of <code>Cannot create property 'guid' on string</code> when I tried to retrieve the row data.</p> <p><a href="http://jsfiddle.net/rqx14xep" rel="noreferrer">http://jsfiddle.net/rqx14xep</a></p> <pre><code...
<p>Your main problem is this line :</p> <pre><code>$('body').on('click', '#employersTable tr', retrieveRow(this)); ^^^^^^^^^^^^^^^^^ </code></pre> <p>This actually <em>executes</em> <code>retrieveRow()</code> right away. When you reference to a function variable in a <code>...
Get row data failed, error of Cannot create property 'guid' on string
javascript|jquery|datatables
8
19,215
1
37,893,975
37,893,975
14
true
2016-06-18T04:29:54.047Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get row data failed, error of Cannot create property 'guid' on string<p>I'm using jquery datatables. I got error of <code>Cannot create property 'guid' on st...
37,848,481
How to configure CELERYBEAT_SCHEDULE in Django settings?<p>I can get this to run as a standalone application, but I am having trouble getting it to work in Django.</p> <h2>Here is the stand alone code:</h2> <pre><code>from celery import Celery from celery.schedules import crontab app = Celery('tasks') app.conf.upda...
<p>Why don't you try like the following and let me know if it worked out for you or not. It does work for me.</p> <p>In settings.py</p> <pre><code>CELERYBEAT_SCHEDULE = { 'my_scheduled_job': { 'task': 'run_scheduled_jobs', # the same goes in the task name 'schedule': crontab(), }, } </code></p...
How to configure CELERYBEAT_SCHEDULE in Django settings?
python|django|celery|periodic-task
8
12,344
1
37,851,090
37,851,090
15
true
2016-06-16T01:34:07.720Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to configure CELERYBEAT_SCHEDULE in Django settings?<p>I can get this to run as a standalone application, but I am having trouble getting it to work in D...
37,981,000
GATT profile and UART service<p>I am new to developing a mobile app with bluetooth connection to peripheral device. I searched that GATT is the relevant profile used for bluetoothLE communication but our client recommended that we use UART service. Now I am confused as to 1. how these two things are related and 2. Do...
<p>Legacy Bluetooth provides the serial port profile (SPP) - This is essentially a serial input/output stream over Bluetooth. </p> <p>Bluetooth Low Energy provides a number of profiles, but the most commonly used is GATT. GATT exposes characteristics/attributes which are a little like variables that you can read fro...
GATT profile and UART service
bluetooth|bluetooth-lowenergy|uart|gatt|btle
12
12,861
1
37,981,606
37,981,606
16
true
2016-06-23T01:48:38.667Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GATT profile and UART service<p>I am new to developing a mobile app with bluetooth connection to peripheral device. I searched that GATT is the relevant prof...
37,986,148
Rolling average by group R data.table<p>I want to compute a YTD rolling average by group starting from the first row in the group and ending at the last row. Sample below...</p> <pre><code>Group &lt;- c(rep("a",5), rep("b",5)) Sales &lt;- c(2,4,3,3,5,9,7,8,10,11) Result &lt;- c(2,3,3,3,3.4,9,8,8,8.5,9) df &lt;- data.f...
<p>Using <code>cumsum</code>:</p> <pre><code>dt &lt;- as.data.table(df) dt[, res := cumsum(Sales)/(1:.N), by = Group] dt Group Sales Result res 1: a 2 2.0 2.0 2: a 4 3.0 3.0 3: a 3 3.0 3.0 4: a 3 3.0 3.0 5: a 5 3.4 3.4 6: b 9 9.0 9.0 7: b...
Rolling average by group R data.table
r|data.table
8
4,631
2
37,986,431
37,986,431
16
true
2016-06-23T08:30:06.223Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rolling average by group R data.table<p>I want to compute a YTD rolling average by group starting from the first row in the group and ending at the last row....
37,867,486
How can I delete a RabbitMq exchange?<p>I can easily delete queues, like this:</p> <p><code>rabbitmqadmin delete queue name='MyQ'</code></p> <p>However, I cannot find a way to delete exchanges. What am I missing?</p>
<p>➜ </p> <pre><code>./rabbitmqadmin delete exchange name='myexchange' exchange deleted </code></pre>
How can I delete a RabbitMq exchange?
rabbitmq
9
13,855
2
37,868,340
37,868,340
19
true
2016-06-16T19:06:59.250Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I delete a RabbitMq exchange?<p>I can easily delete queues, like this:</p> <p><code>rabbitmqadmin delete queue name='MyQ'</code></p> <p>However, I ...
37,936,038
Getting "project" nuget configuration is invalid error<p>I'm getting "[project] nuget configuration is invalid" error. I received an error like this before and used the 'Update Nuget package manager' solution mentioned here:</p> <p><a href="https://stackoverflow.com/questions/32344232/unable-to-install-any-package-in-...
<p>NOTE: This is mentioned in the question but <strong>restarting Visual Studio</strong> fixes the issue in most cases.</p> <p>Updating Visual Studio to 'Update 2' got it working again.</p> <p><code>Tools -&gt; Extensions and Updates -&gt;Visual Studio Update 2</code></p> <p>As mentioned in the question and the link i ...
Getting "project" nuget configuration is invalid error
visual-studio|visual-studio-2015|nuget
295
106,011
2
37,936,226
37,936,226
21
true
2016-06-21T05:10:35.317Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting "project" nuget configuration is invalid error<p>I'm getting "[project] nuget configuration is invalid" error. I received an error like this before a...
37,964,763
What does 'separate' in sequelize mean?<p>I searched in the official docs of sequelize and couldn't find any entry about '<code>separate</code>'.<a href="https://readthedocs.org/search/?q=separate" rel="noreferrer">https://readthedocs.org/search/?q=separate</a></p> <p>I also searched on google but in vain.</p> <pre><...
<p>I found this in the <a href="https://github.com/sequelize/sequelize/blob/v3.23.3/lib/model.js#L1306" rel="noreferrer">current code</a>:</p> <blockquote> <p>If true, runs a separate query to fetch the associated instances, only supported for hasMany associations</p> </blockquote> <p>To elaborate: by default, to r...
What does 'separate' in sequelize mean?
sequelize.js
21
17,457
2
37,965,130
37,965,130
27
true
2016-06-22T10:02:56.510Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does 'separate' in sequelize mean?<p>I searched in the official docs of sequelize and couldn't find any entry about '<code>separate</code>'.<a href="htt...
37,992,365
How to set the elevation of an AppBarLayout programmatically in the Android Support Library v24.0.0?<p>When upgrading from the Android Support Library v23.4.0 to v24.0.0, setting the elevation to 0 programmatically to an AppBarLayout stopped working:</p> <pre><code>appBayLayout.setElevation(0); </code></pre> <p>It do...
<p><strong>Edit</strong></p> <p>The <code>AppBarLayout</code> from v24.0.0 uses a <code>StateListAnimator</code> that defines the elevation depending on its state. So using <code>setElevation</code> will have no effect if a <code>StateListAnimator</code> is being used (which happens by default). Set the <code>elevatio...
How to set the elevation of an AppBarLayout programmatically in the Android Support Library v24.0.0?
android|android-support-library|android-support-design
19
6,671
3
37,992,366
37,992,366
27
true
2016-06-23T12:58:44.257Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set the elevation of an AppBarLayout programmatically in the Android Support Library v24.0.0?<p>When upgrading from the Android Support Library v23.4....
37,933,043
Reset checkbox checked state go back from history<p>In the following example, I use checkbox for making a pure CSS dropdown navigation, also available in this <strong><a href="https://jsfiddle.net/pjbf3eyb/" rel="noreferrer">jsFiddle example</a></strong>.</p> <p>Open that fiddle, click "Menu", click "Link 1", and clic...
<p>No need for JS or CSS, just add <code>autocomplete="off"</code> to the checkbox. This will prevent the browser from caching the 'checked' status.</p> <p>Example: <a href="https://jsfiddle.net/6g5u8wkb/" rel="noreferrer">https://jsfiddle.net/6g5u8wkb/</a></p> <p>Also, if you have multiple checkboxes, I beleive you ...
Reset checkbox checked state go back from history
javascript|jquery|html|css|checkbox
11
7,721
4
37,933,164
37,933,164
30
true
2016-06-20T22:51:48.490Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reset checkbox checked state go back from history<p>In the following example, I use checkbox for making a pure CSS dropdown navigation, also available in thi...
37,947,541
What is the difference between Firebase push-notifications and FCM messages?<p>Heloo, I am building an app where I am using push notifications via Firebase Console. I want to know what is a difference between simply push-notification and cloud message? Is it that messages from cloud messaging are data messages(have ke...
<p>Firebase API has two types of messages, they call them: </p> <ul> <li>notification</li> <li>data</li> </ul> <h2>Explanation:</h2> <ol> <li><strong>notification</strong> - messages that goes directly to Android's Notification tray only if your application is in <strong>background/killed</strong> or gets delivered ...
What is the difference between Firebase push-notifications and FCM messages?
google-cloud-messaging|firebase-cloud-messaging|firebase-notifications
30
21,768
1
37,948,441
37,948,441
60
true
2016-06-21T14:42:05.447Z
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 Firebase push-notifications and FCM messages?<p>Heloo, I am building an app where I am using push notifications via Firebase C...
37,977,721
Why is safe navigation better than using try in Rails?<p>I'm reading <a href="http://mitrev.net/ruby/2015/11/13/the-operator-in-ruby/" rel="noreferrer">this</a>. What's the benefit of using this:</p> <pre><code>user&amp;.address&amp;.state </code></pre> <p>over</p> <pre><code>user.try(:address).try(:state) </code></...
<h2>(1) <code>&amp;.</code> is generally shorter than <code>try(...)</code></h2> <p>Depending on the scenario, this can make your code more readable.</p> <h2>(2) <code>&amp;.</code> is standard Ruby, as opposed to <code>try</code></h2> <p>The method <code>try</code> is not defined in a Ruby core library but rather i...
Why is safe navigation better than using try in Rails?
ruby|ruby-on-rails-4
37
12,588
3
37,978,494
37,978,494
81
true
2016-06-22T20:30:16.147Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is safe navigation better than using try in Rails?<p>I'm reading <a href="http://mitrev.net/ruby/2015/11/13/the-operator-in-ruby/" rel="noreferrer">this<...
37,961,948
Shared Element with scaleType centerCrop transition is jumpy<p>I'm trying to implement a shared elements transition when 2 <code>ImageViews</code> from one screen go to the next screen. one of the images has a scaleType of <code>centerCrop</code> on both screen. The problem I'm facing is that when the transition starts...
<p>Finally, managed to solve this issue. desired result was achieved using the following code and configuration:</p> <pre><code>private static void startAnimatedTransitionIntent(Activity context, View view, ArticleCoverData articleCoverData) { Intent intent = new Intent(context, ReaderActivity.class); intent.p...
Shared Element with scaleType centerCrop transition is jumpy
android|crop|android-transitions|android-glide|shared-element-transition
14
4,621
4
38,076,932
38,076,932
4
true
2016-06-22T07:59:41.030Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Shared Element with scaleType centerCrop transition is jumpy<p>I'm trying to implement a shared elements transition when 2 <code>ImageViews</code> from one s...
37,923,866
react - how do I get the size of a component child elements and reposition them<p>I have a component, which arranges elements in a dynamic grid, something like this:</p> <pre><code>class GridComponent extends React.Component { render() { return &lt;div&gt; {items.map(function(item){ return &lt;It...
<p>That's a pretty cool idea and you can totally do this using internal state and a few React lifecycle methods. To answer each of your questions:</p> <ul> <li>the function <code>componentDidMount</code> will get called on the parent after all constructors and <code>componentDidMount</code> of every child, therefore h...
react - how do I get the size of a component child elements and reposition them
reactjs
10
6,698
1
37,924,214
37,924,214
7
true
2016-06-20T13:29:03.723Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: react - how do I get the size of a component child elements and reposition them<p>I have a component, which arranges elements in a dynamic grid, something li...
37,866,549
Add line numbers to text content of a rendered rmarkdown html document<p>I am writing a report in Rmarkdown which shall be rendered in html because it contains Rshiny chunks. Is there any way I can add line numbers to the file?</p> <p>Importantly I need line numbers for <strong>the text</strong> and <strong>not for th...
<p>Interesting question and since I like to play around with JS and jQuery inside of RMarkdown documents I gave it a shot.</p> <p>This solution is not bulletproof. It is <strong>only tested with Firefox</strong>. Since cross-browser compatibility of jQuery is a mess it will probably only work with Firefox. </p> <p>Ev...
Add line numbers to text content of a rendered rmarkdown html document
javascript|html|css|r|r-markdown
8
2,356
1
37,927,810
37,927,810
7
true
2016-06-16T18:16:11.833Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add line numbers to text content of a rendered rmarkdown html document<p>I am writing a report in Rmarkdown which shall be rendered in html because it contai...
38,052,325
arrange_() multiple columns with descending order<p>I am trying to use <code>arrange_()</code> with string input and in one of the columns in descending order.</p> <pre><code>library(dplyr) # R version 3.3.0 (2016-05-03) , dplyr_0.4.3 # data set.seed(1) df1 &lt;- data.frame(grp = factor(c(1,2,1,2,1)), ...
<p>We can <code>paste</code> 'desc' as a string to evaluate it.</p> <pre><code>myCol1 &lt;- paste0(&quot;desc(&quot;, &quot;x)&quot;) df1 %&gt;% arrange_(.dots = c(&quot;grp&quot;, myCol1)) # grp x #1 1 6.16 #2 1 3.39 #3 1 2.82 #4 2 9.17 #5 2 4.35 </code></pre> <p>Or with 'myCol'</p> <pre><code>df1 ...
arrange_() multiple columns with descending order
r|dplyr
13
12,836
2
38,052,447
38,052,447
13
true
2016-06-27T11:04:18.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: arrange_() multiple columns with descending order<p>I am trying to use <code>arrange_()</code> with string input and in one of the columns in descending orde...
37,879,506
xcode 8 PHPhotoLibrary.requestAuthorization causing crash<p>My app keeps crashing when running in the simulator everytime I try to request authorization for the photo library. I am using the following code in my appDelegate in didFinishLaunchingWithOptions:</p> <pre><code>if PHPhotoLibrary.authorizationStatus() != PH...
<p>In my testing, iOS 10 doesn't like to output useful error messages unless you're running on an actual device. In this particular case, you probably haven't provided the key <code>NSPhotoLibraryUsageDescription</code> in your Info.plist file, and that value must be provided before requesting authorization.</p>
xcode 8 PHPhotoLibrary.requestAuthorization causing crash
swift3|phphotolibrary|xcode8|ios10
11
3,624
2
37,889,273
37,889,273
24
true
2016-06-17T10:39:51.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: xcode 8 PHPhotoLibrary.requestAuthorization causing crash<p>My app keeps crashing when running in the simulator everytime I try to request authorization for ...
37,909,312
RecyclerView inside a ScrollView/NestedScrollView does not scroll properly<p>I have a layout which has a <code>CardView</code> and a <code>FloatingActionButton</code> associated with it. There is a list of replies below the <code>CardView</code> (which is a <code>RecyclerView</code>). Sometimes the <code>CardViews'</co...
<p>When you have multiple scrolling Views in your layout (eg. RecyclerView + ScrollView) and when you scroll while in your recyclerView, the recyclerView scrolls with the parent Scrollview. this causes jitters in RecyclerView. You can avoid this jitter by the following. </p> <p>You can add <br><code>android:nestedScr...
RecyclerView inside a ScrollView/NestedScrollView does not scroll properly
android|android-recyclerview|scrollview
9
19,212
6
37,909,536
37,909,536
25
true
2016-06-19T16:19:33.483Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RecyclerView inside a ScrollView/NestedScrollView does not scroll properly<p>I have a layout which has a <code>CardView</code> and a <code>FloatingActionButt...
37,911,984
How to colorize Elixir iex prompt?<p>Is it possible to add color and other effects to the <a href="http://elixir-lang.org/docs/stable/iex/IEx.html" rel="noreferrer"><code>iex</code></a> prompt? Does <code>iex</code> have a resource file (like <a href="http://ruby-doc.org/stdlib-2.3.0/libdoc/irb/rdoc/IRB.html#module-IRB...
<p>Yes, yes, and yes!</p> <p>To customize your prompt, you'll need several things:</p> <ul> <li>An <code>.iex.exs</code> file in your home directory. Create this file if it doesn't exist. It will be executed when <a href="http://elixir-lang.org/docs/stable/iex/IEx.html" rel="noreferrer"><code>iex</code></a> launches....
How to colorize Elixir iex prompt?
elixir|elixir-iex
12
3,358
1
37,911,985
37,911,985
28
true
2016-06-19T21:24:23.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to colorize Elixir iex prompt?<p>Is it possible to add color and other effects to the <a href="http://elixir-lang.org/docs/stable/iex/IEx.html" rel="nore...
38,025,305
Best practice for error handling with ASP.NET Web API<p>Could you clarify what is the best practice with Web API error management. Actually, I don't know if it is a good practice to use try catch into my Api request.</p> <pre><code>public Vb.Order PostOrderItem(Vb.Order order) { if (OAuth.isValid(Request.Headers.G...
<p>Error handling in Web API is considered a cross-cutting concern and should be placed somewhere else in the pipeline so the developers doesn’t need to focus on cross-cutting concerns.</p> <p>You should take a read of <a href="http://www.asp.net/web-api/overview/error-handling/exception-handling">Exception Handling i...
Best practice for error handling with ASP.NET Web API
c#|asp.net|asp.net-web-api|exception-handling
28
83,982
3
38,032,237
38,032,237
43
true
2016-06-25T05:27:50.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best practice for error handling with ASP.NET Web API<p>Could you clarify what is the best practice with Web API error management. Actually, I don't know if ...
37,893,131
How to convert lat long from decimal degrees to DMS format?<p>Assuming I have a latitude longitude: 38.898556, -77.037852. How do I convert this to DMS?</p> <p>Expected output is: </p> <pre><code>38 53 55 N 77 2 16 W </code></pre> <p>Want to be able to accept both a latitude and longitude as input parameters ...
<pre><code>function toDegreesMinutesAndSeconds(coordinate) { var absolute = Math.abs(coordinate); var degrees = Math.floor(absolute); var minutesNotTruncated = (absolute - degrees) * 60; var minutes = Math.floor(minutesNotTruncated); var seconds = Math.floor((minutesNotTruncated - minutes) * 60); ...
How to convert lat long from decimal degrees to DMS format?
javascript
15
17,188
4
37,893,239
37,893,239
44
true
2016-06-18T04:06:16.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert lat long from decimal degrees to DMS format?<p>Assuming I have a latitude longitude: 38.898556, -77.037852. How do I convert this to DMS?</p> ...
37,952,860
Which version of the .NET Framework is IIS using for my AppPool?<p>.Net Framework 4.5 was installed on my machine and on the IIS Application Pool, I set the .NET CLR version to 4.0.</p> <p>My question is when running .NET code in this IIS site, which framework version is it using: 4.0 or 4.5 ? </p> <p>Please see belo...
<p>The AppPool's .NET CLR Version is different from the .NET Framework Version.</p> <p>The .NET CLR Version 4.0 is the CLR base for the following .NET Framework Versions:</p> <ul> <li>4</li> <li>4.5 (including 4.5.1 and 4.5.2)</li> <li>4.6 (including 4.6.1 and 4.6.2 Preview)</li> </ul> <p>So having a .NET CLR Versio...
Which version of the .NET Framework is IIS using for my AppPool?
.net|frameworks
29
96,008
2
37,953,052
37,953,052
51
true
2016-06-21T19:19:14.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Which version of the .NET Framework is IIS using for my AppPool?<p>.Net Framework 4.5 was installed on my machine and on the IIS Application Pool, I set the ...
37,937,262
Passing props to Vue.js components instantiated by Vue-router<p>Suppose I have a Vue.js component like this:</p> <pre><code>var Bar = Vue.extend({ props: ['my-props'], template: '&lt;p&gt;This is bar!&lt;/p&gt;' }); </code></pre> <p>And I want to use it when some route in vue-router is matched like this:</p> ...
<pre><code>&lt;router-view :some-value-to-pass="localValue"&gt;&lt;/router-view&gt; </code></pre> <p>and in your components just add prop:</p> <pre><code>props: { someValueToPass: String }, </code></pre> <p>vue-router will match prop in component</p>
Passing props to Vue.js components instantiated by Vue-router
vue.js|vue-router
72
105,036
6
37,940,045
37,940,045
91
true
2016-06-21T06:44:37.380Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing props to Vue.js components instantiated by Vue-router<p>Suppose I have a Vue.js component like this:</p> <pre><code>var Bar = Vue.extend({ props...
37,933,922
How to install older version of Typescript?<p>I recently installed Typescript 1.8 and found too many breaking issues. So for the time being I would like to install 1.7. Where can I get a link to down this?</p>
<p>For installing typescript 1.7.5, use</p> <pre><code>npm install typescript@1.7.5 </code></pre>
How to install older version of Typescript?
typescript|typescript1.8
66
122,644
3
37,935,674
37,935,674
109
true
2016-06-21T00:40:06.513Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to install older version of Typescript?<p>I recently installed Typescript 1.8 and found too many breaking issues. So for the time being I would like to i...
37,907,824
Check a folder if it contains anything python3<p>I need code that's able to check a folder in the same directory as the python script if it contains either folders or files this code from <a href="https://stackoverflow.com/questions/25675352/how-to-check-to-see-if-a-folder-contains-files-using-python-3">How to check to...
<p><strong>Working</strong></p> <p>Try this code which uses OSError and aslo os.rmdir never directory which are not empty.So we can use this exception to solve the problem</p> <pre><code>import os dir_name = "DeviceTest" try: os.rmdir(dir_name) except OSError as exception_name: if exception_name.errno == errn...
Check a folder if it contains anything python3
python-3.x|directory
-3
557
2
37,907,868
37,907,868
0
true
2016-06-19T13:37:49.630Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check a folder if it contains anything python3<p>I need code that's able to check a folder in the same directory as the python script if it contains either f...
37,863,801
SparkStreaming, RabbitMQ and MQTT in python using pika<p>Just to make things tricky, I'd like to consume messages from the rabbitMQ queue. Now I know there is a plugin for MQTT on rabbit (<a href="https://www.rabbitmq.com/mqtt.html">https://www.rabbitmq.com/mqtt.html</a>). </p> <p>However I cannot seem to make an exam...
<p>It looks like you are using wrong port number. Assuming that:</p> <ul> <li>you have a local instance of RabbitMQ running with default settings and you've enabled MQTT plugin (<code>rabbitmq-plugins enable rabbitmq_mqtt</code>) and restarted RabbitMQ server</li> <li>included <code>spark-streaming-mqtt</code> when ex...
SparkStreaming, RabbitMQ and MQTT in python using pika
python|apache-spark|rabbitmq|mqtt|pika
15
4,173
2
38,172,737
38,172,737
7
true
2016-06-16T15:46:18.820Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SparkStreaming, RabbitMQ and MQTT in python using pika<p>Just to make things tricky, I'd like to consume messages from the rabbitMQ queue. Now I know there i...
37,955,114
Alert before leaving page (navigate back) with Ionic v2<p>How do you show an <code>alert</code>, that the user must close, before going back to the previous page? I'm using the standard <code>&lt;ion-navbar *navbar&gt;</code> <em>arrow button</em>.</p> <p>I tried hooking into the <code>NavController</code> event <code...
<p><strong>UPDATE</strong></p> <p>As of Ionic2 RC, now we can use <a href="http://ionicframework.com/docs/v2/api/navigation/NavController/#nav-guards" rel="nofollow noreferrer">Nav Guards</a>.</p> <blockquote> <p>In some cases, a developer should be able to control views leaving and entering. To allow for this, N...
Alert before leaving page (navigate back) with Ionic v2
angular|typescript|ionic-framework|ionic2|ionic3
9
17,163
3
37,963,710
37,963,710
9
true
2016-06-21T21:45:51.970Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Alert before leaving page (navigate back) with Ionic v2<p>How do you show an <code>alert</code>, that the user must close, before going back to the previous ...
37,898,567
Azure Service Fabric Explorer returns always 403<p>I just deployed an secured Service Fabric Cluster (EncryptAndSign) with a LoadBalancer to an Azure Subscription. Deployment took some time but it worked as expected. Also I can connect to the cluster via PowerShell:</p> <pre><code>$connectionEndpoint = ("{0}.{1}.cloud...
<p>Okay, this one was not that tricky - but you have to know it and I did not read it anywhere yet. As long as you do not configure any Andmin Client Certificate all your request to the Explorer (:19080/Explorer) end up with an 403 as described above.</p> <p>You can add an Thumbprint of an Admin Client Certificate in ...
Azure Service Fabric Explorer returns always 403
azure|azure-service-fabric
11
9,021
1
37,915,201
37,915,201
14
true
2016-06-18T15:21:16.433Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure Service Fabric Explorer returns always 403<p>I just deployed an secured Service Fabric Cluster (EncryptAndSign) with a LoadBalancer to an Azure Subscri...
37,998,291
Advantage of using IActionResult as result type in Actions<p>What's the advantage or recommendation on using <code>IActionResult</code> as the return type of a WebApi controller instead of the actual type you want to return?</p> <p>Most of the examples I've seen return <code>IActionResult</code>, but when I build my f...
<p>The main advantage is that you can return error/status codes or redirects/resource urls. </p> <p>For example:</p> <pre><code>public IActionResult Get(integer id) { var user = db.Users.Where(u =&gt; u.UserId = id).FirstOrDefault(); if(user == null) { // Returns HttpCode 404 return Not...
Advantage of using IActionResult as result type in Actions
asp.net-core|asp.net-core-mvc
25
20,742
2
37,998,841
37,998,841
21
true
2016-06-23T17:34:21.593Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Advantage of using IActionResult as result type in Actions<p>What's the advantage or recommendation on using <code>IActionResult</code> as the return type of...
37,967,120
ffmpeg convert from H.264 (High 4:4:4 Profile) to H.264 (Main Profile)<p>How can I convert a video from H.264 (High 4:4:4 Profile) to H.264 (Main Profile) using ffmpeg? </p> <p>I can't do that with this command: <code>ffmpeg -i 1/25359.mp4 -profile:v main out.mp4</code>. </p> <p>That'd return an error:</p> <pre><co...
<p>Your source video has full-sized chroma planes - as indicated by the latter two 4s in YUV444P - and main profile doesn't support that format, so you'll have to select a pixel format like YUV 4:2:0</p> <pre><code>ffmpeg -i 1/25359.mp4 -vf "scale=2*trunc(iw/2):-2,setsar=1" -profile:v main -pix_fmt yuv420p out.mp4 </c...
ffmpeg convert from H.264 (High 4:4:4 Profile) to H.264 (Main Profile)
video|ffmpeg|converter|codec
23
28,700
2
37,969,294
37,969,294
47
true
2016-06-22T11:46:20.073Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ffmpeg convert from H.264 (High 4:4:4 Profile) to H.264 (Main Profile)<p>How can I convert a video from H.264 (High 4:4:4 Profile) to H.264 (Main Profile) us...
37,987,193
IntelliJ + Spring Web MVC<p>I have problem with IntelliJ 2016.1.3 and Spring Web MVC integration. Steps I've made:</p> <ol> <li>File -> New -> Project... -> Maven (no archetype)</li> <li>GroupId = test ArtifactId = app</li> <li>Project name = App and Finish.</li> <li>I added to pom.xml &lt; packaging > war &lt; /packa...
<p>If you have configured everything the right way, you should have a +-Sign at the upper right of your deployment-tab. After pressing it, you should be offered a tooltip with 1-2 options:</p> <ul> <li>Artifact...</li> <li>External Source...</li> </ul> <p>You usually would select the deployment artifact of your curre...
IntelliJ + Spring Web MVC
java|spring|maven|spring-mvc|intellij-idea
16
11,817
3
37,987,834
37,987,834
5
true
2016-06-23T09:12:46.813Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IntelliJ + Spring Web MVC<p>I have problem with IntelliJ 2016.1.3 and Spring Web MVC integration. Steps I've made:</p> <ol> <li>File -> New -> Project... ->...
37,856,122
Microsoft Azure,Webjob, in which timezone a webjob runs if I schedule a webjob to run daily at specified time using cron expression<p>I scheduled a webjob to run daily at 2 am using cron expression (0 0 2 * * *) following tutorial from <a href="https://azure.microsoft.com/en-in/documentation/articles/web-sites-create-w...
<p>Based on the comments mentioned <a href="http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/" rel="noreferrer"><code>here</code></a>, WebJobs run into the timezone configured for the WebApp where your WebJob is hosted. From this post:</p> <p><a href="https://i.stack.imgur.com/Ukik5.png" rel="noreferrer...
Microsoft Azure,Webjob, in which timezone a webjob runs if I schedule a webjob to run daily at specified time using cron expression
azure|azure-webjobs
14
7,461
2
37,856,365
37,856,365
20
true
2016-06-16T10:08:44.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Microsoft Azure,Webjob, in which timezone a webjob runs if I schedule a webjob to run daily at specified time using cron expression<p>I scheduled a webjob to...
38,047,053
How to add link parameter to asp tag helpers in ASP.NET Core MVC<p>I have a lot of experience with <em>ASP.NET MVC 1-5</em>. Now I learn <em>ASP.NET Core MVC</em> and have to pass a parameter to link in page. For example I have the following <em>Action</em></p> <pre><code> [HttpGet] public ActionResult GetProduct(str...
<p>You can use the attribute prefix <code>asp-route-</code> to prefix your route variable names.</p> <p>Example: </p> <pre class="lang-html prettyprint-override"><code>&lt;a asp-controller="Product" asp-action="GetProduct" asp-route-id="10"&gt; ProductName&lt;/a&gt; </code></pre>
How to add link parameter to asp tag helpers in ASP.NET Core MVC
c#|asp.net-core|asp.net-core-mvc|url-parameters|tag-helpers
153
117,817
4
38,047,095
38,047,095
279
true
2016-06-27T06:19:02.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add link parameter to asp tag helpers in ASP.NET Core MVC<p>I have a lot of experience with <em>ASP.NET MVC 1-5</em>. Now I learn <em>ASP.NET Core MVC...
37,986,640
Cannot obtain a mutable reference when iterating a recursive structure: cannot borrow as mutable more than once at a time<p>I'm trying to navigate a recursive data structure iteratively in order to insert elements at a certain position. To my limited understanding, this means taking a mutable reference to the root of t...
<p>It is possible... but I wish I had a more elegant solution.</p> <p>The trick is NOT to borrow from <code>anchor</code>, and therefore to juggle between two accumulators:</p> <ul> <li>one holding the reference to the current node</li> <li>the other being assigned the reference to the next node</li> </ul> <p>This l...
Cannot obtain a mutable reference when iterating a recursive structure: cannot borrow as mutable more than once at a time
rust|mutable|borrowing
26
4,658
4
37,987,197
37,987,197
26
true
2016-06-23T08:50:54.063Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot obtain a mutable reference when iterating a recursive structure: cannot borrow as mutable more than once at a time<p>I'm trying to navigate a recursiv...
37,839,365
Simple HTTP/TCP health check for MongoDB<p>I need to create a Health Check for a MongoDB instance inside a Docker container.</p> <p>Although I can make a workaround and use the Mongo Ping using the CLI, the best option is to create a simple HTTP or TCP testing. There is no response in the default 27017 port in standar...
<p>I've created a simple health check for mongodb, it uses the <code>mongo</code> client to send a simple query request (eg. <code>db.stats()</code>) to the server.</p> <pre><code>$ mongo 192.168.5.51:30000/test MongoDB shell version: 3.2.3 connecting to: 192.168.5.51:30000/test mongos&gt; db.stats() { &quot;raw&...
Simple HTTP/TCP health check for MongoDB
mongodb|http|tcp
30
38,694
3
37,852,368
37,852,368
36
true
2016-06-15T15:13:13.543Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Simple HTTP/TCP health check for MongoDB<p>I need to create a Health Check for a MongoDB instance inside a Docker container.</p> <p>Although I can make a wo...
37,902,441
What does event.waitUntil do in service worker and why is it needed?<p>MDN suggests that you do the following to create and populate service worker cache:</p> <pre><code>this.addEventListener('install', function(event) { event.waitUntil( caches.open('v1').then(function(cache) { return cache.addAll([ ...
<p>As the description says:</p> <blockquote> <p>the <code>ExtendableEvent.waitUntil()</code> method extends the lifetime of the event.</p> </blockquote> <p>If you don't call it inside a method, the service worker could be stopped at any time (see <a href="https://www.w3.org/TR/service-workers/#service-worker-lifetime" ...
What does event.waitUntil do in service worker and why is it needed?
javascript|promise|dom-events|service-worker
57
23,355
1
37,906,330
37,906,330
51
true
2016-06-18T23:07:58.340Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does event.waitUntil do in service worker and why is it needed?<p>MDN suggests that you do the following to create and populate service worker cache:</p...
37,922,967
Exclude some properties in comparison using isEqual() of lodash<p>I am using <a href="https://lodash.com/docs#isEqual" rel="noreferrer">_.isEqual</a> that compares 2 array of objects (ex:10 properties each object), and it is working fine. </p> <p>Now there are 2 properties (creation and deletion) that i need not to be...
<p>You can use <a href="https://lodash.com/docs#omit">omit()</a> to remove specific properties in an object.</p> <pre><code>var result = _.isEqual( _.omit(obj1, ['creation', 'deletion']), _.omit(obj2, ['creation', 'deletion']) ); </code></pre> <p><div class="snippet" data-lang="js" data-hide="true" data-console="...
Exclude some properties in comparison using isEqual() of lodash
javascript|lodash
45
35,855
6
37,934,915
37,934,915
108
true
2016-06-20T12:46:17.873Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Exclude some properties in comparison using isEqual() of lodash<p>I am using <a href="https://lodash.com/docs#isEqual" rel="noreferrer">_.isEqual</a> that co...
37,873,608
How do I detect if a user is already logged in Firebase?<p>I'm using the firebase node api in my javascript files for Google login. </p> <pre><code>firebase.initializeApp(config); let provider = new firebase.auth.GoogleAuthProvider(); firebase.auth().signInWithPopup(provider); </code></pre> <p>This works fine and the...
<p><a href="https://firebase.google.com/docs/auth/web/manage-users">https://firebase.google.com/docs/auth/web/manage-users</a></p> <p>You have to add an auth state change observer.</p> <pre><code>firebase.auth().onAuthStateChanged(function(user) { if (user) { // User is signed in. } else { // No user is s...
How do I detect if a user is already logged in Firebase?
javascript|firebase|firebase-authentication
144
177,172
12
37,886,999
37,886,999
171
true
2016-06-17T05:16:30.397Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I detect if a user is already logged in Firebase?<p>I'm using the firebase node api in my javascript files for Google login. </p> <pre><code>firebase...
37,792,333
How can I use Firebase cloud message in an eclipse project?<p>I have a project in eclipse. I need include <a href="https://console.firebase.google.com/" rel="noreferrer">firebase</a> library. If I was using Android Studio the steps would simply be:</p> <p><a href="https://i.stack.imgur.com/CzQgu.png" rel="noreferrer">...
<p>The new Firebase (9xx) libraries can be found in the Google Repository. You can install this with the Eclipse Android SDK Manager. Open the SDK manager and scroll down until you find Google Repository and install the package. </p> <p>The package will be installed in /extras/google/m2repository and you will find ...
How can I use Firebase cloud message in an eclipse project?
java|android|eclipse|firebase|firebase-cloud-messaging
7
18,739
5
37,891,421
37,891,421
9
true
2016-06-13T14:27:22.997Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I use Firebase cloud message in an eclipse project?<p>I have a project in eclipse. I need include <a href="https://console.firebase.google.com/" rel=...
38,051,143
No broadcasting for tf.matmul in TensorFlow<p>I have a problem with which I've been struggling. It is related to <code>tf.matmul()</code> and its absence of broadcasting.</p> <p>I am aware of a similar issue on <a href="https://github.com/tensorflow/tensorflow/issues/216">https://github.com/tensorflow/tensorflow/issue...
<p>You could achieve that by reshaping <code>X</code> to shape <code>[n, d]</code>, where <code>d</code> is the dimensionality of one single "instance" of computation (100 in your example) and <code>n</code> is the number of those instances in your multi-dimensional object (<code>5*10*4=200</code> in your example). Aft...
No broadcasting for tf.matmul in TensorFlow
tensorflow|broadcasting
12
7,999
2
38,056,381
38,056,381
9
true
2016-06-27T10:06:24.030Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: No broadcasting for tf.matmul in TensorFlow<p>I have a problem with which I've been struggling. It is related to <code>tf.matmul()</code> and its absence of ...