id
int64
4
73.8M
title
stringlengths
10
150
body
stringlengths
17
50.8k
accepted_answer_id
int64
7
73.8M
answer_count
int64
1
182
comment_count
int64
0
89
community_owned_date
stringlengths
23
27
creation_date
stringlengths
23
27
favorite_count
int64
0
11.6k
last_activity_date
stringlengths
23
27
last_edit_date
stringlengths
23
27
last_editor_display_name
stringlengths
2
29
last_editor_user_id
int64
-1
20M
owner_display_name
stringlengths
1
29
owner_user_id
int64
1
20M
parent_id
null
post_type_id
int64
1
1
score
int64
-146
26.6k
tags
stringlengths
1
125
view_count
int64
122
11.6M
answer_body
stringlengths
19
51k
43,317,026
Kotlin- naming convention for boolean returning methods
<p>What is the naming convention for boolean returning methods?</p> <p>Using an 'is', 'has', 'should', 'can' in the front of method sound ok for some cases, but I'm not sure. Is there a better way to name such methods? for example: a function that checks card's validation. Should I call it <code>isValidCard</code> or ...
43,317,781
3
0
null
2017-04-10 07:20:05.243 UTC
3
2019-12-11 19:59:56.903 UTC
2019-12-11 19:59:56.903 UTC
null
4,774,054
null
5,188,979
null
1
29
naming-conventions|kotlin
10,878
<p>Kotlin naming style assumes you use the Java naming conventions to the possible extend. I suggest you use <a href="https://stackoverflow.com/a/3874378/3144601">this answer</a> to the same question about Java.</p> <p>UPDATE: they have released coding conventions <a href="http://kotlinlang.org/docs/reference/coding-...
2,342,935
How to schedule a stored procedure?
<p>How do I schedule a stored procedure in Sql Server 2005 that it runs once at the start of every month (and on database startup)?</p>
2,342,947
2
0
null
2010-02-26 16:07:39.397 UTC
6
2018-04-30 15:32:23.833 UTC
2010-03-06 04:55:56.033 UTC
null
164,901
null
155,077
null
1
22
sql|sql-server|stored-procedures|scheduled-tasks
104,299
<p>You will need to <a href="http://msdn.microsoft.com/en-us/library/ms186273.aspx" rel="noreferrer">create a job</a> using the <a href="http://msdn.microsoft.com/en-us/library/ms189237.aspx" rel="noreferrer">SQL Server Agent</a>.</p>
2,873,899
Javascript in UIWebView callback to C/Objective-C
<p>Is there a way to get a callback to objective-c when a certain event has been detected in a UIWebView? Can Javascript send a callback to Objective-C?</p>
2,873,952
2
0
null
2010-05-20 13:01:43.79 UTC
17
2015-06-29 14:04:42.527 UTC
2012-08-10 18:14:02.867 UTC
null
1,105,514
null
56,380
null
1
35
javascript|objective-c|ios|cocoa-touch|uiwebview
26,986
<p>Update - don't use UIWebView anymore. Use WKWebView, or better yet (if it fits your needs and you're building for iOS 9), a Safari View Controller.</p> <p>But if you must use UIWebView, in your UIWebView delegate, provide an implementation for <a href="http://developer.apple.com/iphone/library/documentation/uikit/r...
42,228,653
Exoplayer adaptive hls streaming
<p>I am looking for good and simple example/explanation how to implement <code>ExoPlayer</code> for <code>HLS Adaptive</code> streaming. I am a newbie and do not have experience and knowledge so I can figure how to do this from code example on git.</p> <p>There are too many 'moving parts' so beginner can understand an...
42,362,368
2
0
null
2017-02-14 14:25:37.957 UTC
8
2018-08-06 23:13:48.637 UTC
2017-02-14 14:57:24.387 UTC
null
6,340,602
null
4,011,802
null
1
11
android|http-live-streaming|exoplayer|adaptive-bitrate
16,756
<p>The easiest way to get started using ExoPlayer is to add it as a gradle dependency. You need to make sure you have the jcenter repository included in the <strong>build.gradle</strong> file in the root of your project:</p> <p><code>repositories { jcenter() }</code></p> <p>Next, include the following in your mod...
18,163,821
Excel - return "true" if a value exists in both columns
<p>I have two columns of data. column A and column B. in the third column (C) I want to type a formula that will return "true" if a data in column B exists anywhere in column A. Just this :) Thank you in advance. </p>
18,163,969
1
0
null
2013-08-10 16:14:26.027 UTC
4
2018-01-18 02:26:49.233 UTC
2013-08-10 16:42:55.727 UTC
null
2,207,117
null
2,207,117
null
1
6
excel|compare|lookup
64,843
<p><strong>Try This:</strong></p> <pre><code>=NOT(ISNA(VLOOKUP(B1,A:A,1,0))) </code></pre> <p>Assuming you are starting in cell C1.</p> <p>VLOOKUP returns the value of B1 in the column A, or #N/A if it's not found. ISNA will return TRUE if no value is found, or FALSE if it is, finally NOT negates the result such tha...
2,503,234
sql server ports 445 and 1433
<p>What is the difference between sql server ports 445 and 1433 and what is each port intended for?</p>
2,503,284
3
0
null
2010-03-23 20:09:27.75 UTC
null
2014-04-02 18:45:58.887 UTC
2014-04-02 18:45:58.887 UTC
null
467,079
null
289,877
null
1
6
sql-server|sql-server-2005
46,177
<p>445 is not a SQL port, is a SMB port. It is involved in SQL Server only if you use named pipes protocol, as named pipes are over SMB and this in turn uses 445 for '<a href="http://support.microsoft.com/kb/204279" rel="noreferrer">SMB over IP</a>', aka. as SMB 'NETBIOSless' as opposed to the old NetBIOS based SMB, wh...
7,311,415
How is the complexity of bucket sort is O(n+k) if we implement buckets using linked lists?
<p>I am curious about why bucket sort has a runtime of O(n + k) if we use buckets implemented with linked lists. For example, suppose that we have this input:</p> <pre><code>n = no of element= 8 k = range = 3 array = 2,2,1,1,1,3,1,3 </code></pre> <p>The buckets will look like this:</p> <pre><code>1: 1 -&gt; 1 -&gt...
7,341,355
1
5
null
2011-09-05 18:05:44.203 UTC
23
2015-11-16 13:28:22.893 UTC
2013-05-09 15:55:44.933 UTC
null
501,557
null
323,422
null
1
24
algorithm|sorting|data-structures|big-o
34,817
<p>Your analysis is <em>almost</em> correct, but there's an important detail that you're missing.</p> <p>Right now, you are correct that iterating across the input array to distribute the elements into buckets takes time O(n). However, you are slightly off when you say that the total amount of time required to assemb...
22,580,623
Is [CallerMemberName] slow compared to alternatives when implementing INotifyPropertyChanged?
<p>There are good articles that suggest <a href="http://blog.amusedia.com/2013/06/inotifypropertychanged-implementation.html" rel="noreferrer">different ways for implementing <code>INotifyPropertyChanged</code></a>.</p> <p>Consider the following basic implementation:</p> <pre><code>class BasicClass : INotifyPropertyC...
22,580,624
1
0
null
2014-03-22 16:55:44.403 UTC
24
2017-07-27 22:10:48.963 UTC
2016-12-14 00:52:51.833 UTC
null
2,157,640
null
218,873
null
1
114
c#|inotifypropertychanged|callermembername
34,226
<p>No, <strong>the use of <code>[CallerMemberName]</code> is not slower</strong> than the upper basic implementation.</p> <p>This is because, according to <a href="https://msdn.microsoft.com/en-us/library/hh534540(v=vs.110).aspx" rel="noreferrer">this MSDN page</a>, </p> <blockquote> <p>Caller Info values are emitt...
38,916,912
How to decode JWT (Header and Body) in java using Apache Commons Codec?
<p>I am looking decode the following <code>JWT</code> using <code>Apache Commons Codec</code>. How we can do that ?</p> <pre><code> eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0Iiwicm9sZXMiOiJST0xFX0FETUlOIiwiaXNzIjoibXlzZ WxmIiwiZXhwIjoxNDcxMDg2MzgxfQ.1EI2haSz9aMsHjFUXNVz2Z4mtC0nMdZo6bo3-x-aRpw </code></pre> <p>This shou...
38,916,927
2
0
null
2016-08-12 11:29:07.22 UTC
14
2020-02-03 14:16:38.767 UTC
2018-02-28 22:26:12.533 UTC
null
3,124,333
user4821194
null
null
1
30
apache|jwt|apache-commons-codec
70,187
<p>Here you go:</p> <pre><code>import org.apache.commons.codec.binary.Base64; @Test public void testDecodeJWT(){ String jwtToken = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0Iiwicm9sZXMiOiJST0xFX0FETUlOIiwiaXNzIjoibXlzZWxmIiwiZXhwIjoxNDcxMDg2MzgxfQ.1EI2haSz9aMsHjFUXNVz2Z4mtC0nMdZo6bo3-x-aRpw"; System.ou...
31,675,192
Not able to start Sonar Server
<p>I am using Sonar to generate code review reports of my project. But I am not able to start the server. I am getting </p> <blockquote> <p>HeapDumpOnOutOfMemoryError</p> </blockquote> <p>while running </p> <blockquote> <p>StartSonar.bat</p> </blockquote> <p>file.</p> <p>Please find the logs generated while so...
31,693,357
7
0
null
2015-07-28 11:37:08.697 UTC
3
2022-07-19 08:19:00.847 UTC
null
null
null
null
546,888
null
1
12
sonarqube-4.5
56,921
<p>I got the solution from sonar log files itself. You can find server start up logs in the sonar.log file under directory "sonarqube-4.5\logs". </p> <p>I was not able to start the server due to following port binding exception :</p> <pre><code>2015.07.29 02:46:36 ERROR web[o.a.c.h.Http11Protocol] Failed to initia...
48,560,072
How to add vertical scrollbar to select box options list?
<p>I need vertical scrollbar for select box options list. I have to show only first few items of the list. I don't have any control over number of items in the list. </p> <p>I have checked all similar questions here and nothing worked out. Anyway to do that?</p> <p><div class="snippet" data-lang="js" data-hide="false...
48,560,262
4
0
null
2018-02-01 10:07:11.587 UTC
6
2022-08-05 08:52:20.207 UTC
2020-04-22 09:14:05.657 UTC
null
8,565,438
null
6,603,094
null
1
11
javascript|jquery|css|html|twitter-bootstrap
58,130
<p><code>Overflow-y</code> doesn't work on select boxes. What I would recommend using is <code>size</code> on your select box. In my example I've used 5 as the value, you can obviously change this to your liking.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div...
50,571,316
Strange variable scoping behavior in Jenkinsfile
<p>When I run the below Jenkins pipeline script:</p> <pre><code>def some_var = "some value" def pr() { def another_var = "another " + some_var echo "${another_var}" } pipeline { agent any stages { stage ("Run") { steps { pr() } } } } </code...
50,573,082
2
0
null
2018-05-28 17:44:25.263 UTC
21
2019-11-20 14:07:04.157 UTC
2019-11-20 14:07:04.157 UTC
null
95,750
null
95,750
null
1
43
jenkins|groovy|jenkins-pipeline|jenkins-groovy|groovyshell
21,257
<h2>TL;DR</h2> <ul> <li>variables defined <strong>with</strong> <code>def</code> in the main script body cannot be accessed from other methods.</li> <li>variables defined <strong>without</strong> <code>def</code> can be accessed directly by any method even from different scripts. It's a bad practice.</li> <li>variable...
36,239,903
What's the difference between Remove and Exclude when refactoring with PyCharm?
<p>The <a href="https://www.jetbrains.com/help/pycharm/2016.1/refactoring-source-code.html?origin=old_help" rel="noreferrer">official PyCharm docs</a> explain <code>Exclude</code> when it comes to refactoring: One can, say, rename something with refactoring (Shift+F6), causing the Find window to pop up with a Preview....
48,336,566
1
0
null
2016-03-26 19:29:55.693 UTC
2
2019-02-15 12:24:16.383 UTC
null
null
null
null
682,515
null
1
33
refactoring|pycharm
1,341
<p>Final effect is the same - entry which was <code>Removed</code> or <code>Excluded</code> won't be refactored, the difference is in presentation. After selecting <code>Exclude</code> you keep entry in the <code>Refactoring Preview</code>, but <code>Remove</code> deletes it from that window.</p> <p>I think that <code...
34,457,568
How to show options in telegram bot?
<p>I want to write a bot telegram.How to put possible option in my bot.I insert a picture of sample bot with this functionality.<br><br><a href="https://i.stack.imgur.com/PPlQ0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/PPlQ0.png" alt="enter image description here"></a></p>
34,458,436
4
0
null
2015-12-24 20:21:08.723 UTC
11
2022-08-13 19:47:55.787 UTC
null
null
null
null
3,733,985
null
1
39
telegram-bot
77,652
<p>For that, you have to talk to BotFather.</p> <ol> <li><p>In the Telegram App, open the chat with BotFather.</p> </li> <li><p>Send him <code>/setcommands</code>. He will present you with a list of your bots.</p> </li> <li><p>Pick the bot for which you want to set the command menu.</p> </li> <li><p>Compose and send th...
29,742,847
jenkins trigger build if new tag is released
<p>I want to configure jenkins so that it starts building if a new tag is released in any branch of an git repository. How do I configure this behaviour?</p> <p><img src="https://i.stack.imgur.com/w7jhD.png" alt="git jenkins config" /></p> <p>Triggering: <img src="https://i.stack.imgur.com/2LXTk.png" alt="build trigger...
29,743,054
8
0
null
2015-04-20 08:34:39.63 UTC
21
2022-04-14 17:21:51.037 UTC
2021-03-08 09:41:02.043 UTC
null
4,298,200
null
1,771,213
null
1
68
git|jenkins|tags
77,389
<p>What do you mean by new tag? Does it has some template name?</p> <p>You can surely define it in <strong>Advanced</strong> --> <strong>Refspec</strong> --><code>refs/tags/{tagname}</code> .</p> <p>You can even do <code>refs/tags/*</code> for finding really ANY new tags.</p> <p><img src="https://i.stack.imgur.com/6...
52,437,946
Start motion scene programmatically
<p>I have a motion layout with this layoutDescription: <code>app:layoutDescription="@xml/scene"</code></p> <p><strong>scene.xml</strong></p> <pre><code>&lt;MotionScene xmlns:motion="http://schemas.android.com/apk/res-auto"&gt; &lt;Transition motion:constraintSetStart="@layout/view_home_card_start" ...
52,474,529
8
0
null
2018-09-21 06:36:42.7 UTC
6
2022-09-11 17:13:41.697 UTC
2019-01-31 14:00:49.193 UTC
null
3,383,038
null
3,994,630
null
1
52
android|android-motionlayout
25,393
<p>Finally Im doing this:</p> <pre><code>((MotionLayout)findViewById(R.id.motionLayout)).transitionToEnd(); ((MotionLayout)findViewById(R.id.motionLayout)).transitionToStart(); </code></pre>
31,926,315
Why do people like to pair CLEAR_TOP and SINGLE_TOP in android
<p>The flag <code>FLAG_ACTIVITY_CLEAR_TOP</code> finds the task containing activity X and clears the top to bring X to its resume state. The flag <code>FLAG_ACTIVITY_SINGLE_TOP</code>, would only keep a single instance of X at the top. Therefore, I should never need to include <code>SINGLE_TOP</code> if I am already us...
31,926,916
1
0
null
2015-08-10 18:11:47.363 UTC
8
2015-08-10 18:46:15.433 UTC
null
null
null
null
2,187,407
null
1
18
android|android-intent|android-activity
3,364
<p>The behaviour of <code>CLEAR_TOP</code> is different, depending on whether or not the Activity is a <code>singleTop</code> activity or the flag <code>SINGLE_TOP</code> is also provided.</p> <p>Let's first assume that the Activity has a standard launch mode (not <code>singleTop</code>). If you use the <code>CLEAR_TO...
22,909,227
How can add space\margin between two elements in iTextSharp\iText?
<p>I am pretty new in <strong>iTextSharpt</strong> (the <strong>iText</strong> porting for C#) and I have the following doubt.</p> <p>In my code I have something like it:</p> <pre><code>iTextSharp.text.Paragraph titolo = new iTextSharp.text.Paragraph(currentVuln.Title, _fontTitolo0); titolo.Alignment = iTextSharp.tex...
22,913,609
2
0
null
2014-04-07 10:02:00.61 UTC
4
2020-10-22 09:49:29.387 UTC
null
null
null
null
1,833,945
null
1
25
c#|asp.net|.net|itextsharp|itext
48,388
<p>You have a couple of different options. You could set the <code>SpacingAfter</code> on your paragraph:</p> <pre><code>titolo.SpacingAfter = 20; </code></pre> <p>You could also set the <code>SpacingBefore</code> on the table:</p> <pre><code>table.SpacingBefore = 20; </code></pre> <p>Or you could just add some ret...
22,792,848
Pretty print JSON python
<p>if anybody with some knowledge about pretty printing JSON could help me with this I would be extremely grateful!</p> <p>I'm looking to convert a complex python string into JSON format, using the function below to move the JSON string to a file:</p> <pre><code>with open('data.txt', 'wt') as out: pprint(string, ...
22,792,883
1
0
null
2014-04-01 17:32:36.643 UTC
8
2014-10-28 08:34:23.497 UTC
2014-04-02 08:17:59.33 UTC
null
2,716,029
null
2,716,029
null
1
14
python|json|string|google-visualization|pprint
32,620
<p>You are writing <em>Python representations</em>, not JSON.</p> <p>Use the <a href="https://docs.python.org/2/library/json.html#json.dump"><code>json.dump()</code> function</a> to write pretty-printed JSON instead, directly to your file:</p> <pre><code>with open('data.txt', 'wt') as out: res = json.dump(obj, ou...
40,599,512
How to achieve behavior of setTimeout in Elm
<p>I'm writing a web game in Elm with lot of time-dependent events and I'm looking for a way to schedule an event at a specific time delay.</p> <p>In JavaScript I used <code>setTimeout(f, timeout)</code>, which obviously worked very well, but - for various reasons - I want to avoid JavaScript code and use Elm alone. <...
40,600,653
4
2
null
2016-11-14 23:22:29.317 UTC
7
2022-04-04 19:33:32.03 UTC
null
null
null
null
2,671,214
null
1
30
elm
7,516
<p>One thing that may not be obvious at first is the fact that subscriptions can change based on the model. They are effectively evaluated after every update. You can use this fact, coupled with some fields in your model, to control what subscriptions are active at any time.</p> <p>Here is an example that allows for a...
39,354,566
What is the equivalent of np.std() in TensorFlow?
<p>Just looking for the equivalent of np.std() in TensorFlow to calculate the standard deviation of a tensor.</p>
39,354,802
2
0
null
2016-09-06 17:19:49.593 UTC
1
2017-07-04 18:50:37.197 UTC
null
null
null
null
4,962,207
null
1
29
python|tensorflow
21,862
<p>To get the mean and variance just use <code>tf.nn.moments</code>.</p> <pre><code>mean, var = tf.nn.moments(x, axes=[1]) </code></pre> <p>For more on <code>tf.nn.moments</code> params see <a href="https://www.tensorflow.org/api_docs/python/tf/nn/moments" rel="noreferrer">docs</a></p>
2,639,430
Graphing perpendicular offsets in a least squares regression plot in R
<p>I'm interested in making a plot with a least squares regression line and line segments connecting the datapoints to the regression line as illustrated here in the graphic called perpendicular offsets: <a href="http://mathworld.wolfram.com/LeastSquaresFitting.html" rel="nofollow noreferrer">http://mathworld.wolfram.c...
2,640,087
1
0
null
2010-04-14 17:07:45.077 UTC
14
2019-07-23 01:22:24.713 UTC
2019-07-23 01:22:24.713 UTC
null
4,751,173
null
255,312
null
1
16
r|statistics|plot|linear-regression|least-squares
2,481
<p>You first need to figure out the coordinates for the base of the perpendicular segments, then call the <code>segments</code> function which can take vectors of coordinates as inputs (no need for a loop).</p> <pre><code>perp.segment.coord &lt;- function(x0, y0, lm.mod){ #finds endpoint for a perpendicular segment f...
50,776,647
Android - Best Practices for ViewModel State in MVVM?
<p>I am working on an Android App using the MVVM pattern along LiveData (possibly Transformations) and DataBinding between View and ViewModel. Since the app is "growing", now ViewModels contain lots of data, and most of the latter are kept as LiveData to have Views subscribe to them (of course, this data is needed for ...
51,002,027
2
0
null
2018-06-09 17:05:40.477 UTC
31
2020-02-09 20:19:33.387 UTC
2018-06-12 10:49:52.477 UTC
null
9,918,581
null
9,918,581
null
1
30
android|mvvm|state|viewmodel
22,876
<p>I struggled with the same problem at work and can share what is working for us. We're developing 100% in Kotlin so the following code samples will be as well.</p> <h2>UI state</h2> <p>To prevent the <code>ViewModel</code> from getting bloated with lots of <code>LiveData</code> properties, expose a single <code>Vie...
38,536,571
What is the difference between enum struct and enum class?
<p>Looking at the <a href="http://en.cppreference.com/w/cpp/language/enum" rel="noreferrer"><code>enum</code> documentation</a>, there was one thing that I noticed:</p> <blockquote> <p><em><strong>enum-key</strong></em> - one of <code>enum</code>, <code>enum class</code>(since C++11), or <code>enum struct</code>(since ...
38,536,583
2
1
null
2016-07-22 23:26:19.09 UTC
5
2019-03-04 15:19:37.61 UTC
2020-06-20 09:12:55.06 UTC
null
-1
null
3,980,929
null
1
39
c++|c++11|enums
18,892
<p><code>enum class</code> and <code>enum struct</code> are the same (emphasis mine).</p> <blockquote> <p><strong>7.2 Enumeration declarations</strong><br>...<br> <sup>2</sup> .... The <em>enum-keys</em> <code>enum class</code> and <code>enum struct</code> are <strong><em>semantically equivalent</em></strong>; a...
42,119,750
What is the difference between strings and characters in Matlab?
<p>What is the difference between string and character class in MATLAB?</p> <pre><code>a = 'AX'; % This is a character. b = string(a) % This is a string. </code></pre>
42,120,091
4
0
null
2017-02-08 17:26:09.127 UTC
8
2020-03-01 15:28:39.873 UTC
2018-02-27 16:49:48.023 UTC
null
3,924,118
null
2,991,243
null
1
15
string|matlab|char
14,442
<p>The <a href="https://www.mathworks.com/help/matlab/matlab_prog/represent-text-with-character-and-string-arrays.html" rel="nofollow noreferrer">documentation suggests</a>:</p> <blockquote> <p>There are two ways to represent text in MATLAB®. You can store text in character arrays. A typical use is to store short pi...
42,094,180
SpaCy: how to load Google news word2vec vectors?
<p>I've tried several methods of loading the google news word2vec vectors (<a href="https://code.google.com/archive/p/word2vec/" rel="noreferrer">https://code.google.com/archive/p/word2vec/</a>):</p> <pre><code>en_nlp = spacy.load('en',vector=False) en_nlp.vocab.load_vectors_from_bin_loc('GoogleNews-vectors-negative30...
42,115,356
4
0
null
2017-02-07 15:50:16.633 UTC
9
2019-05-13 17:26:27.823 UTC
2019-05-13 17:26:27.823 UTC
null
1,165,181
null
815,315
null
1
23
python|nlp|word2vec|spacy
17,770
<p>For spacy 1.x, load Google news vectors into gensim and convert to a new format (each line in .txt contains a single vector: string, vec):</p> <pre><code>from gensim.models.word2vec import Word2Vec from gensim.models import KeyedVectors model = KeyedVectors.load_word2vec_format('GoogleNews-vectors-negative300.bin',...
35,390,835
Is comparison of const_iterator with iterator well-defined?
<p>Consider the following code:</p> <pre><code>#include &lt;vector&gt; #include &lt;iostream&gt; int main() { std::vector&lt;int&gt; vec{1,2,3,5}; for(auto it=vec.cbegin();it!=vec.cend();++it) { std::cout &lt;&lt; *it; // A typo: end instead of cend if(next(it)!=vec.end()) std::cou...
35,392,987
3
0
null
2016-02-14 10:43:57.097 UTC
5
2016-02-14 15:13:08.89 UTC
null
null
null
null
673,852
null
1
35
c++|iterator|comparison-operators|const-iterator
4,147
<p>Surprisingly, C++98 and C++11 didn't say that you can compare a <code>iterator</code> with a <code>const_iterator</code>. This leads to <a href="http://cplusplus.github.io/LWG/lwg-defects.html#179">LWG issue 179</a> and <a href="http://cplusplus.github.io/LWG/lwg-defects.html#2263">LWG issue 2263</a>. Now in C++14, ...
25,099,668
PG::UndefinedTable: ERROR: missing FROM-clause entry for table when using joins and where
<p>I have two models, <code>Courier</code> and <code>Order</code>. </p> <p>I have the following query below:</p> <pre><code>active_couriers = Courier. available_courier_status. where(:service_region_id =&gt; @service_region.id). includes(:orders) </code></pre> <p>This query works, however, it pulls in all orde...
25,099,818
3
0
null
2014-08-02 21:41:36.503 UTC
14
2019-10-30 12:59:48.74 UTC
2017-06-15 16:07:48.777 UTC
null
302,246
null
1,154,722
null
1
58
ruby-on-rails|ruby-on-rails-4|psql
56,141
<p>Hmm it looks like you're trying to include <code>current_orders</code> and include <code>order</code>. Are these the same tables with different conditions? This might be confuse active record. Also, I'm pretty sure it's wise to include the <code>references</code> method when referencing a joined table. Perhaps, try ...
25,662,723
Phabricator restrict git push
<p>I want my team including myself to review commits of each other. None of commits should be pushed including mine into repo until it's not audited by other team member. I kind of lost in phabricator documentation, so i'm asking here, is there any way to setup that kind of workflow?</p>
25,667,786
2
0
null
2014-09-04 10:08:23.877 UTC
9
2014-09-04 14:26:16.543 UTC
null
null
null
null
1,121,521
null
1
16
phabricator
6,961
<p>You can only restrict pushes to repositories hosted by Phabricator. If your repository is hosted elsewhere (like GitHub), Phabricator obviously can't prevent users from pushing to it.</p> <p>To restrict pushes, create a new Herald rule (in the Herald application), like this:</p> <ul> <li>Create a new "Commit Hook:...
43,445,975
What is a cluster in MongoDB?
<p>I am someone new to mongoDB and has absolutely no knowledge regarding databases so would like to know what is a cluster in MongoDB and what is the point of connecting to one in MongoDB? Is it a must to connect to one or can we just connect to the localhost?</p>
43,447,558
3
0
null
2017-04-17 06:02:00.297 UTC
17
2020-06-04 01:12:13.05 UTC
null
null
null
null
7,876,941
null
1
79
mongodb
56,923
<p>A mongodb cluster is the word usually used for <strong>sharded cluster</strong> in mongodb. The main purposes of a sharded mongodb are:</p> <ul> <li>Scale reads and writes along several nodes</li> <li>Each node does not handle the whole data so you can separate data along all the nodes of the shard. Each node is a ...
43,321,026
Can I define multiple agent labels in a declarative Jenkins Pipeline?
<p>I'm using <a href="https://jenkins.io/doc/book/pipeline/syntax/#declarative-pipeline" rel="noreferrer">declarative Jenkins pipelines</a> to run some of my build pipelines and was wondering if it is possible to define multiple agent labels.</p> <p>I have a number of build agents hooked up to my Jenkins and would lik...
43,372,100
5
0
null
2017-04-10 10:39:39.793 UTC
10
2022-07-19 07:53:27.23 UTC
2017-05-24 16:20:23.377 UTC
null
1,000,551
null
6,571,352
null
1
56
jenkins|groovy|jenkins-pipeline
80,488
<p>You can see the 'Pipeline-syntax' help within your Jenkins installation and see the sample step "node" reference. </p> <p>You can use <code>exprA||exprB</code>:</p> <pre><code>node('small||medium') { // some block } </code></pre>
22,127,754
How to install C# language support in Atom
<p>I've just started using <a href="https://atom.io/">https://atom.io/</a> on OSX</p> <p>If I open a C# file it doesn't syntax highlight.</p> <p>I've found <a href="https://github.com/atom/language-csharp">https://github.com/atom/language-csharp</a></p> <p>Do I just clone that and copy it into /Applications/Atom.app...
22,127,785
5
0
null
2014-03-02 12:50:00.413 UTC
4
2018-08-28 03:19:37.397 UTC
2014-03-20 18:03:25.143 UTC
null
321,731
null
435,129
null
1
30
programming-languages|syntax-highlighting|atom-editor
23,095
<p>Go into preferences -> Packages and type 'CSharp'</p> <p><img src="https://i.stack.imgur.com/DkKiP.png" alt="enter image description here"></p> <p>I've used Lisp in the picture as I already installed CSharp so it won't show up any more.</p>
2,706,044
How do I stop jetty server in clojure?
<p>I am writing a web application using ring and clojure. I am using the jetty adapter for the development server and emacs/SLIME for IDE. While wrap-reload does help, run-jetty blocks my slime session and I would like to be able to start/stop it at will without having to run it in a separate terminal session. Ideally,...
2,706,239
3
0
null
2010-04-24 20:40:51.59 UTC
21
2022-04-22 23:26:16.85 UTC
2011-03-07 17:58:22.543 UTC
null
339,701
null
302,268
null
1
62
clojure|jetty|ring
14,722
<p>I usually have a line in my Ring app that looks like the following:</p> <pre><code>(defonce server (run-jetty #'my-app {:port 8080 :join? false})) </code></pre> <p>This prevents locking up the REPL. It also allows me to recompile this file without worrying that my server will get redefined. It also lets you intera...
2,948,156
Algorithm Complexity & Security: MD5 or SHA1?
<blockquote> <p><strong>Which is the best overall hashing algorithm in terms of complexity and security? md5 or sha1?</strong></p> </blockquote> <p>From what I know <em>md5</em> is faster than <em>sha1</em> but <em>SHA1</em> is more complex than md5. </p> <p>Am I missing anything?</p>
2,948,163
3
2
null
2010-06-01 08:14:28.517 UTC
23
2017-03-16 17:28:19.643 UTC
2012-04-26 15:24:10.68 UTC
null
295,264
null
295,264
null
1
70
algorithm|hash
91,799
<p>First of all, MD5 is broken - you can generate a collision, so MD5 should not be used for any security applications. SHA1 is not known to be broken and is believed to be secure. Other than that - yes, MD5 is faster but has 128-bit output, while SHA1 has 160-bit output.</p> <p><strong>Update:</strong> SHA1 has been ...
2,465,111
Dependency Walker reports IESHIMS.DLL and WER.DLL missing?
<p>On a Windows XP Professional SP3 with Internet Explorer 8 box, when I run Dependency Walker on an executable of mine it reports that: IESHIMS.DLL and WER.DLL can't be found.</p> <ol> <li>Do I need these DLL's?</li> <li>Where can I get them?</li> </ol> <p>I believe they are supposed to located in C:\Windows\System...
2,465,488
4
2
null
2010-03-17 19:08:37.187 UTC
14
2018-12-06 09:08:02.003 UTC
null
null
null
null
155,268
null
1
99
internet-explorer-8|dll|dependency-walker|windows-xp-sp3
157,301
<p><code>ieshims.dll</code> is an artefact of Vista/7 where a shim DLL is used to proxy certain calls (such as <code>CreateProcess</code>) to handle protected mode IE, which doesn't exist on XP, so it is unnecessary. <code>wer.dll</code> is related to Windows Error Reporting and again is probably unused on Windows XP w...
40,557,637
How to return an image in Spring Boot controller and serve like a file system
<p>I've tried the various ways given in Stackoverflow, maybe I missed something.</p> <p>I have an Android client (whose code I can't change) which is currently getting an image like this:</p> <pre><code>HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connec...
40,585,852
4
5
null
2016-11-11 23:12:59.547 UTC
10
2019-03-28 21:55:55.847 UTC
2016-11-17 23:55:46.64 UTC
null
1,689,965
null
2,393,012
null
1
17
java|spring-mvc|spring-boot
45,438
<p>Finally fixed this... I had to add a <code>ByteArrayHttpMessageConverter</code> to my <code>WebMvcConfigurerAdapter</code> subclass:</p> <pre><code>@Override public void configureMessageConverters(List&lt;HttpMessageConverter&lt;?&gt;&gt; converters) { final ByteArrayHttpMessageConverter arrayHttpMessageConvert...
37,200,162
Swift: Get an element from a tuple
<p>If I have a tuple like this</p> <pre><code>var answer: (number: Int, good: Bool) </code></pre> <p>How do I get one of the elements?</p> <p>This doesn't work:</p> <pre><code>answer["number"] </code></pre> <p>I am modeling this question after <a href="https://stackoverflow.com/questions/26536538/swift-get-an-arra...
37,200,163
2
0
null
2016-05-13 02:10:16.887 UTC
4
2016-05-13 02:39:00.503 UTC
2017-05-23 12:25:54.497 UTC
null
-1
null
3,681,880
null
1
32
swift|tuples
24,485
<p>According to the <a href="https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html">documentation</a> (scroll down to Tuples), there are three ways to do it.</p> <p>Given</p> <pre><code>var answer: (number: Int, good: Bool) = (100, true) </code></pre> <p><st...
49,196,173
Move cypress folder from the root of the project
<p>When I install and run cypress, it scaffolds a <code>cypress/</code> folder in the root of my project.</p> <p>The problem is that all other test related data is stored in the <code>test/</code> folder. Is there an easy way to move it to <code>test/cypress</code> and configure cypress to look there?</p>
49,196,174
4
0
null
2018-03-09 14:43:01.857 UTC
7
2022-07-07 22:50:22.023 UTC
null
null
null
null
4,603,159
null
1
37
testing|integration-testing|cypress
21,699
<p>Cypress has a few configuration options to specify custom folder structure.</p> <p>For that you will need to have <code>cypress.json</code> file in the root of your project and specify the following structure there for cypress to properly pick up the files in <code>test/cypress/</code>:</p> <pre><code>{ &quot;fixt...
49,282,471
Lombok causing "Actual and formal arguments lists differ in length error"
<p>I have the following class:</p> <pre><code>@Builder @NoArgsConstructor public class ConsultationPointOfContact { private String fullName; private String phoneNumber; private String userLogin; } </code></pre> <p>When the <code>@Builder</code> annotation exists, it is causing problems with the <code>@...
49,282,701
3
0
null
2018-03-14 16:01:53.65 UTC
9
2021-11-26 07:06:56.893 UTC
null
null
null
null
1,688,441
null
1
54
java|lombok|intellij-lombok-plugin
23,528
<p>Add <code>@AllArgsConstructor</code> as well and this should fix the issue</p>
13,747,468
How to copy rows of from one sheet to another sheet using vbscript
<p>Suppose I have Sheet(1) in an excel. Now i do also have 2500 rows which has data for the columns from A to BO.Now I want the data to copy from these sheet to another sheet of the same Excel file for 2500 rows but not the whole the columns,rather i need only columns from A to AA data to copy to the new sheet.</p> <p...
13,748,244
3
1
null
2012-12-06 15:56:05.967 UTC
1
2017-07-17 18:51:55.317 UTC
null
null
null
null
2,767,755
null
1
0
vbscript
42,213
<p>To copy data from one sheet to another you can use the Copy en PasteSpecial commands. To do this with a <code>.vbs</code> script do the following:</p> <pre><code>' Create Excel object Set objExcel = CreateObject("Excel.Application") ' Open the workbook Set objWorkbook = objExcel.Workbooks.Open _ ("C:\myworkbook...
1,102,673
SQL Server subquery syntax
<p>When I run the query :</p> <pre><code>select count(*) from (select idCover from x90..dimCover group by idCover having count(*) &gt; 1) </code></pre> <p>I get the error :</p> <pre><code>Server: Msg 170, Level 15, State 1, Line 2 Line 2: Incorrect syntax near ')' </code></pre> <p>How do I formulate this query co...
1,102,679
2
0
null
2009-07-09 09:01:04.637 UTC
1
2014-12-10 15:49:59.903 UTC
2009-07-09 10:05:49.03 UTC
null
36,189
null
36,189
null
1
29
sql|sql-server
25,869
<p>Add an alias after your last bracket.</p> <pre><code>select count(*) from (select idCover from x90..dimCover group by idCover having count(*) &gt; 1) a </code></pre>
939,673
How is a blob column annotated in Hibernate?
<p>How is a blob column annotated in Hibernate? So far I have a class that has:</p> <pre><code>@Column( name = "FILEIMAGE" ) private byte[ ] fileimage ; // public byte[ ] getFileimage ( ) { return this.fileimage ; } public void setFilename ( String filename ) { this.filename = filename ; } </code></pre>
939,725
2
0
null
2009-06-02 13:49:46.993 UTC
5
2014-08-22 20:59:47.987 UTC
null
null
null
quinn
null
null
1
35
hibernate|annotations|blob
59,485
<p>@Lob should do the trick for blob and clob (use String as type)</p> <pre><code>@Column( name = "FILEIMAGE" ) @Lob(type = LobType.BLOB) private byte[] fileimage; </code></pre>
2,903,610
Visual Studio: reset user settings when debugging
<p>In a C# Winforms-App I have several user settings stored.</p> <p>Is there an easy way to clear those settings each time I start debugging the project from Visual Studio 2008?</p> <p>Otherwise it always starts up with the settings from the last debug-session.</p>
2,903,657
6
0
null
2010-05-25 09:56:33.733 UTC
10
2018-01-26 12:39:50.007 UTC
2016-10-18 20:36:44.903 UTC
null
2,840,103
null
196,253
null
1
26
c#|visual-studio-2008|settings|reset
40,402
<p>Add a pre-build action to delete:</p> <p><code>%USERPROFILE%\Local Settings\Application Data\[AppName]\...\[Version]\user.config</code></p> <p>or if your version number changes alot just delete</p> <p><code>%USERPROFILE%\Local Settings\Application Data\[AppName]\</code></p>
2,396,548
Appending to boost::filesystem::path
<p>I have a certain <code>boost::filesystem::path</code> in hand and I'd like to append a string (or path) to it.</p> <pre><code>boost::filesystem::path p("c:\\dir"); p.append(".foo"); // should result in p pointing to c:\dir.foo </code></pre> <p>The only overload <code>boost::filesystem::path</code> has of <code>app...
2,396,827
6
0
null
2010-03-07 14:20:52.773 UTC
5
2022-07-04 08:30:33.793 UTC
null
null
null
null
210,311
null
1
40
c++|boost
72,904
<pre><code>#include &lt;iostream&gt; #include &lt;string&gt; #include &lt;boost/filesystem.hpp&gt; int main() { boost::filesystem::path p (__FILE__); std::string new_filename = p.leaf() + ".foo"; p.remove_leaf() /= new_filename; std::cout &lt;&lt; p &lt;&lt; '\n'; return 0; } </code></pre> <p>Tested with...
2,776,397
Create a basic matrix in C (input by user !)
<p>I'm trying to ask the user to enter the number of columns and rows they want in a matrix, and then enter the values in the matrix... I'm going to let them insert numbers one row at a time.</p> <p>How can I create such function ?</p> <pre><code>#include&lt;stdio.h&gt; main(){ int mat[10][10],i,j; for(i=0;i&lt;2;i...
2,776,452
7
0
null
2010-05-05 20:07:15.213 UTC
2
2017-10-17 13:10:32.583 UTC
2017-02-10 12:13:32.59 UTC
null
3,563,841
null
331,734
null
1
9
c|matrix
261,231
<p>How about the following?</p> <p>First ask the user for the number of rows and columns, store that in say, <code>nrows</code> and <code>ncols</code> (i.e. <code>scanf("%d", &amp;nrows);</code>) and then <a href="http://pleasemakeanote.blogspot.com/2008/06/2d-arrays-in-c-using-malloc.html" rel="noreferrer">allocate m...
2,390,230
Do copyright dates need to be updated?
<p>Every now and then I see a web site that has an old copyright date. In my mind, I always think "Look at the sucker who forgot to update his copyright year!" Then, while I was hard-coding a copyright year into the site I'm currently designing, it suddenly struck me: </p> <p>How the hell am I going to remember to upd...
2,391,555
7
6
null
2010-03-05 21:59:53.153 UTC
84
2021-03-09 10:09:06.54 UTC
2012-10-11 17:53:36.897 UTC
null
493,939
null
84,088
null
1
340
server-side|copyright-display
166,707
<p>The copyright notice on a work establishes a claim to copyright. The date on the notice establishes how far back the claim is made. This means if you update the date, you are no longer claiming the copyright for the original date and that means if somebody has copied the work in the meantime and they claim its their...
25,407,428
How to access CoreData model in today extension (iOS)
<p>Is it possible to work with my CoreData model in the today extension in swift like in the original app? If yes, how can I create the NSManagedObjectContext? <br> I really have no clue, beside the group-identifier, but unfortunatly I don't know how to get the context.. <br> In the past I created apps with the check a...
25,408,472
1
0
null
2014-08-20 14:31:11.45 UTC
19
2015-07-30 23:12:50.693 UTC
2014-12-23 13:35:59.537 UTC
null
3,126,646
null
2,607,748
null
1
38
ios|core-data|swift|ios8|today-extension
20,343
<p>What you really want is to access your persistent store (most likely a SQLite database). In order to achieve that, you need to configure App Groups and make sure that your host app configures the Core Data stack using your shared container (so your store is accessible in extension as well). Something like:</p> <pre>...
25,387,660
iBeacon region monitoring AND proximity for >20 beacons?
<p>I have been working on a prototype iOS app utilizing iBeacons to provide location-relevant information to office employees depending on where in the office they are. The ideal use case is that whenever an employee enters or exits their office, a callback is fired which provides them some information in the form of a...
25,389,318
3
0
null
2014-08-19 15:43:33.233 UTC
11
2014-08-28 15:22:49.77 UTC
null
null
null
null
1,722,048
null
1
13
ios|ibeacon
7,290
<p>Option #2 is absolutely more complicated, but you must accept these complications in order to get around the 20 region monitoring limit.</p> <p>A few points:</p> <ul> <li><p>In the background, you only have around 5 seconds of ranging time, which does not give you as much time to average RSSI (signal strength) fro...
25,160,245
Clang linking with a .so file
<p>I keep getting</p> <pre class="lang-none prettyprint-override"><code>ld: library not found for -lchaiscript_stdlib-5.3.1.so clang: error: linker command failed with exit code 1 (use -v to see invocation) </code></pre> <p>When trying to link to a <em>.so</em> file.</p> <p>I'm using this command:</p> <pre class="lang-...
25,160,298
1
0
null
2014-08-06 12:20:44.61 UTC
9
2020-12-30 22:43:14.173 UTC
2020-12-30 22:40:54.563 UTC
null
63,550
user245019
null
null
1
14
c++|linker|clang|chaiscript
34,476
<p>Yes, the <code>-L</code> option adds the search path, but the linker adds the <code>.so</code> (or <code>.a</code>) suffix itself (just like it adds the <code>lib</code> prefix). So you only need to have <code>-lchaiscript_stdlib-5.3.1</code> and the linker will find it.</p> <p>You can also skip the adding of the pa...
6,121,276
Is it possible to Load an assembly from the GAC without the FullName?
<p>I know how to load an assembly from a filename, and also from the GAC. As My .msi file will put a dll project into the GAC, I'm wondering if it's possible to load it from the GAC unknowing the FullName (I mean just with the assembly name, or even the dll filename), because I have to Load this assembly from another p...
6,131,116
2
1
null
2011-05-25 07:58:33.403 UTC
9
2017-02-24 23:37:11.843 UTC
2017-02-24 23:37:11.843 UTC
null
41,071
null
580,319
null
1
20
c#|assemblies|load|gac
6,306
<p>Here is a piece of code that allows to do this, and an exemple:</p> <pre><code> string path = GetAssemblyPath("System.DirectoryServices"); Assembly.LoadFrom(path); </code></pre> <p>Note if you need a specific processor architecture, since it supports partial name, you can write this kind of things:</p> <pr...
18,596,867
What is the git command to list ignored files?
<p>My netbeans IDE shows ignored files on a different color. I presume, the IDE is knowing this by using some git command.</p> <p>I wish to know what files on a project folder and subfolders are being ignored.</p> <p>What command should we use?</p>
18,596,993
1
1
null
2013-09-03 16:10:00.427 UTC
4
2013-09-03 16:18:15.3 UTC
null
null
null
null
378,170
null
1
29
git
24,722
<p><code>git status --ignored</code> will show all untracked files. It also includes the normal status output. There does not appear to be a status option to only show the ignored files.</p>
30,942,556
Laravel: dynamic where clause with Elouquent
<p>I am calling URL with search params which are dynamic. How could I form proper <strong>Eloquent query</strong>?</p> <p>In theory:</p> <ol> <li>query</li> <li><strong>query where(someParam1)</strong></li> <li><strong>query where(someParam2)</strong></li> <li>query orderby(someParam3)</li> <li>query get</li> </ol> ...
30,943,421
6
0
null
2015-06-19 16:04:00.23 UTC
10
2020-08-25 14:55:12.41 UTC
null
null
null
null
3,103,116
null
1
35
laravel|eloquent
34,754
<p>It's easy with Laravel. Just do something like this:</p> <pre><code>$query = User::query(); if ($this == $that) { $query = $query-&gt;where('this', 'that'); } if ($this == $another_thing) { $query = $query-&gt;where('this', 'another_thing'); } if ($this == $yet_another_thing) { $query = $query-&gt;orderBy(...
31,289,895
Threshold image using opencv (Java)
<p>I am working with Opencv for my project. I need to convert the image below to threshold image </p> <p><img src="https://i.stack.imgur.com/w8eyt.jpg" alt="Original Image"></p> <p>I tried this function: </p> <pre><code>Imgproc.threshold(imgGray, imgThreshold, 0, 255, Imgproc.THRESH_BINARY + Imgproc.THRESH_OTSU); <...
31,290,735
1
1
null
2015-07-08 10:24:34.963 UTC
11
2020-11-16 16:51:59.953 UTC
2015-07-08 11:42:51.24 UTC
null
4,968,030
null
1,840,768
null
1
12
java|android|opencv|image-processing|tesseract
25,749
<p><code>adaptiveThreshold</code> is the right choice here. <strong>Just need a litte tuning</strong>. With these parameters (it's C++, but you can easily translate to Java)</p> <pre><code>Mat1b gray= imread("path_to_image", IMREAD_GRAYSCALE); Mat1b result; adaptiveThreshold(gray, result, 255, ADAPTIVE_THRESH_MEAN_C, ...
31,399,411
Go to "next" iteration in JavaScript forEach loop
<p>How do I go to the next iteration of a JavaScript <code>Array.forEach()</code> loop?</p> <p>For example:</p> <pre><code>var myArr = [1, 2, 3, 4]; myArr.forEach(function(elem){ if (elem === 3) { // Go to "next" iteration. Or "continue" to next iteration... } console.log(elem); }); </code></pre> <p><a h...
31,399,448
3
1
null
2015-07-14 06:38:17.343 UTC
22
2019-08-11 22:45:28.753 UTC
2019-08-11 22:45:28.753 UTC
null
4,642,212
null
1,001,938
null
1
310
javascript|foreach
227,038
<p>You can simply <code>return</code> if you want to skip the current iteration.</p> <p>Since you're in a function, if you <code>return</code> before doing anything else, then you have effectively skipped execution of the code below the <code>return</code> statement.</p>
19,628,393
How to begin with Windows Kernel Programming?
<p>I am an application developer mostly work in C#. I have some knowledge of C/C++. I am very much fascinated and interested in windows Kernel Development. I Sketched out a layout to learn this.</p> <pre><code>1. Understand Windows internals(By books) 2. Try Simple Modules and keep expanding. </code></pre> <p>To achi...
19,634,253
2
0
null
2013-10-28 06:30:49.943 UTC
27
2019-07-07 08:12:11.003 UTC
2013-10-28 08:19:07.56 UTC
null
1,157,680
null
1,157,680
null
1
21
kernel|windows-kernel
23,446
<p>Read <a href="http://technet.microsoft.com/en-us/sysinternals/bb963901.aspx" rel="noreferrer">Windows Internals</a>.</p> <p>Read <a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff557573%28v=vs.85%29.aspx" rel="noreferrer">Windows Drivers Development</a>.</p> <p>Follow and read <a href="https://co...
19,448,902
Changing the width of Bootstrap popover
<p>I am designing a page using Bootstrap 3. I am trying to use a popover with <code>placement: right</code> on an input element. The new Bootstrap ensures that if you use <code>form-control</code> you basically have a full-width input element.</p> <p>The HTML code looks something like this: </p> <pre><code>&lt;div cl...
19,604,395
24
0
null
2013-10-18 11:46:17.187 UTC
38
2022-03-11 09:58:39.987 UTC
2015-01-17 05:41:34.057 UTC
null
3,998,712
null
1,152,297
null
1
216
css|twitter-bootstrap|twitter-bootstrap-3|popover
308,173
<pre><code>&lt;div class="row" data-toggle="popover" data-trigger="hover" data-content="My popover content.My popover content.My popover content.My popover content."&gt; &lt;div class="col-md-6"&gt; &lt;label for="name"&gt;Name:&lt;/label&gt; &lt;input id="name" class="form-control" type="text...
19,140,148
C++ Get Total File Line Number
<p>Is there a function I can use to get total file line number in <code>C++</code>, or does it have to be manually done by <code>for</code> loop?</p> <pre><code>#include &lt;iostream&gt; #include &lt;ifstream&gt; ifstream aFile ("text.txt"); if (aFile.good()) { //how do i get total file line number? } </code></pre> ...
19,140,254
7
0
null
2013-10-02 15:01:55.64 UTC
3
2021-04-14 23:19:04.077 UTC
2016-11-15 13:17:00.827 UTC
null
7,055,233
null
2,797,246
null
1
6
c++|get|numbers|size|line
65,914
<p>There is no such function. Counting can be done by reading whole lines </p> <pre><code>std::ifstream f("text.txt"); std::string line; long i; for (i = 0; std::getline(f, line); ++i) ; </code></pre> <p>A note about scope, variable <code>i</code> must be outside <a href="https://en.cppreference.com/w/cpp/languag...
19,216,580
Requirejs: paths vs map
<p>Trying to understand where it's right to use "map" with a wildcard vs "paths". </p> <p>Looking at the require source (but certainly not being 100% fluent with it) it seems like there would functionally be no difference between these two snippets. Is that true? </p> <p>Using Paths:</p> <pre><code> require.config(...
24,305,846
4
0
null
2013-10-07 03:19:27.317 UTC
2
2022-01-30 20:28:58.313 UTC
2013-10-26 11:33:51.717 UTC
null
578,411
null
60,247
null
1
31
requirejs
14,253
<p>From the RequireJS Docs "In addition, the paths config is only for setting up root paths for module IDs, not for mapping one module ID to another one."</p> <p>This means "paths" is meant for mapping just the path to your resource when it is not in the default location (baseUrl). I guess this is what you were trying...
37,032,203
Make syscall in Python
<p>I want to make <code>syscall</code> in Python and the function is not in <code>libc</code>, is there a way to do it in Python?</p> <p>More specifically, I want to call <a href="http://man7.org/linux/man-pages/man2/getdents.2.html" rel="noreferrer"><code>getdents</code></a>, whose manpage says </p> <blockquote> <...
37,032,683
1
0
null
2016-05-04 15:33:27.393 UTC
9
2016-05-04 16:48:37.88 UTC
2016-05-04 16:00:45.497 UTC
null
416,224
null
875,044
null
1
30
python|python-2.7|system-calls
19,845
<p>Libc exposes a function to invoke "custom" syscalls: <a href="http://man7.org/linux/man-pages/man2/syscall.2.html" rel="noreferrer"><code>long syscall(long number, ...);</code></a></p> <blockquote> <p><code>syscall()</code> is a small library function that invokes the system call whose assembly language ...
29,971,837
Changing password on p12 file
<p>I was forwarded a p12 file from a client with the push cert. </p> <p>Can I change the password of this p12 file without any ramifications and if yes, can I use something like this:</p> <pre><code>openssl pkcs12 -in Certificates.p12 -out temp.pem -passin pass: -passout pass:temppassword openssl pkcs12 -expo...
35,609,431
4
2
null
2015-04-30 15:29:49.83 UTC
16
2019-09-11 15:09:07.75 UTC
2017-07-21 10:55:08.72 UTC
null
177,701
null
1,819,000
null
1
38
ios|push-notification|apple-push-notifications
54,425
<p>There will be no problem. </p> <p>PFX is an encrypted container, changing the password of the container will have no effect on the certificates inside the container.</p>
48,556,768
How to configure prometheus with alertmanager?
<p><strong>docker-compose.yml:</strong> This is the docker-compose to run the prometheus, node-exporter and alert-manager service. All the services are running great. Even the health status in target menu of prometheus shows ok.</p> <pre><code>version: '2' services: prometheus: image: prom/prometheus ...
48,559,174
2
1
null
2018-02-01 06:41:29.123 UTC
9
2022-04-28 14:27:32.327 UTC
2018-02-01 12:29:49.447 UTC
null
4,966,953
null
4,412,382
null
1
10
docker-compose|prometheus
16,812
<p>Your <code>./alertmanager/alert.rules</code> file is not included in your docker config, so it is not available in the container. You need to add it to the prometheus service:</p> <pre><code>prometheus: image: prom/prometheus privileged: true volumes: - ./prometheus.yml:/etc/prometheus/prometheu...
48,619,733
react-router Redirect vs history.push
<p>I was reading <a href="https://github.com/ReactTraining/react-router/tree/master/packages/react-router-redux/examples" rel="noreferrer">react-router-redux examples</a> and I confused, what is the difference beetween:</p> <pre><code>import { Redirect } from 'react-router-dom' ... &lt;Redirect to='/login' /&gt; </...
50,525,884
3
2
null
2018-02-05 09:52:20.297 UTC
12
2021-07-02 14:44:39.45 UTC
null
null
null
null
4,204,843
null
1
57
react-router|react-router-v4|react-router-redux|react-router-dom
51,623
<p><strong>Redirect</strong></p> <p>Rendering a <code>&lt;Redirect&gt;</code> will navigate to a new location. The new location will <code>override the current location in the history stack,</code> like server-side redirects (HTTP 3xx) do.</p> <p>whereas <strong>History</strong></p> <p><strong>push function</strong>...
8,439,657
Copy an entire worksheet to a new worksheet in Excel 2010
<p>I have found similar questions that deal with copying an entire worksheet in one workbook and pasting it to another workbook, but I am interested in simply copying an entire worksheet and pasting it to a new worksheet -- in the same workbook. </p> <p>I'm in the process of converting a 2003 .xls file to 2010 .xlsm a...
8,439,771
6
0
null
2011-12-09 00:32:24.483 UTC
7
2018-05-11 15:10:29.91 UTC
2015-03-26 17:03:36.517 UTC
null
1,505,120
user567677
null
null
1
27
vba|excel|excel-2010
335,509
<p>It is simpler just to run an exact copy like below to put the copy in as the last sheet</p> <pre><code>Sub Test() Dim ws1 As Worksheet Set ws1 = ThisWorkbook.Worksheets("Master") ws1.Copy ThisWorkbook.Sheets(Sheets.Count) End Sub </code></pre>
8,868,486
What's the difference between MemoryCache.Add and MemoryCache.Set?
<p>I read the <a href="https://msdn.microsoft.com/en-us/library/dd780623(v=vs.110).aspx">MSDN documentation</a> but didn't really understand it.</p> <p>I believe that the behavior of <code>Set</code> is "replace existing, or add" (atomically).</p> <p>Is that correct?</p>
8,868,522
1
0
null
2012-01-15 08:40:35.607 UTC
8
2016-11-15 07:00:16.307 UTC
2015-10-24 15:43:03.457 UTC
null
3,191,599
null
136,999
null
1
114
.net|memorycache
27,752
<p><code>Add</code> does nothing (returns <code>false</code>) if there is already a value for that key. <code>Set</code> does an insert or update, as necessary.</p> <p><code>Remove</code> + <code>Add</code> would leave a gap in the middle when another thread querying that key would get no clue (<code>Set</code> does n...
26,969,166
counting occurrences in data.frame in r
<p>I have a data frame 200 columns containing 150 genes (rows) in each column.</p> <p>I want to count the number occurrences for each gene in the whole data frame</p> <pre><code>mydat &lt;- V1 V2 V3 V4 V5 V6 V7 V8 1 TGFBR2 TGFBR2 TGFBR2 TGFBR2 TGFBR2 TGF...
26,969,215
2
1
null
2014-11-17 09:14:15.883 UTC
3
2014-11-17 10:37:12 UTC
2014-11-17 10:32:48.84 UTC
null
1,627,235
null
4,079,590
null
1
17
r|dataframe
50,936
<p>try</p> <pre><code>occurences&lt;-table(unlist(mydat)) </code></pre> <p>(I assigned the result so you don't get a full screen of gene names and so each gene's occurence can be accessed by <code>occurences["genename"]</code>)</p>
26,543,127
PowerShell Setting advanced NTFS permissions
<p>I'm trying to apply NTFS permissions that are defined in the 'Advanced' tab of the Windows security settings. One ACL <code>$Rule</code> is for <code>This folder only</code> and another one is for the <code>Subfolders and files only</code>.</p> <p>The permissions are heavily modified as you can see below:</p> <pre...
26,544,463
2
0
null
2014-10-24 07:12:33.383 UTC
5
2017-12-14 07:12:46.1 UTC
2014-10-24 12:01:44.457 UTC
null
2,304,170
null
2,304,170
null
1
9
powershell|permissions|ntfs
82,602
<p>Object access permissions in Windows are controlled via <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa374872%28v=vs.85%29.aspx" rel="noreferrer">Access Control Lists</a> (ACL), which basically consist of a list of <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa374868%28v=vs.8...
26,649,180
'Show' segue in Xcode 6 presents the viewcontroller as a modal in iOS 7
<p>I have two view controllers in my iPhone application (built with swift) built with Xcode 6.1 and uses storyboards.</p> <p>The first view controller is embedded in a navigation controller in the storyboard and the segue for the second view controller is a 'Show' segue. </p> <p>When the application is run, it proper...
33,377,134
11
0
null
2014-10-30 09:24:06.913 UTC
3
2017-12-05 14:43:00.613 UTC
null
null
null
null
2,717,398
null
1
28
ios|swift|uistoryboardsegue
13,489
<blockquote> <p>This solution is different from the others in the following ways:</p> </blockquote> <ol> <li>It includes a method to examine and verify the issue</li> <li>The cause of the issue is traced to the source (a change in the segue type)</li> <li>The solution is very simple (delete and recreate a new segue)...
61,522,624
How to create an optional field in a dataclass that is inherited?
<pre class="lang-py prettyprint-override"><code>from typing import Optional @dataclass class Event: id: str created_at: datetime updated_at: Optional[datetime] #updated_at: datetime = field(default_factory=datetime.now) CASE 1 #updated_at: Optional[datetime] = None CASE 2 @datacl...
61,562,009
1
0
null
2020-04-30 11:44:48.137 UTC
2
2022-07-24 02:49:28.38 UTC
null
null
null
null
7,125,235
null
1
31
python|python-3.x|python-dataclasses
44,535
<p>The underlying problem that you have seems to be the same one that is described <a href="https://stackoverflow.com/questions/51575931/class-inheritance-in-python-3-7-dataclasses/53085935#53085935">here</a>. The short version of that post is that in a function signature (including the dataclass-generated <code>__init...
30,733,904
Renaming a File() object in JavaScript
<p>I'd like for my users to be able to re-name a file before uploading it.</p> <p>I have a <code>File</code> object in Javascript which has a <code>name</code> property that is already set, but i'd like for this to be able to be updated. Right now doing the obvious <code>myFile.name = "new-name.txt"</code> returns an...
30,734,316
6
0
null
2015-06-09 13:46:55.153 UTC
4
2021-11-18 16:08:09.473 UTC
null
null
null
null
79,677
null
1
38
javascript|file|rename|file-rename
33,182
<p>You can add an <code>input</code> tag with the name on it and hide the <code>name</code> property from the user. On the server, just use the <code>input</code> as the name and ignore the default name.</p>
43,841,091
Spark2.1.0 incompatible Jackson versions 2.7.6
<p>I am trying to run a simple spark example in intellij, but I get the error like that:</p> <pre><code>Exception in thread "main" java.lang.ExceptionInInitializerError at org.apache.spark.SparkContext.withScope(SparkContext.scala:701) at org.apache.spark.SparkContext.textFile(SparkContext.scala:819) at spark.test$.ma...
43,845,063
3
0
null
2017-05-08 06:27:47.367 UTC
9
2020-05-18 05:20:47.557 UTC
2017-05-08 06:34:19.85 UTC
null
7,978,963
null
7,978,963
null
1
36
scala|apache-spark|jackson|sbt|incompatibletypeerror
25,760
<p>Spark 2.1.0 contains <code>com.fasterxml.jackson.core</code> as transitive dependency. So, we do not need to include then in <code>libraryDependencies</code>. </p> <p>But if you want to add a different <code>com.fasterxml.jackson.core</code> dependencies' version then you have to override them. Like this:</p> <pre...
880,937
Vary by control properties using PartialCaching in ASP.NET
<p>I am using the PartialCaching attribute on the base class of a user control.</p> <p>I would like the cached controls to vary based on the properties set on the control instance.</p> <p>For example:</p> <pre><code>&lt;mycontrols:control1 runat="server" param1="10" param2="20" /&gt; </code></pre> <p>...output woul...
903,429
3
0
null
2009-05-19 04:10:59.683 UTC
10
2014-09-12 19:35:59.19 UTC
null
null
null
null
52,529
null
1
12
asp.net|caching|outputcache
10,198
<p>To answer your first Q, let me first tell you that your question itself has the answer ;). 'Shared' ... yes that's the keyword :) To have a single instance in cache for the user control across all the pages, set Shared='true' in the @OutputCache directive. This should be set at the user control level i.e. in the asc...
282,282
How does StackOverflow's 'tags' textbox autocomplete work?
<p>I know they're using a jQuery plugin, but I can't seem to find which one they used. In particular, what I'm looking for is autocomplete with exactly the same functionality as SO's autocomplete, where it will perform an AJAX command with each new word typed in and allow you to select one from a dropdown.</p>
282,328
3
3
null
2008-11-11 21:59:14.723 UTC
17
2014-08-03 03:30:47.26 UTC
null
null
null
Erik
16,942
null
1
38
javascript|jquery|ajax|textbox|autocomplete
7,569
<p>Note that the tag editor <a href="https://meta.stackexchange.com/questions/100669/feedback-wanted-improved-tag-editor">has been completely re-written now</a>, and no longer resembles the original, simple text box w/ suggestion drop-down that adorned the site for nearly three years. </p> <p>If you're interested in t...
641,120
What does "exec sp_reset_connection" mean in Sql Server Profiler?
<p>Trying to understand what Sql Profiler means by emitting "sp_reset_connection".</p> <p>I have the following, "exec sp_reset_connection" line followed by BatchStarting and Completed,</p> <pre><code>RPC:Completed exec sp_reset_connection SQL:BatchStarting SELECT [c].[TestID] AS [TestID], [c].[Description] AS...
2,924,456
3
0
null
2009-03-13 01:07:34.637 UTC
38
2022-07-08 08:16:21.807 UTC
2016-10-20 09:29:30.887 UTC
ray247
133
ray247
32,240
null
1
182
sql-server|database-connection|sql-server-profiler|sp-reset-connection
124,439
<p>Like the other answers said, <code>sp_reset_connection</code> indicates that connection pool is being reused. Be aware of one particular consequence!</p> <blockquote> <p><strong><a href="https://web.archive.org/web/20160117124649/http://blogs.msdn.com/b/jimmymay/archive/2009/02/02/sp-reset-connection-does-not-reset-...
113,928
Can I return the 'id' field after a LINQ insert?
<p>When I enter an object into the DB with Linq-to-SQL can I get the id that I just inserted without making another db call? I am assuming this is pretty easy, I just don't know how. </p>
113,948
3
0
null
2008-09-22 09:10:02.417 UTC
34
2019-02-14 14:55:10.687 UTC
2012-09-13 23:05:49.41 UTC
null
127,880
naspinski
14,777
null
1
186
c#|.net|linq|linq-to-sql
110,010
<p>After you commit your object into the db the object receives a value in its ID field.</p> <p>So:</p> <pre><code>myObject.Field1 = "value"; // Db is the datacontext db.MyObjects.InsertOnSubmit(myObject); db.SubmitChanges(); // You can retrieve the id from the object int id = myObject.ID; </code></pre>
6,960,406
Add CSS to iFrame
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/217776/how-to-apply-css-to-iframe">How to apply CSS to iFrame?</a> </p> </blockquote> <p>Right now I'm loading an iframe via jquery:</p> <pre><code> $(window).load(function(){ $('iframe').load(function() { ...
6,960,628
1
11
null
2011-08-05 17:40:29.467 UTC
12
2013-06-28 10:42:49.963 UTC
2017-05-23 12:09:42.583 UTC
null
-1
null
516,833
null
1
36
jquery|css|iframe
114,813
<p>Based on solution You've already found <a href="https://stackoverflow.com/questions/217776/how-to-apply-css-to-iframe/217833#217833">How to apply CSS to iframe?</a>:</p> <pre><code>var cssLink = document.createElement("link") cssLink.href = "file://path/to/style.css"; cssLink .rel = "stylesheet"; cssLink .type =...
6,906,494
Deleting from localStorage: should I use delete or .removeItem?
<p>I'm using <code>localStorage</code> in a Chrome extension.</p> <p>Is there any difference between <code>delete localStorage[key]</code> and <code>window.localStorage.removeItem(key)</code> or do they behave identically?</p> <p>Note that I choose <code>window.localStorage.removeItem(key)</code> to correspond exactl...
6,929,473
1
2
null
2011-08-02 01:50:22.46 UTC
3
2011-08-03 15:59:40.683 UTC
2011-08-02 01:59:10.137 UTC
null
412,282
null
412,282
null
1
55
google-chrome|local-storage
50,247
<p>There's no difference in Chrome, but i recommend using localStorage.removeItem(key) so that you get in the habit of doing so. That way, when you go to use localStorage in a website, you are already using the method that is most likely to work with shims and polyfills for outdated browsers.</p>
6,450,765
How do you center a title for a diagram output to SVG using dot?
<p>So far I tried this line but dot keeps pushing it aside making room for my nodes (pushes it to the right):</p> <pre><code>_diagram_info [shape="plaintext", label="My Diagram\l", fontsize=13] </code></pre> <p>Is there a way to center the label by pos, using dot?</p>
6,452,088
1
0
null
2011-06-23 07:34:02.37 UTC
4
2022-04-08 07:42:14.33 UTC
2017-10-23 11:26:57.84 UTC
null
271,200
null
694,124
null
1
69
graphviz
24,959
<p>That's how I'd add a title for a graph:</p> <pre><code>digraph { // nodes, edges, subgraphs ... // title labelloc="t"; label="My Diagram"; } </code></pre> <p>This will add a centered title to the top of the graph.</p> <p>The same syntax can also be used for subgraphs.</p>
41,795,962
Zoom ImageView in android like Instagram
<p>How can I zoom ImageView like Instagram. I mean changing the size of imageview, not zooming the image inside the Imageview.</p> <p>For zooming the image inside the Imageview, there are a lot of samples but I want something like Instagram image zooming</p> <p>Any code or hint? Thanks.</p>
41,796,257
3
2
null
2017-01-22 20:46:12.567 UTC
8
2022-01-17 16:27:21.05 UTC
2022-01-17 16:27:21.05 UTC
null
3,503,855
null
5,131,929
null
1
14
java|android|image|zooming
11,387
<p>I would recommend these two libraries:</p> <ol> <li><p><a href="https://github.com/chrisbanes/PhotoView" rel="nofollow noreferrer">PhotoView</a></p> </li> <li><p><a href="https://github.com/sephiroth74/ImageViewZoom" rel="nofollow noreferrer">ImageViewZoom</a></p> </li> </ol> <p>For PhotoView, you just have to creat...
28,540,772
Using utf8mb4 in MySQL
<p>In order to use 4-byte <code>utf8mb4</code> in MySQL (5.6.11), I have set the following variables in the <code>my.ini</code> file (<code>my.cnf</code> is not found). This file is located in a hidden folder named <code>Application Data</code> (<code>C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Ser...
28,541,151
4
1
null
2015-02-16 11:48:39.8 UTC
4
2018-01-05 07:45:34.917 UTC
2015-02-16 11:59:42.48 UTC
null
1,391,249
null
1,391,249
null
1
22
mysql|utf-8|character-encoding|mysql-5.6|utf8mb4
47,063
<p>The <em>client</em> usually sets these values when connecting. The settings in my.ini are merely defaults which apply when the client does not explicitly specify a connection encoding. Since they're unreliable, every client <em>should</em> specify a connection encoding. Since you've got some fancy screenshot there I...
28,739,745
How to make an iterator out of an ES6 class
<p>How would I make an iterator out of an ES6 class in the same manner as JS1.7 <code>SomeClass.prototype.__iterator__ = function() {...}</code> syntax?</p> <p>[EDIT 16:00]</p> <p>The following works:</p> <pre><code>class SomeClass { constructor() { } *[Symbol.iterator]() { yield '1'; yi...
28,744,141
7
1
null
2015-02-26 10:19:05.64 UTC
21
2021-05-15 19:44:01.643 UTC
2015-02-26 16:31:40.8 UTC
null
1,351,235
null
1,351,235
null
1
77
javascript|ecmascript-6|ecmascript-harmony
30,195
<p>Define a suitable iterator method. For example:</p> <pre><code>class C { constructor() { this.a = [] } add(x) { this.a.push(x) } [Symbol.iterator]() { return this.a.values() } } </code></pre> <p>Edit: Sample use:</p> <pre><code>let c = new C c.add(1); c.add(2) for (let i of c) console.log(i) </code></pre>
20,868,394
Changing a specific column name in pandas DataFrame
<p>I was looking for an elegant way to change a specified column name in a <code>DataFrame</code>.</p> <p>play data ...</p> <pre><code>import pandas as pd d = { 'one': [1, 2, 3, 4, 5], 'two': [9, 8, 7, 6, 5], 'three': ['a', 'b', 'c', 'd', 'e'] } df = pd.DataFrame(d) </code></pre> <p>Th...
20,868,446
10
0
null
2014-01-01 11:59:54.937 UTC
105
2021-08-31 21:00:06.597 UTC
2014-01-01 12:05:08.58 UTC
null
1,577,110
null
1,577,110
null
1
241
python|pandas
376,458
<p>A one liner does exist:</p> <pre><code>In [27]: df=df.rename(columns = {'two':'new_name'}) In [28]: df Out[28]: one three new_name 0 1 a 9 1 2 b 8 2 3 c 7 3 4 d 6 4 5 e 5 </code></pre> <p>Following is the docstring for the <code>rename...
56,240,547
Should HTTP PUT create a resource if it does not exist?
<p>Lets suppose that someone performs a <code>PUT</code> request on my endoint:</p> <pre><code>/resources/{id} </code></pre> <p>However there is not resource with the given id stored in my PostgreSQL database.</p> <p>According to the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html" rel="noreferrer">RF...
56,241,060
3
1
null
2019-05-21 14:30:14.78 UTC
17
2021-11-17 01:07:29.563 UTC
2019-05-22 19:38:09.48 UTC
null
1,426,227
null
2,351,871
null
1
29
rest|http|put
27,563
<p>First of all, you are using an <strong>obsolete</strong> document: The RFC 2616 is no longer relevant nowadays and anyone using such document as reference should <em>stop right away</em>.</p> <p>Quoting <a href="https://www.mnot.net/blog/2014/06/07/rfc2616_is_dead" rel="noreferrer">Mark Nottingham</a> who, at the ti...
41,262,180
JSONDecodeError: Expecting ',' delimiter: line 1 column 43 (char 42)
<p>I have read on many examples here already on SO. Unfortunately, I keep getting this error, </p> <p><strong>Error:</strong> </p> <pre><code>json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 43 (char 42) </code></pre> <p><strong>json file:</strong> </p> <pre><code>{"people": [{"name": "Scott", "...
41,262,265
2
1
null
2016-12-21 11:50:53.397 UTC
4
2020-04-21 20:49:49.483 UTC
null
null
null
null
2,051,815
null
1
10
python
83,267
<p>Your JSON is invalid, it has <code>:</code> tokens in an array:</p> <pre><code>"result": ["0": "24", "1": "43", "2": "56"] # ^ ^ ^ </code></pre> <p>and</p> <pre><code>"result": ["0": "44", "1": "29", "2": "34"] # ^ ^ ^ </code></pre> <p>Fix your JSON inp...
20,159,821
OPENGL ES not working : no Current context
<p>I tried the program as shown in book OpenGL ES2 for Android, but it's not working!!</p> <p>I have tested in Odroid E, samsung s3, samsung y, samsung star!!</p> <pre><code>the gl version suported returns 2, but i get 11-22 15:09:45.804: E/oGl-es v(9047): 2.0:131072 11-22 15:09:45.804: E/libEGL(9047): call to OpenGL...
20,159,961
1
0
null
2013-11-23 07:32:37.277 UTC
3
2013-11-23 08:00:00.98 UTC
2013-11-23 08:00:00.98 UTC
null
44,729
null
2,781,649
null
1
20
android|opengl-es|egl
43,415
<p>The problem is with glSurfaceView, as it does not run on the OpenGL thread. The glSurfaceView should be on the main android thread.</p> <p>Here you find additional info about it:</p> <p><a href="https://stackoverflow.com/questions/11286819/opengl-es-api-with-no-current-context">opengl es api with no current contex...
34,820,578
How to capture audio in javascript?
<p>I am currently using <code>getUserMedia()</code>, which is only working on Firefox and Chrome, yet it got deprecated and works only on https (in Chrome). Is there any other/better way to get the speech input in javascript that works on all platforms?</p> <p>E.g. how do websites like web.whatsapp.com app record audi...
34,919,194
3
2
null
2016-01-15 21:58:43.973 UTC
20
2019-12-05 12:24:22.493 UTC
2016-01-23 23:46:55.14 UTC
null
1,967,704
null
2,212,461
null
1
20
javascript|audio|speech|getusermedia|voice-recording
31,616
<p>Chrome 60+ does <a href="https://addpipe.com/blog/microphone-camera-access-no-longer-works-insecure-origins/" rel="noreferrer">require using <strong>https</strong></a>, since <code>getUserMedia</code> is a powerful <a href="https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-featu...
1,480,133
How can I get an object's absolute position on the page in Javascript?
<p>I want to get an object's absolute x,y position on the page in Javascript. How can I do this?</p> <p>I tried <code>obj.offsetTop</code> and <code>obj.offsetLeft</code>, but those only give the position relative to the parent element. I guess I could loop through and add the parent's offset, and its parent's offse...
1,480,137
2
4
null
2009-09-26 00:59:25.1 UTC
28
2013-05-18 17:03:10.38 UTC
2012-08-30 00:59:26.91 UTC
null
825,789
null
18,511
null
1
108
javascript|dom|offset
172,487
<pre><code>var cumulativeOffset = function(element) { var top = 0, left = 0; do { top += element.offsetTop || 0; left += element.offsetLeft || 0; element = element.offsetParent; } while(element); return { top: top, left: left }; }; </code></pre> <p>(Method ...
45,811,971
warning: ignoring broken ref refs/remotes/origin/HEAD
<p>Since a few days ago, every time I press <kbd>tab</kbd> key to complete branch names in bash I see the message:</p> <blockquote> <p>warning: ignoring broken ref refs/remotes/origin/HEAD warning: ignoring broken ref refs/remotes/origin/HEAD</p> </blockquote> <p>For example, this is what I see when I have a branch...
45,867,333
9
2
null
2017-08-22 07:56:22.79 UTC
34
2022-07-12 20:38:09.937 UTC
2017-12-21 09:19:59.59 UTC
null
479,156
null
1,420,625
null
1
148
git|bash
51,895
<p>I encountered this recently when someone on my team deleted our old development branch from the remote. I ran this command to check the status of HEAD:</p> <pre><code>$ git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/old_dev </code></pre> <p>This command output the name of the old development branch,...
32,430,473
What are the main functionality differences between Github Wiki and Readme,
<p>What are the main functionality differences between Github Wiki and Readme,</p> <p>Asking those that have used both readme and wikis extensively. So that we can better decide which to use for the purpose of outputing verbal information. This would be based on your answer. Thanks.</p> <p>As examples, some have used...
32,446,439
3
2
null
2015-09-07 02:57:19.587 UTC
6
2022-05-26 21:17:41.953 UTC
2015-09-07 05:23:35.157 UTC
null
4,621,389
null
4,621,389
null
1
33
github|github-pages
11,381
<p>Talking about a project repository :</p> <ul> <li><code>Readme.md</code> is the packaging</li> <li><code>wiki pages</code> is made for development/contributors documentation</li> <li><code>gh-pages</code> branch hosts user documentation</li> </ul>
6,268,628
Git + a large data set?
<p>We're often working on a project where we've been handed a large data set (say, a handful of files that are 1GB each), and are writing code to analyze it.</p> <p>All of the analysis code is in Git, so everybody can check changes in and out of our central repository. But what to do with the data sets that the code i...
6,268,674
5
0
null
2011-06-07 16:40:45.96 UTC
9
2019-11-26 15:28:51.903 UTC
null
null
null
null
191,196
null
1
21
git|version-control|dataset
5,128
<p>use submodules to isolate your giant files from your source code. More on that here:</p> <p><a href="http://git-scm.com/book/en/v2/Git-Tools-Submodules" rel="noreferrer">http://git-scm.com/book/en/v2/Git-Tools-Submodules</a></p> <p>The examples talk about libraries, but this works for large bloated things like dat...
6,150,455
Structuring coffeescript code?
<p>Under Rails 3.1, I'm trying to find out how to move a few coffeescript classes away from my controller default coffeescript file (<code>home.js.coffee</code>) into another file, in order to structure the whole a little bit.</p> <p>Does anyone know how to "include" a coffeescript file into another?</p>
6,161,990
5
0
null
2011-05-27 09:42:38.58 UTC
6
2017-06-13 20:15:51.047 UTC
2012-12-06 19:22:38.327 UTC
null
333,288
null
1,982,991
null
1
32
ruby-on-rails-3|coffeescript
8,808
<p>What you want to do is <em>export</em> functionality. For instance, if you start with</p> <pre><code>class Foo ... class Bar extends Foo ... </code></pre> <p>and you decide you move <code>Foo</code> to its own file, that file should look like</p> <pre><code>class Foo ... window.Foo = Foo </code></pre> <p...
5,971,392
jQuery validate only validates one field
<p>I am using jQuery validate to validate a form. I have two text boxes on my form and only the first one will add the "This field is required." message. If I remove the "required" class from the first one the second will have the message.</p> <p>html:</p> <pre><code>&lt;form id="questionForm"&gt; &lt;div&gt;&lt;inpu...
6,295,176
5
0
null
2011-05-11 22:37:22.13 UTC
4
2021-05-26 06:17:11.937 UTC
2017-07-07 15:03:40.473 UTC
null
594,235
null
294,431
null
1
46
javascript|jquery|jquery-validate
14,226
<p>I just ran into this issue myself. Pulled my hair out for an hour, but here it is:</p> <p></p> <p>Throw the "name" attribute in there as well and that may do the trick.</p>
6,068,891
Difference between JSP forward and redirect
<p>Please explain the difference between <code>jsp:forward</code> and <code>redirect</code>. <br> What is happening in each case?</p>
6,068,925
7
1
null
2011-05-20 07:40:48.95 UTC
34
2019-03-18 17:47:51.757 UTC
2018-02-21 21:43:54.53 UTC
null
3,885,376
null
701,813
null
1
75
jsp|redirect|servlets|forward
79,605
<ul> <li><p>redirect sets the response status to 302 [1], and the new url in a <code>Location</code> header, and sends the response to the browser. Then the browser, according to the http specification, makes another request to the new url</p></li> <li><p>forward happens entirely on the server. The servlet container ju...
6,111,565
Now that we have std::array what uses are left for C-style arrays?
<p><code>std::array</code> is vastly superior to the C arrays. And even if I want to interoperate with legacy code, I can just use <code>std::array::data()</code>. Is there any reason I would ever want an old-school array?</p>
6,113,104
7
1
null
2011-05-24 13:58:01.227 UTC
22
2015-04-22 14:07:02.853 UTC
2014-03-23 13:39:10.69 UTC
null
2,684,539
null
46,642
null
1
91
c++|arrays|c++11|initialization
30,926
<p>Unless I've missed something (I've not followed the most recent changes in the standard too closely), most of the uses of C style arrays still remain. <code>std::array</code> does allow static initialization, but it still won't count the initializers for you. And since the only real use of C style arrays before <c...
5,628,771
strip decimal points from variable
<p>ok i know this is probably really easy but I am floundering.. I have a series of variables that have a decimal point and a few zeros. How do I strip the variable so it goes from 1.000 to 1 ? Dont think this is that important but the numbers are generated from an xml file that I am grabbing with jquery like ...</p>...
5,628,791
10
1
null
2011-04-11 23:34:58.533 UTC
9
2022-03-03 09:50:03.467 UTC
2021-11-12 19:11:47.51 UTC
null
8,172,439
null
82,330
null
1
47
javascript|jquery|xml|frontend|strip
86,688
<p>Simply... </p> <pre><code>Math.round(quantity); </code></pre> <p>...assuming you want to round <code>1.7</code> to <code>2</code>. If not, use <code>Math.floor</code> for <code>1.7</code> to <code>1</code>.</p>
5,818,403
Jenkins / Hudson environment variables
<p>I am running Jenkins from user <code>jenkins</code> thats has <code>$PATH</code> set to something and when I go into Jenkins web interface, in the <em>System Properties</em> window (<code>http://$host/systemInfo</code>) I see a different <code>$PATH</code>.</p> <p>I have installed Jenkins on Centos with the native ...
5,819,768
22
4
null
2011-04-28 12:12:48.753 UTC
31
2022-09-08 11:44:44.13 UTC
2017-02-04 22:10:05.187 UTC
null
400,222
null
599,912
null
1
104
jenkins|environment-variables|hudson
164,806
<p>Michael,</p> <p>Two things:</p> <p>When Jenkins connects to a computer, it goes to the <code>sh</code> shell, and not the <code>bash</code> shell (at least this is what I have noticed - I may be wrong). So any changes you make to $PATH in your bashrc file are not considered.</p> <p>Also, any changes you make to $...
4,860,991
F# for scripting: location of script file
<p>In an F# script file (.fsx), how can I determine the location of the .fsx file currently executing? I'd like to resolve paths relative to it.</p> <p>I tried <code>Assembly.GetExecutingAssembly().CodeBase</code> but that doesn't work in a "dynamic assembly", apparently.</p>
4,861,029
1
0
null
2011-02-01 09:42:15.79 UTC
5
2011-02-01 09:57:09.453 UTC
2011-02-01 09:57:09.453 UTC
null
42,921
null
42,921
null
1
28
scripting|f#|f#-scripting
4,111
<p>extract from F# spec:</p> <p>_<strong>_SOURCE_DIRECTORY__</strong> - Replaced by a literal verbatim string that specifies the name of the directory that contains the current file, for example, C:\source. The name of the current file is determined by the most recent line directive in the file. If no line directive h...
24,588,437
Convert date to float for linear regression on Pandas data frame
<p>It seems that for OLS linear regression to work well in Pandas, the arguments must be floats. I'm starting with a csv (called "gameAct.csv") of the form:</p> <pre><code>date, city, players, sales 2014-04-28,London,111,1091.28 2014-04-29,London,100,1100.44 2014-04-28,Paris,87,1001.33 ... </code></pre> <p>I want...
24,590,666
4
1
null
2014-07-05 16:32:18.43 UTC
10
2021-04-17 17:45:49.84 UTC
2014-07-05 20:11:21.75 UTC
null
3,687,439
null
3,687,439
null
1
21
python|pandas|time-series
37,884
<p>For this kind of regression, I usually convert the dates or timestamps to an integer number of days since the start of the data.</p> <p>This does the trick nicely:</p> <pre><code>df = pd.read_csv('test.csv') df['date'] = pd.to_datetime(df['date']) df['date_delta'] = (df['date'] - df['date'].min()) / np.timede...
24,633,618
What does numpy.gradient do?
<p>So I know what the gradient of a (mathematical) function is, so I feel like I should know what <code>numpy.gradient</code> does. But I don't. The <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.gradient.html" rel="noreferrer">documentation</a> is not really helpful either:</p> <blockquote> <p>R...
24,637,575
4
2
null
2014-07-08 13:51:20.677 UTC
28
2022-07-27 09:39:40.2 UTC
null
null
null
null
2,564,569
null
1
72
python|math|numpy
85,270
<blockquote> <p>The gradient is computed using central differences in the interior and first differences at the boundaries.</p> </blockquote> <p>and</p> <blockquote> <p>The default distance is 1</p> </blockquote> <p>This <a href="http://en.wikipedia.org/wiki/Finite_difference" rel="noreferrer">means</a> that i...
24,514,936
How can I serve NPM packages using Flask?
<p>I have a <a href="https://github.com/danvk/webdiff" rel="noreferrer">small Flask app</a> which currently sources jQuery and highlight.js from external servers. I'd like to make these local dependencies which I pull in via NPM.</p> <p>What is the standard practice for this? Should I create <code>package.json</code> ...
45,968,868
3
2
null
2014-07-01 16:11:36.973 UTC
14
2017-08-30 20:23:33.233 UTC
2017-05-23 11:46:54.7 UTC
null
-1
null
388,951
null
1
36
python|node.js|flask|npm|pip
22,048
<p>Go to your static folder and there initialize your npm project.</p> <pre><code>cd flask_app/static $ npm init </code></pre> <p>after installing and saving npm packages you can serve them like this:</p> <pre><code>&lt;script src="{{ url_for('static', filename='node_modules/toastr/toastr.js')}}"&gt;&lt;/script&gt; ...
69,631,437
Error: Cannot find module 'webpack/lib/rules/DescriptionDataMatcherRulePlugin' Require stack:
<p>I have webpack-cli installed on my laravel project. I don't know why first of all we need it to run my vue app but this is causing an error:</p> <p>When I run <strong>npm run dev</strong> or <strong>npm run hot</strong></p> <pre><code>[webpack-cli] Error: Cannot find module 'webpack/lib/rules/DescriptionDataMatcherR...
69,631,556
5
0
null
2021-10-19 13:10:12.357 UTC
10
2022-04-29 19:57:31.657 UTC
null
null
null
null
17,133,621
null
1
58
node.js|laravel|vue.js|webpack
49,686
<p>You need to update your vue-loader</p> <pre><code>npm update vue-loader </code></pre> <p>And if it is not installed, install it</p> <pre><code>npm i vue-loader </code></pre>