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
42,726,029
How to compile Less/Sass files in Visual Studio 2017+
<p>In VS &lt;= 2015 we can use a WebEssentials extension that takes care for compiling the less/sass files for us, but currently it does not support VS 2017. Is there a similar extension that can compile Less/Sass on build?</p>
42,726,151
5
0
null
2017-03-10 19:11:37.71 UTC
13
2022-04-18 01:16:53.23 UTC
2021-09-28 14:42:30.757 UTC
null
2,756,409
null
795,797
null
1
90
css|visual-studio|sass|visual-studio-2017|less
96,896
<p>WebEssentials is being split up into multiple extensions. I believe the functionality you want is now in the <a href="https://marketplace.visualstudio.com/items?itemName=MadsKristensen.WebCompiler" rel="noreferrer">Web Compiler</a> extension.</p> <p>If you want to do it without extensions, you could use a task run...
22,622,034
Frosted Glass Effect in JavaFX?
<p>I'm making an iOS7-themed JavaFX2/FXML project and I was wondering how I could make a Rectangle object have a iOS7-like frosted glass effect.</p> <p>I'd also like it to have a small shadow. This is tricky, since you might be able to see the shadow behind the semi-transparent object. I'd just like it to be present a...
22,630,754
1
0
null
2014-03-24 22:38:14.233 UTC
19
2016-12-06 23:59:10.837 UTC
2017-05-23 11:53:02.63 UTC
null
-1
null
2,965,505
null
1
15
java|user-interface|ios7|javafx-2|blur
13,326
<p><strong>Sample Solution</strong></p> <p><a href="https://i.stack.imgur.com/5BeG3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5BeG3.png" alt="frost"></a></p> <p>Run the program below and scroll or swipe up to show the glass pane.</p> <p>The purpose of the program is just to sample the techniques invo...
22,491,229
Load Testing and Benchmarking With siege vs wrk
<p>I have been looking around for tools that can help me to do load testing and benchmarking. I found a couple like:</p> <ul> <li><a href="https://github.com/wg/wrk" rel="nofollow noreferrer">https://github.com/wg/wrk</a></li> <li><a href="http://www.joedog.org/siege-home/" rel="nofollow noreferrer">http://www.joedog.o...
23,774,073
3
0
null
2014-03-18 21:16:59.83 UTC
39
2020-07-30 10:00:00.34 UTC
2020-07-30 10:00:00.34 UTC
null
366,904
null
1,881,450
null
1
23
benchmarking|performance-testing|stress-testing|siege|wrk
23,114
<p>I've used wrk and siege, siege is a really easy to use tool, but I'm not sure if you can test DELETE or PUT with siege.</p> <p>Wrk can use provided lua script to generate requests, so DELETE and PUT won't be a problem. AND wrk is a tool that can overpower NGINX static file server, so I think it's fast enough for ge...
39,074,678
how to end ng serve or firebase serve
<p>I've been doing web development with Angular2 and have been using both Angular2 and Firebase to run local servers. I haven't been able to find a command similar to typing quit when using Ionic to create a server, so I have to close the terminal tab each time. Is there a way to end the server and get my terminal tab ...
39,080,622
14
0
null
2016-08-22 08:30:59.117 UTC
30
2021-05-31 18:10:47.38 UTC
2018-11-29 12:12:10.64 UTC
null
4,000,674
null
3,543,254
null
1
151
angular|firebase|angular-cli|firebase-tools
271,661
<p>You can use the following command to end an ongoing process:</p> <p><kbd>ctrl</kbd> + <kbd>c</kbd></p>
39,247,411
How to add dynamically attribute in VueJs
<p>I'm using vuejs and I wanna know how to have control on inputs (add disabled attribute when necessary). Is there any way to add dynamically attribute in vuejs ? Below my <strong>Textfield component</strong> : </p> <pre><code> &lt;template&gt; &lt;input type="text" placeholder="{{ placeholder }}" v-model="va...
39,247,482
7
0
null
2016-08-31 10:41:43.267 UTC
10
2022-07-15 20:07:46.513 UTC
2018-11-05 16:08:24.637 UTC
null
2,825,966
null
1,706,697
null
1
76
javascript|vue.js|dynamic|vue-component
135,249
<p>You can bind it to a variable using <code>v-bind:disabled=&quot;foo&quot;</code> or <code>:disabled=&quot;foo&quot;</code> for short:</p> <pre><code>&lt;textfield label=&quot;Name&quot; value.sync=&quot;el.name&quot; :disabled=&quot;myVar&quot;&gt; </code></pre> <p>Then in Vue you can just set <code>this.myVar = tru...
50,694,913
Angular 6 - httpClient passing basic auth in httpOptions
<p>I have a service in Angular 6 and I'm trying to change a record but it's saying I'm not authorized.</p> <p>Right now I have this:</p> <pre><code>const httpOptions = { headers: new HttpHeaders({'Content-Type': 'application/json'}) }; update(id, title, content) { const updateData = { id: id, title: title, c...
50,694,988
7
0
null
2018-06-05 07:52:46.873 UTC
12
2021-10-07 12:35:53.03 UTC
null
null
null
user9855223
null
null
1
24
angular|typescript|angular6
65,567
<p>You can add basic authorization by appending it in headers, as below:</p> <pre><code>var headers_object = new HttpHeaders(); headers_object.append('Content-Type', 'application/json'); headers_object.append("Authorization", "Basic " + btoa("username:password")); const httpOptions = { headers: headers_object }; </...
20,902,583
AngularJs - Best-Practices on adding an active class on click (ng-repeat)
<p>I want to add an active class on click in a list, i tried the following code, but it adds the active class on all my items :/ :</p> <p><strong>HTML :</strong></p> <pre><code>&lt;div class="filters_ct" ng-controller="selectFilter"&gt; &lt;ul&gt; &lt;li ng-repeat="filters in filter" ng-click="select(ite...
20,903,079
4
0
null
2014-01-03 11:27:35.543 UTC
16
2015-03-12 05:38:59.15 UTC
2014-01-03 11:31:17.827 UTC
null
2,967,572
null
3,130,019
null
1
40
javascript|html|angularjs
78,945
<p>The best solution would be to target it via angulars <code>$index</code> which is the objects index/position in the array;</p> <p><strong>HTML</strong></p> <pre><code>&lt;div ng-app='app' class="filters_ct" ng-controller="selectFilter"&gt; &lt;ul&gt; &lt;li ng-repeat="filter in filters" ng-click="selec...
37,152,031
Numpy remove a dimension from np array
<p>I have some images I want to work with, the problem is that there are two kinds of images both are 106 x 106 pixels, some are in color and some are black and white. </p> <p>one with only two (2) dimensions:</p> <p>(106,106)</p> <p>and one with three (3)</p> <p>(106,106,3)</p> <p>Is there a way I can strip this ...
37,152,121
6
0
null
2016-05-11 02:20:55.47 UTC
9
2022-05-26 02:00:01.543 UTC
null
null
null
null
1,726,404
null
1
62
python|arrays|numpy
132,129
<p>You could use numpy's fancy indexing (an extension to Python's built-in slice notation):</p> <pre><code>x = np.zeros( (106, 106, 3) ) result = x[:, :, 0] print(result.shape) </code></pre> <p>prints</p> <pre><code>(106, 106) </code></pre> <p>A shape of <code>(106, 106, 3)</code> means you have 3 sets of things th...
31,254,435
How to select a portion of an image, crop, and save it using Swift?
<p>I am trying to create an iOS app using Swift to capture images and let the user save a selected portion of the image. In many cam based apps, I noticed that a rectangular frame is offered to let the users choose the desired portion. This involves either sliding the edges of the rectangle or moving the corners to fit...
31,323,789
5
0
null
2015-07-06 19:50:25.363 UTC
9
2020-06-17 06:45:55.217 UTC
null
null
null
null
3,681,985
null
1
18
ios|image|camera|uiimagepickercontroller|crop
38,095
<p>Found one more solution. This time it is in Swift. The solution looks elegant and the code relative to other such solutions is written in fewer number of lines.</p> <p>Here it is.. <a href="https://github.com/DuncanMC/CropImg" rel="nofollow noreferrer">https://github.com/DuncanMC/CropImg</a> Thanks to Duncan Champn...
5,762,836
What does "%1$#" mean when used in String.format (Java)?
<p>Language is Java. What does the <code>%1$#</code> mean in...</p> <pre><code>static String padright (String str, int num) { return String.format("%1$#" + num + "str", str); } </code></pre> <p>In the Java API, <code>String.format()</code> is used in this way:</p> <pre><code>public static String format(String for...
5,762,867
1
0
null
2011-04-23 07:11:15.08 UTC
10
2015-06-15 23:05:47.51 UTC
2012-08-22 17:47:00.223 UTC
null
328,725
null
320,844
null
1
23
java|string|format|string-formatting
45,316
<p>Template:</p> <pre><code>%[argument_index$][flags][width][.precision]conversion </code></pre> <blockquote> <p>The optional argument_index is a decimal integer indicating the position of the argument in the argument list. The first argument is referenced by "1$", the second by "2$", etc. </p> <p>Th...
24,657,326
How to use git branch with Android Studio
<p>I am new to git. I have a very simple scenario for using git. I had my first release written with Android Studio. Now I want to work with some new features. What I did so far:</p> <ol> <li>enabled the VCS in my Android Studio </li> <li>created a local repository for my project from Android Studio</li> <li>pushed my...
24,657,635
3
0
null
2014-07-09 15:08:39.18 UTC
20
2017-01-23 18:54:51.357 UTC
null
null
null
null
3,746,596
null
1
51
android|git|android-studio|git-branch
88,064
<p>You should be able to do this directly from Android studio.</p> <p>The easiest way is going to the <strong>bottom right corner</strong> of the Android Studio window where you should see the text "Git: branch name", in your case it should say "Git: master". Click on it and it will show a small menu consisting of the...
35,476,948
Remove empty or whitespace strings from array - Javascript
<p>I've found <a href="https://stackoverflow.com/a/19888749/4341456">this</a> beautiful method for removing empty strings - <code>arr = arr.filter(Boolean)</code>.</p> <p>But it doesn't seem to work on whitespace strings.</p> <pre><code>var arr = ['Apple', ' ', 'Mango', '', 'Banana', ' ', 'Strawberry']; arr = arr.fi...
35,476,997
9
0
null
2016-02-18 09:03:07.493 UTC
6
2020-12-09 03:55:55.48 UTC
2017-05-23 12:17:34.92 UTC
null
-1
null
4,341,456
null
1
22
javascript|arrays|regex|string|filter
50,536
<p><code>filter</code> works, but you need the right predicate function, which <code>Boolean</code> isn't (for this purpose):</p> <pre><code>// Example 1 - Using String#trim (added in ES2015, needs polyfilling in outdated // environments like IE) arr = arr.filter(function(entry) { return entry.trim() != ''; }); </code>...
2,674,468
Making Jenkins (Hudson) job depend on another job
<p>I have two jobs:</p> <ol> <li><em>Upload</em> </li> <li><em>Launch-instance</em></li> </ol> <p>I want to make <em>Launch-instance</em> dependent on the other one, so that triggering <em>Launch-instance</em> automatically causes <em>Upload</em> to be run first. </p> <p>Can I achieve this using built-in Jenkins fea...
7,496,963
5
2
null
2010-04-20 11:02:03.76 UTC
3
2019-07-23 17:13:59.793 UTC
2011-07-20 15:22:52.093 UTC
null
56,285
null
56,285
null
1
24
hudson|build-automation|jenkins
40,562
<p>Have you tried the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin" rel="noreferrer">Parametrized Trigger Plugin</a>?</p> <p>You can use it as a build step, and mark the checkbox for "Block until the triggered projects finish their builds". That should be exactly what you are looki...
2,925,153
Can I pass an array as arguments to a method with variable arguments in Java?
<p>I'd like to be able to create a function like:</p> <pre><code>class A { private String extraVar; public String myFormat(String format, Object ... args){ return String.format(format, extraVar, args); } } </code></pre> <p>The problem here is that <code>args</code> is treated as <code>Object[]</code> in the...
2,925,300
5
3
null
2010-05-27 21:36:38.8 UTC
53
2021-02-11 04:58:04.027 UTC
2010-05-28 08:53:17.67 UTC
null
179,878
null
352,382
null
1
338
java|arrays|backwards-compatibility|variadic-functions
268,128
<p>The underlying type of a <a href="https://en.wikipedia.org/wiki/Variadic" rel="noreferrer">variadic</a> method <code>function(Object... args)</code> <em>is</em> <code>function(Object[] args)</code>. Sun added varargs in this manner to preserve backwards compatibility.</p> <p>So you should just be able to prepend <co...
3,002,168
Should a service layer return view models for an MVC application?
<p>Say you have an ASP.NET MVC project and are using a service layer, such as in this contact manager tutorial on the asp.net site: <a href="http://www.asp.net/mvc/tutorials/iteration-4-make-the-application-loosely-coupled-cs" rel="noreferrer">http://www.asp.net/mvc/tutorials/iteration-4-make-the-application-loosely-c...
3,002,303
6
3
null
2010-06-08 23:45:03.263 UTC
19
2020-11-10 08:14:49.93 UTC
2014-09-07 21:05:45.133 UTC
null
727,208
null
282,606
null
1
65
asp.net-mvc|service-layer|asp.net-mvc-viewmodel
22,227
<p>Generally, no. </p> <p>View models are intended to provide information to and from views and should be specific to the application, as opposed to the general domain. Controllers should orchestrate interaction with repositories, services (I am making some assumptions of the definition of service here), etc and handl...
3,046,449
Calculate the contentsize of scrollview
<p>I'm having a scrollview as the detailedview of tableview cell. There are multiple views on the detailedview like labels, buttons etc. which I'm creating through interface builder. What I'm creating through interface builder is static. I'm putting everything on a view of height 480. </p> <p>A label on my detailedvie...
3,080,525
7
0
null
2010-06-15 15:08:20.363 UTC
10
2019-04-17 03:32:45.603 UTC
null
null
null
null
227,943
null
1
7
iphone|uiscrollview
23,552
<p>You could try to use the scrollview'ers ContentSize. It worked for me and I had the same problem with the control using dynamic content.</p> <pre><code> // Calculate scroll view size float sizeOfContent = 0; int i; for (i = 0; i &lt; [myScrollView.subviews count]; i++) { UIView *view =[myScrollView.subviews ...
2,806,693
Why isn't there a regular expression standard?
<p>I know there is the perl regex that is sort of a minor de facto standard, but why hasn't anyone come up with a universal set of standard symbols, syntax and behaviors?</p>
2,806,733
7
1
null
2010-05-10 21:48:54.873 UTC
7
2021-10-04 13:56:12.953 UTC
null
null
null
null
333,861
null
1
43
regex|standards
8,051
<p>There is a standard by <a href="http://en.wikipedia.org/wiki/Regular_expression#POSIX_.28Portable_Operating_System_Interface_.5Bfor_Unix.5D.29" rel="nofollow noreferrer">IEEE associated with the POSIX effort</a>. The real question is <em>&quot;why doesn't everyone follow it&quot;</em>? The answer is probably that ...
2,826,029
Passing additional variables from command line to make
<p>Can I pass variables to a GNU Makefile as command line arguments? In other words, I want to pass some arguments which will eventually become variables in the Makefile.</p>
2,826,178
8
0
null
2010-05-13 10:31:50.807 UTC
200
2022-02-04 07:13:51.273 UTC
2016-11-11 05:59:14.433 UTC
null
5,236,093
null
315,427
null
1
843
makefile|gnu|command-line-arguments
744,582
<p>You have several options to set up variables from outside your makefile:</p> <ul> <li><p><strong>From environment</strong> - each environment variable is transformed into a makefile variable with the same name and value.</p> <p>You may also want to set <code>-e</code> option (aka <code>--environments-override</cod...
2,762,611
Why would a Delphi programmer use Lazarus as the IDE instead of using Delphi's IDE?
<p>I've been very happy with the Delphi IDE for programming in Delphi. </p> <p>But I've heard about the <a href="http://www.lazarus.freepascal.org/index.php?PHPSESSID=57d8d7652b6acbce0a69f0d93ae87ee9&amp;page=7" rel="noreferrer">Lazarus</a> programming environment, and I've also heard that some Delphi programmers use ...
2,762,741
12
14
null
2010-05-04 03:21:26.863 UTC
11
2017-05-22 20:06:04.51 UTC
2010-05-05 00:00:32.553 UTC
null
30,176
null
30,176
null
1
47
delphi|ide|lazarus
47,775
<p>Well a Delphi programmer cannot use Lazarus to write Delphi code because Lazarus is not Delphi. Lazarus is actually an IDE and a bunch of Delphi-ish class libraries for Free Pascal. But note, things like Delphi's VCL is not there, and to be perfectly blunt the IDE and debugging experiences in Lazarus are pretty spot...
2,514,445
Turning off auto indent when pasting text into vim
<p>I am making the effort to learn Vim.</p> <p>When I paste code into my document from the clipboard, I get extra spaces at the start of each new line:</p> <pre><code>line line line </code></pre> <p>I know you can turn off auto indent but I can't get it to work because I have some other settings conflicting or...
2,514,520
25
4
null
2010-03-25 09:52:47.883 UTC
519
2022-06-01 08:11:59.553 UTC
2018-05-03 14:57:49.86 UTC
null
42,223
null
63,810
null
1
1,426
vim|configuration|editor|indentation|auto-indent
538,275
<p><strong>Update:</strong> Better answer here: <a href="https://stackoverflow.com/a/38258720/62202">https://stackoverflow.com/a/38258720/62202</a></p> <p>To turn off autoindent when you paste code, there's a special "paste" mode.</p> <p>Type </p> <pre><code>:set paste </code></pre> <p>Then paste your code. Note t...
23,853,553
Python Pandas: How to read only first n rows of CSV files in?
<p>I have a very large data set and I can't afford to read the entire data set in. So, I'm thinking of reading only one chunk of it to train but I have no idea how to do it. Any thought will be appreciated.</p>
23,853,569
2
0
null
2014-05-25 08:50:00.203 UTC
31
2022-07-22 05:45:04.277 UTC
2018-04-11 00:03:09.977 UTC
null
202,229
null
1,334,657
null
1
164
python|pandas|csv|file-io
210,619
<p>If you only want to read the first 999,999 (non-header) rows:</p> <pre><code>read_csv(..., nrows=999999) </code></pre> <p>If you only want to read rows 1,000,000 ... 1,999,999</p> <pre><code>read_csv(..., skiprows=1000000, nrows=999999) </code></pre> <p><strong><em>nrows</em></strong> : int, default None Number ...
42,340,649
What is `cdk` in Angular Material 2 components
<p>In multiple places within angular material source, there are elements/ css classes that have <code>cdk</code> as their prefix.</p> <p>Does anyone know what the abbreviation for <code>cdk</code> in angular material context?</p>
42,370,299
4
0
null
2017-02-20 09:22:21.21 UTC
12
2019-03-12 04:41:39.89 UTC
2018-03-28 21:17:54.877 UTC
null
4,694,994
null
211,794
null
1
114
angular-material2|angular-cdk
36,587
<p>CDK is the short form of <code>component dev kit</code>. This signifies that these are general-purpose tools for building components that are not coupled to Material Design</p> <p>From the <a href="https://github.com/angular/material2/blob/master/CHANGELOG.md" rel="noreferrer">material2 changelog</a></p> <ul> <li...
10,435,697
TestFlight rejecting build "get-task-allow" error
<p>So I'm using testflightapp to distribute an ad-hoc build.</p> <p>But I keep getting this message: 'Invalid Profile: distribution build entitlements must have get-task-allow set to false.'</p> <p>I don't have an entitlements file for my App, so XCode automatically produces one and includes it in the build. I unzip ...
10,436,081
11
0
null
2012-05-03 16:39:37.983 UTC
5
2016-07-04 18:41:45.94 UTC
2012-05-03 16:41:42.64 UTC
null
141,172
null
545,129
null
1
39
testflight
26,846
<p>Turns out the Code-Signing Identity in my build configuration didn't match the one I selected when I saved the archive for Ad-Hoc distribution.</p>
30,808,430
How to select columns from dataframe by regex
<p>I have a dataframe in python pandas. The structure of the dataframe is as the following: </p> <pre><code> a b c d1 d2 d3 10 14 12 44 45 78 </code></pre> <p>I would like to select the columns which begin with d. Is there a simple way to achieve this in python . </p>
30,808,571
7
0
null
2015-06-12 16:55:19.12 UTC
19
2021-10-25 18:09:45.85 UTC
2015-06-12 19:25:53.117 UTC
null
2,411,802
null
4,867,396
null
1
105
python|python-2.7|pandas
86,678
<p>You can use <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.filter.html" rel="noreferrer"><code>DataFrame.filter</code></a> this way:</p> <pre class="lang-py prettyprint-override"><code>import pandas as pd df = pd.DataFrame(np.array([[2,4,4],[4,3,3],[5,9,1]]),columns=['d','t','...
47,210,512
Using PyKalman on Raw Acceleration Data to Calculate Position
<p>This is my first question on Stackoverflow, so I apologize if I word it poorly. I am writing code to take raw acceleration data from an IMU and then integrate it to update the position of an object. Currently this code takes a new accelerometer reading every milisecond, and uses that to update the position. My syste...
48,069,535
1
0
null
2017-11-09 19:58:37.51 UTC
11
2020-08-19 13:55:35.013 UTC
null
null
null
null
8,915,916
null
1
17
python|noise|kalman-filter|pykalman
13,000
<p>You can use a Kalman Filter in this case, but your position estimation will strongly depend on the precision of your acceleration signal. The Kalman Filter is actually useful for a fusion of several signals. So error of one signal can be compensated by another signal. Ideally you need to use sensors based on differe...
32,900,809
How to suppress "function is never used" warning for a function used by tests?
<p>I'm writing a program in Rust and I have some tests for it. I wrote a helper function for these tests, but whenever I build using <code>cargo build</code> it warns me that the function is never used:</p> <blockquote> <p>warning: function is never used: ... #[warn(dead_code)] on by default</p> </blockquote> <p>Ho...
32,908,553
7
1
null
2015-10-02 05:00:13.56 UTC
8
2021-12-11 21:01:09.5 UTC
2015-10-02 14:58:59.217 UTC
null
155,423
null
1,636,594
null
1
60
rust
25,635
<h3>Specific question</h3> <blockquote> <p>How I can mark this function as used so as not to get the warnings?</p> </blockquote> <p>The Rust compiler runs many <a href="https://en.wikipedia.org/wiki/Lint_(software)" rel="noreferrer">lints</a> to warn you about possible issues in your code and the <code>dead_code</code>...
20,984,183
Best way to preload images with Angular.js
<p>Angular's ng-src keeps previous model until it preloads image internally. I am using different image for the banner on each page, when I switch routes, i change main view, leaving header view as it is, just changing bannerUrl model when I have it. </p> <p>This is resulting in seeing previous banner image while new ...
20,990,053
9
2
null
2014-01-07 23:31:35.89 UTC
19
2017-09-15 04:06:04.29 UTC
null
null
null
null
3,001,647
null
1
26
javascript|angularjs|image-preloader
53,026
<p>Having the 2 urls on the directive seems a touch overcomplicated. What I think is better is to write a directive that works like:</p> <pre><code>&lt;img ng-src="{{bannerUrl}}" spinner-on-load /&gt; </code></pre> <p>And the directive can watch <code>ng-src</code> and (for example) set visibility:false with a spinne...
21,916,870
Apply [Authorize] attribute implicitly to all Web API controllers
<p>My application is setup where all requests except login must be 'authorized' using the authorization attribute in Web API. E.g.</p> <pre><code> [Authorize] [HttpGet, Route("api/account/profile")] public ApplicationUser Profile() { return userModel; } </code></pre> <p>and only the login needs to not aut...
21,917,732
5
0
null
2014-02-20 18:49:11.46 UTC
11
2021-09-03 12:35:23.907 UTC
2018-01-17 12:15:59.897 UTC
null
1,023,618
null
1,288,340
null
1
37
c#|.net|asp.net-web-api|asp.net-web-api2
30,904
<p>You have two options</p> <ol> <li><p>Controller level by decorating your controller with authorize attribute. </p> <pre><code>[Authorize] [RoutePrefix("api/account")] public class AccountController : ApiController { </code></pre></li> <li><p>You can also set it global level to all routes, in <code>Register</code>...
28,041,953
Create table with date column
<p>I want to create a student table with column 'student_birthday' and its format should be dd-mm-yy.</p> <pre><code>create table `student`.`studentinfo`( `student_id` int(10) not null auto_increment, `student_name` varchar(45) not null, `student_surname` varchar(45) not null, `student_birthday` date(?...
28,042,040
3
0
null
2015-01-20 09:38:23.297 UTC
1
2019-12-06 10:15:13.92 UTC
2015-01-22 18:27:29.497 UTC
null
114,823
null
2,531,488
null
1
15
mysql
102,355
<p>Just use "DATE" without the brackets. The brackets are only needed for certain column types where you want to specify the maximum number of bytes/characters that can be stored.</p> <p>For MySQL, it's documented at <a href="https://dev.mysql.com/doc/refman/5.7/en/date-and-time-types.html" rel="noreferrer">https://de...
28,281,653
How to listen to global hotkeys with Swift in a macOS app?
<p>I'm trying to have a handler in my Mac OS X app written in Swift for a global (system-wide) hotkey combo but I just cannot find proper documentation for it. I've read that I'd have to mess around in some legacy Carbon API for it, is there no better way? Can you show me some proof of concept Swift code? Thanks in adv...
34,864,422
7
1
null
2015-02-02 15:58:22.893 UTC
27
2022-01-22 19:04:44.5 UTC
2022-01-03 02:11:00.613 UTC
null
64,949
null
740,002
null
1
49
swift|macos|cocoa|keyboard-shortcuts
13,580
<p>Since Swift 2.0, you can now pass a function pointer to C APIs.</p> <pre><code>var gMyHotKeyID = EventHotKeyID() gMyHotKeyID.signature = OSType("swat".fourCharCodeValue) gMyHotKeyID.id = UInt32(keyCode) var eventType = EventTypeSpec() eventType.eventClass = OSType(kEventClassKeyboard) eventType.eventKind = OSType(...
8,461,005
How to force the form focus?
<p>How can I force the focus of an form? <code>.Focus()</code> is not working for me.</p> <pre><code>private void button1_Click(object sender, EventArgs e) { var form = new loginForm(); if (Application.OpenForms[form.Name] == null) { form.Show(); } else { form.Focus(); } } </code></p...
8,461,035
5
0
null
2011-12-11 00:25:24.45 UTC
2
2020-03-11 13:48:31.893 UTC
2011-12-11 01:30:00.33 UTC
null
825,024
null
800,123
null
1
14
c#|.net|winforms|focus
77,683
<p>it should be </p> <pre><code>private void button1_Click(object sender, EventArgs e) { var form = new loginForm(); if (Application.OpenForms[form.Name] == null) { form.Show(); } else { Application.OpenForms[form.Name].Focus(); } } </code></pre>
8,593,303
Could not connect to SMTP host: email-smtp.us-east-1.amazonaws.com, port: 465, response: -1
<p>I am trying to send email with Amazon's SES/SMTP and I am getting the following error:</p> <p><em><strong>javax.mail.MessagingException: Could not connect to SMTP host: email-smtp.us-east-1.amazonaws.com, port: 465, response: -1</em></strong></p> <p>Here is how I am trying to send the mail:</p> <p>Spring mail sen...
8,623,335
7
0
null
2011-12-21 16:46:44.117 UTC
7
2019-09-13 17:37:01.81 UTC
2012-01-25 09:09:29.833 UTC
null
45,773
null
536,299
null
1
14
smtp|amazon-web-services|ssl|amazon-ses
40,255
<p>With amazon SES, configuration needs to be as follows:</p> <pre><code>&lt;prop key="mail.smtp.auth"&gt;true&lt;/prop&gt; &lt;prop key="mail.smtp.ssl.enable"&gt;true&lt;/prop&gt; </code></pre> <p>instead of:</p> <pre><code>&lt;prop key="mail.smtp.auth"&gt;true&lt;/prop&gt; &lt;prop key="mail.smtp.starttls.enab...
8,707,586
Symfony 2 Forward Request passing along GET/POST params
<p>Is it possible to forward a request, passing along all GET/POST params? </p> <p>I think if I just do </p> <pre><code>$this-&gt;forward('dest') </code></pre> <p>I will go to <code>dest</code> without any GET/POST params?</p> <p><strong>UPDATE</strong></p> <p>My objective is actually to have a controller action l...
8,713,594
4
0
null
2012-01-03 03:25:44.56 UTC
2
2017-12-20 20:53:44.413 UTC
2012-01-03 03:38:32.053 UTC
null
292,291
null
292,291
null
1
15
php|symfony|forwarding
39,034
<p>I don't see any reason here to forward the request back through the kernel. You can go the route of encapsulating this logic in a checker service, as you've suggested, or you may be able to create a <code>kernel.request</code> listener that runs after the router listener and applies the <code>_controller</code> attr...
8,985,053
NSSet to NSArray casting calling objectAtIndex?
<p>I'm trying to update an MKMapView by removing all annotations outside the visible area, and adding and removing some annotations inside the visible area. This is my code:</p> <pre><code>NSSet *visibleAnnotations = [mapView annotationsInMapRect:[mapView visibleMapRect]]; NSSet *allAnnotations = [NSSet setWithArray:[...
8,985,088
6
0
null
2012-01-24 10:13:27.017 UTC
7
2019-11-27 14:49:33.097 UTC
null
null
null
null
49,128
null
1
50
objective-c|ios|nsarray|mkmapview|nsset
52,726
<p>Despite you're casting <code>NSMutableSet</code> to <code>NSArray</code>, that simple casting won't make <code>NSSet</code> class respond to <code>NSArray</code>'s messages. You have to fill an actual <code>NSArray</code> with the elements of the <code>NSSet</code> like this:</p> <pre><code>NSArray *array = [theNsS...
39,652,122
How to list all category from custom post type?
<p>I have a post type called 'dining' and has a taxonomy called 'dining-category'.</p> <p>What I want to do is, I want to display all the category from post type 'dining' in my footer area.</p>
39,652,814
4
0
null
2016-09-23 03:31:01.407 UTC
4
2021-03-30 05:13:17.6 UTC
2016-09-23 03:38:46.863 UTC
null
616,443
null
3,199,555
null
1
14
wordpress
75,965
<p>In WordPress 4.6 <code>get_terms</code> is deprecated. So there is an alternate of this (<code>get_categories</code>) <a href="https://developer.wordpress.org/reference/functions/get_categories/" rel="noreferrer">Read this</a></p> <p><strong>And here is Example code:</strong></p> <pre><code>&lt;?php $args = arr...
13,159,272
How to export data in CSV format using Java?
<p>The reason may be the the short of knowledge in java :( ,so I'm asking this question,</p> <p>Here in this piece of code I'm getting dynamic value(from a jsp page) :</p> <pre><code>&lt;form action=""&gt; &lt;% Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysq...
13,159,689
2
5
null
2012-10-31 13:37:12.813 UTC
3
2012-11-01 14:56:11.38 UTC
2012-10-31 13:59:59.49 UTC
null
3,340
null
1,422,086
null
1
1
java|jsp|servlets
45,321
<p>here is a class you can using to export to CSV:</p> <pre><code>import java.io.FileWriter; import java.io.IOException; import User; public class GenerateCsv { private static void generateCsvFile(ArrayList&lt;User&gt; users) { String output = "Email, Name\n"; for (User user in users) { ...
6,388,793
Using an IHttpAsyncHandler to call a WebService Asynchronously
<p>Here's the basic setup. We have an ASP.Net WebForms application with a page that has a Flash application that needs to access an external Web Service. Due to (security I presume) limitations in Flash (don't ask me, I'm not a Flash expert at all), we can't connect to the Web Service directly from Flash. The work arou...
6,389,323
1
0
null
2011-06-17 16:28:27.547 UTC
10
2011-06-17 17:15:47.73 UTC
2011-06-17 16:40:33.993 UTC
null
15,861
null
15,861
null
1
6
c#|.net|asp.net|asynchronous|ihttpasynchandler
6,505
<p>Wow, yeah you can make this a lot easier/cleaner if you're on .NET 4.0 by leveraging the Task Parallel Library. Check it:</p> <pre><code>public class MyAsyncHandler : IHttpAsyncHandler { public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData) { // NOTE: the r...
6,359,673
How do I dynamically create the variable name in a PHP loop?
<p>Ok so i have this php foreach loop</p> <pre><code>&lt;?php foreach ($step_count-&gt;rows as $step) { ?&gt; </code></pre> <p>and $step will be the step numbers 1, 2, 3, 4, 5 up to the total steps </p> <p>within the loop i a need to set the value of the images within the loop to standard_image_1 or whatever step th...
6,359,710
1
0
null
2011-06-15 14:50:23.027 UTC
4
2011-06-15 15:03:25.127 UTC
2011-06-15 15:03:25.127 UTC
null
610,573
null
223,367
null
1
12
php|loops|variable-variables
42,719
<p>Look at the docs for "variable variables" - <a href="http://php.net/manual/en/language.variables.variable.php" rel="noreferrer">http://php.net/manual/en/language.variables.variable.php</a></p> <pre><code>&lt;?php echo ${'standard_image_'.$step['number']}; ?&gt; </code></pre> <p>Here's a mock-up, using the details ...
41,916,386
ARG or ENV, which one to use in this case?
<p>This could be maybe a trivial question but reading docs for <a href="https://docs.docker.com/engine/reference/builder/#arg" rel="noreferrer">ARG</a> and <a href="https://docs.docker.com/engine/reference/builder/#env" rel="noreferrer">ENV</a> doesn't put things clear to me.</p> <p>I am building a PHP-FPM container an...
41,919,137
2
2
null
2017-01-29 00:24:58.153 UTC
40
2021-02-15 14:52:09.247 UTC
2021-02-15 14:52:09.247 UTC
null
1,815,058
null
719,427
null
1
174
docker|arguments|environment-variables|dockerfile
142,248
<p>From <a href="https://docs.docker.com/engine/reference/builder/" rel="noreferrer">Dockerfile reference</a>:</p> <blockquote> <ul> <li><p>The <code>ARG</code> instruction defines a variable that users can pass at build-time to the builder with the docker build command using the <code>--build-arg &lt;varname&gt;=&lt;v...
3,002,438
The HTTP request was forbidden with client authentication scheme 'Anonymous'
<p>I am trying to configure a WCF server\client to work with SSL</p> <p>I get the following exception:</p> <blockquote> <p>The HTTP request was forbidden with client authentication scheme 'Anonymous'</p> </blockquote> <p>I have a self hosted WCF server. I have run hhtpcfg both my client and server certificates a...
3,013,760
2
0
null
2010-06-09 00:57:25.867 UTC
3
2013-03-07 03:54:49.03 UTC
2013-03-07 03:54:49.03 UTC
null
1,210,760
null
106,865
null
1
15
wcf|security|https|certificate
44,577
<p>The trick was to make the Client Certificate valid,</p> <p>To do that you have two option:</p> <p>1) make it self signed and then put it under the "Trusted Root Certification Authority".</p> <p>Obviously in production you would like your client certificate to be signed by a trusted CA and not self signed. see <a ...
2,342,974
When does the browser execute Javascript? How does the execution cursor move?
<p>I was wondering if there are any available resources that describe how a browser's cursor executes Javascript.</p> <p>I know it loads and executes tags when a page loads, and that you can attach functions to various window events, but where things get fuzzy is when, for instance, I retrieve a remote page via AJAX ...
2,343,051
2
3
null
2010-02-26 16:13:12.7 UTC
33
2012-09-04 12:04:11.367 UTC
2012-09-04 12:04:11.367 UTC
null
-1
null
208,066
null
1
63
javascript|ajax
42,139
<p>The answer varies depending on where the script tag is and how you've added it:</p> <ol> <li><p>Script tags inline with your markup are executed synchronously with the browser's processing of that markup (except, see #2), and so if -- for instance -- those tags reference external files, they tend to slow down the p...
33,033,129
Xcode 7.1 Swift 2 Unknown class in Interface Builder file
<p>I've created new Cocoa Touch File. Named it SwipingViewController. <img src="https://i.stack.imgur.com/rSGPF.png" alt="enter image description here"></p> <p>Then try to add Custom Class to ViewController.</p> <p>And when I run the app I receive an error</p> <blockquote> <p><strong>2015-10-09 10:53:25.054 ParseS...
33,034,445
8
0
null
2015-10-09 08:08:54.953 UTC
9
2019-03-23 10:41:22.977 UTC
2018-01-15 05:22:39.163 UTC
null
1,033,581
null
5,343,376
null
1
52
ios|xcode|swift|cocoa
39,718
<p>In storyboard below the Custom Class field the module is set to None. Change that to your app module or just remove and enter class again, it should set to default like this:</p> <p><img src="https://i.stack.imgur.com/iuVFL.png" alt=""></p>
42,148,583
Pyspark filter dataframe by columns of another dataframe
<p>Not sure why I'm having a difficult time with this, it seems so simple considering it's fairly easy to do in R or pandas. I wanted to avoid using pandas though since I'm dealing with a lot of data, and I believe <code>toPandas()</code> loads all the data into the driver’s memory in pyspark.</p> <p>I have 2 datafram...
42,149,646
1
0
null
2017-02-09 23:04:08.017 UTC
7
2021-12-13 20:33:04.267 UTC
2021-08-20 03:49:55.863 UTC
null
10,954,152
null
2,539,931
null
1
38
python-2.7|apache-spark|dataframe|pyspark|apache-spark-sql
47,118
<p>Left anti join is what you're looking for:</p> <pre><code>df1.join(df2, ["userid", "group"], "leftanti") </code></pre> <p>but the same thing can be done with left outer join:</p> <pre><code>(df1 .join(df2, ["userid", "group"], "leftouter") .where(df2["pick"].isNull()) .drop(df2["pick"])) </code></pre>
41,632,225
Android - Where and how securely is fingerprint information stored in a device
<p>I have been reading quite a bit about fingerprint sensors and their growing presence in smart phones. I understand that at the basic level, there is a digital image that gets registered and it serves as a template for authentication. I understand that fingerprint related processing takes place in a Trusted Execution...
41,632,309
1
0
null
2017-01-13 10:19:12.603 UTC
9
2017-01-16 08:10:29.533 UTC
null
null
null
null
5,962,381
null
1
11
android|fingerprint|android-fingerprint-api
13,880
<blockquote> <p>Trusted Execution Environment (TEE)</p> </blockquote> <p>Google has made a noteworthy step in the right direction by moving all print data manipulation to the Trusted Execution Environment (TEE) and providing strict guidelines for fingerprint data storage that manufacturers must follow. </p> <ul> <l...
64,718,274
how to update python in raspberry pi
<p>I need python newest version in raspberry pi.<br> I tried <code>apt install python3 3.8</code><br> <code>apt install python3</code> but this didnot work.<br> And I also needed to update my raspberry pi python <strong>IDLE</strong></p>
64,737,929
3
2
null
2020-11-06 16:27:05.81 UTC
7
2021-06-01 10:40:39 UTC
null
null
null
null
14,589,833
null
1
13
python|python-3.x|raspberry-pi|raspberry-pi3
42,253
<p>First update the Raspbian.</p> <pre><code>sudo apt-get update </code></pre> <p>Then install the prerequisites that will make any further installation of Python and/or packages much smoother.</p> <pre><code>sudo apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-d...
33,851,379
How to install pyaudio on mac using Python 3?
<p>I first tried:</p> <pre><code>pip install pyaudio </code></pre> <p>but I was told that</p> <pre><code>-bash: pip: command not found </code></pre> <p>Then I tried:</p> <pre><code>pip3 install pyaudio </code></pre> <p>Then I got:</p> <pre><code>src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found #...
33,851,618
9
0
null
2015-11-22 03:46:24.65 UTC
10
2022-08-12 18:46:38.607 UTC
2021-03-27 03:08:21.2 UTC
null
2,745,495
null
5,590,767
null
1
39
python|python-3.x|macos|pyaudio
67,785
<p>I'm assuming you are on a Mac. This is a simple issue to fix. </p> <p>First install Xcode. Then restart your computer. Afterwards run the commands in sequence,</p> <pre class="lang-bash prettyprint-override"><code>xcode-select --install brew remove portaudio brew install portaudio pip3 install pyaudio </code></pre...
33,553,828
Page transition animations with Angular 2.0 router and component interface promises
<p>In Angular 1.x we can use ngAnimate to detect when we are leaving or entering a particular route. Furthermore we are able to apply behaviors to them:</p> <pre><code>animateApp.animation('.myElement', function(){ return { enter : function(element, done) { //Do something on enter }, ...
33,554,846
2
0
null
2015-11-05 20:08:08.75 UTC
8
2017-09-19 13:57:28.787 UTC
2017-09-19 13:57:28.787 UTC
null
5,765,795
null
5,468,991
null
1
25
angular|typescript|promise
14,029
<p>As you quoted from the docs, if any of this hooks returns a Promise it will wait until its completed to move to the next one, so you can easily return a Promise that basically does nothing and wait a second (or as many time as you need).</p> <p></p> <pre><code> onActivate(next: ComponentInstruction, prev: Componen...
22,985,671
How to Check either Session is Set or Not in Codeigniter?
<p>I know how to create session in core PHP, and I have understand how to do this in codeigniter, but I am unable to understand how to check, if the session is set or not? I have tried to check this through View but it always give me the meesage <code>Please Login</code>. </p> <p>Kindly tell me how can I check whether...
22,986,040
3
0
null
2014-04-10 10:40:24.763 UTC
2
2018-08-18 06:47:44.63 UTC
2014-04-10 12:55:05.913 UTC
null
988,174
null
3,480,644
null
1
6
php|html|mysql|codeigniter|session
69,467
<p>Creating Session:</p> <pre><code>$newdata = array( 'username' =&gt; 'johndoe', 'email' =&gt; 'johndoe@some-site.com', 'logged_in' =&gt; TRUE ); $this-&gt;session-&gt;set_userdata($newdata); </code></pre> <p>or</p> <pre><code> $this-&gt;session-&gt;set...
1,741,415
Linux Kernel Modules: When to use try_module_get / module_put
<p>I was reading the LKMPG ( <a href="http://tldp.org/LDP/lkmpg/2.6/html/x569.html" rel="noreferrer">See Section 4.1.4. Unregistering A Device</a> ) and it wasn't clear to me when to use the <code>try_module_get / module_put</code> functions. Some of the LKMPG examples use them, some don't.</p> <p>To add to the confu...
6,079,839
1
2
null
2009-11-16 10:50:32.217 UTC
9
2011-05-21 05:32:56.88 UTC
2009-11-17 10:28:28.553 UTC
null
71,074
null
71,074
null
1
23
linux-kernel|linux-device-driver|kernel-module
16,512
<p>You should essentially never have to use try_module_get(THIS_MODULE); pretty much all such uses are unsafe since if you are already in your module, it's too late to bump the reference count -- there will always be a (small) window where you are executing code in your module but haven't incremented the reference coun...
19,866,192
How to get base URL in Web API controller?
<p>I know that I can use <code>Url.Link()</code> to get URL of a specific route, but how can I get Web API base URL in Web API controller?</p>
19,866,294
16
0
null
2013-11-08 18:35:33.897 UTC
8
2020-08-03 17:01:32.193 UTC
2015-11-16 15:46:16.257 UTC
null
3,474,146
null
1,267,021
null
1
84
url|asp.net-web-api|base-url|asp.net-web-api2
185,882
<p>You could use <code>VirtualPathRoot</code> property from <code>HttpRequestContext</code> (<code>request.GetRequestContext().VirtualPathRoot</code>)</p>
40,154,104
Spark 2.0, DataFrame, filter a string column, unequal operator (!==) is deprecated
<p>I am trying to filter a DataFrame by keeping only those rows that have a certain string column non-empty.</p> <p>The operation is the following:</p> <pre><code>df.filter($"stringColumn" !== "") </code></pre> <p>My compiler shows that the !== is deprecated since I moved to Spark 2.0.1</p> <p>How can I check if a ...
40,154,140
2
0
null
2016-10-20 12:12:35.06 UTC
2
2022-02-22 16:27:30.37 UTC
2016-10-20 12:15:24.127 UTC
null
1,374,804
null
1,374,804
null
1
26
apache-spark|spark-dataframe
45,070
<p>Use <code>=!=</code> as a replacement:</p> <pre><code>df.filter($"stringColumn" =!= "") </code></pre>
36,857,441
When adding Facebook SDK " appeventslogger.activateapp(this)" is shown deprecated
<p>Using Facebook SDK 4.5. Tried using SDK 4.5 to 4.11. Problem still facing.</p> <p>AS per this changelog : <a href="https://developers.facebook.com/docs/android/change-log-4.x">https://developers.facebook.com/docs/android/change-log-4.x</a></p> <p>Its changed to AppEventsLogger.activateApp(Application)</p> <p>But ...
36,889,612
1
0
null
2016-04-26 06:57:05.353 UTC
3
2017-02-20 17:14:53.78 UTC
2016-04-28 08:20:51.387 UTC
null
3,618,581
null
4,326,383
null
1
44
android|facebook|android-studio-2.0
12,135
<p>Just replace <code>AppEventsLogger.activateApp(this)</code> to </p> <pre><code>AppEventsLogger.activateApp(getApplication()); </code></pre>
27,389,974
Locally installed versus globally installed NPM modules
<p>In my <code>package.json</code> file, I have bower listed as a dependency. After I run <code>npm install</code>, bower gets installed locally. When I try to run bower after installing it locally I get an error </p> <blockquote> <p>"bower" is not recognized as an internal or external command</p> </blockquote> <p>...
27,390,102
4
0
null
2014-12-09 22:21:14.35 UTC
5
2018-08-27 13:28:55.103 UTC
2018-08-27 13:28:55.103 UTC
null
3,924,118
null
668,545
null
1
41
node.js|npm|windows-7|bower
38,776
<p>Installing locally makes bower available to the current project (where it stores all of the node modules in <code>node_modules</code>). This is usually only good for using a module like so <code>var module = require('module');</code> It will not be available as a <strong>command</strong> that the shell can resolve...
21,031,160
When is the connection closed with SignalR from browser
<p>I'm making a little chat application with SignalR 2.0 (just like everyone).</p> <p>I have a win8.1 application and when the application is closed, the hub receives the OnDisconnected event and removes the user from the list on the hub. The hub sends to every client that the user has left the chat, so we can visuali...
21,031,579
2
0
null
2014-01-09 21:08:14.26 UTC
8
2017-09-12 15:52:19.063 UTC
2014-01-10 18:49:12.217 UTC
null
1,080,372
null
1,080,372
null
1
7
javascript|signalr
23,991
<p>I guess your question is how to detect whether a specific user left or closed the browser. When a user comes in or leaves, send a notification to other users.</p> <p>I think the problem is you didn't handle <code>OnConnected</code> and <code>OnDisconnected</code> properly. To make it work, first you need to know ea...
38,563,217
Converting getdate() to yyyymmdd & getting the date two years back
<p>I have found a couple of different methods to convert it. However, I still get the <code>yyyy-mm-dd</code> format or <code>yyyy-mm-dd hh:mm:ss</code>. I am currently using SQL Server 2014.</p> <pre><code>SELECT dateadd(day, convert(int, getdate()), 112) SELECT DATEADD(YEAR, -2, convert(DATE, GETDATE(), 112)) </code...
38,563,486
2
5
null
2016-07-25 08:45:26.087 UTC
null
2019-01-22 09:45:19.56 UTC
2016-07-25 09:38:41.39 UTC
null
472,495
null
6,616,946
null
1
5
sql|sql-server|sql-server-2014
66,191
<p>You can also use FORMAT:</p> <pre><code> select FORMAT(getdate(), 'yyyyMMdd') </code></pre>
44,259,851
Set restAssured to log all requests and responses globally
<p>I want to enable logging for all <code>RestAssured</code> responses and requests by default.</p> <p>Here's what I do:</p> <pre><code>RestAssured.requestSpecification = new RequestSpecBuilder(). setBaseUri(&quot;api&quot;). setContentType(ContentType.JSON). build(). log().all(); RestAs...
44,316,721
4
0
null
2017-05-30 10:34:58.833 UTC
3
2021-04-14 18:41:17.583 UTC
2021-04-14 18:41:17.583 UTC
null
7,451,109
null
4,572,848
null
1
35
java|rest|logging|rest-assured
53,264
<p>Add logging filters to RestAssured defaults, see <a href="https://github.com/rest-assured/rest-assured/wiki/Usage#filters" rel="noreferrer">filters</a> and <a href="https://github.com/rest-assured/rest-assured/wiki/Usage#default-values" rel="noreferrer">defaults</a>.</p> <blockquote> <p>To create a filter you nee...
41,728,043
Detect when input value changed in directive
<p>I'm trying to detect when the <strong>value</strong> of an input changed in a directive. I have the following directive:</p> <pre class="lang-js prettyprint-override"><code> import { ElementRef, Directive, Renderer} from '@angular/core'; @Directive({ selector: '[number]', host: {"(input)": '...
41,728,823
4
0
null
2017-01-18 19:39:56.15 UTC
8
2022-09-02 08:59:10.967 UTC
2020-03-09 12:13:32.047 UTC
null
7,795,731
null
276,439
null
1
56
angular|angular-directive|angular2-directives
85,905
<p>You need to make an input property of <code>input</code> and then use the <code>ngOnChanges</code> hook to tell when the input property changes.</p> <pre class="lang-js prettyprint-override"><code>@Directive({ selector: '[number]' }) export class NumberDirective implements OnChanges { @Input() public number:...
39,255,973
Split 1 column into 3 columns in spark scala
<p>I have a dataframe in Spark using scala that has a column that I need split.</p> <pre><code>scala&gt; test.show +-------------+ |columnToSplit| +-------------+ | a.b.c| | d.e.f| +-------------+ </code></pre> <p>I need this column split out to look like this:</p> <pre><code>+--------------+ |col1|col...
39,256,038
7
0
null
2016-08-31 17:47:31.107 UTC
24
2021-05-27 19:38:29.99 UTC
null
null
null
null
695,240
null
1
42
scala|apache-spark
93,624
<p>Try:</p> <pre><code>import sparkObject.spark.implicits._ import org.apache.spark.sql.functions.split df.withColumn("_tmp", split($"columnToSplit", "\\.")).select( $"_tmp".getItem(0).as("col1"), $"_tmp".getItem(1).as("col2"), $"_tmp".getItem(2).as("col3") ) </code></pre> <p>The important point to note here i...
31,815,205
Use Personal.xlsb function in new workbook?
<p>I've searched around and I know how to call a function from Personal.xlsb from a VB macro, but how can I call the function to be used in a new workbook?</p> <p>Here's my function, saved in 'Module1' in my <code>Personal.xlsb</code>:</p> <pre><code>Public Function GetColumnLetter(colNum As Integer) As String Di...
31,815,353
4
0
null
2015-08-04 17:03:12.613 UTC
10
2021-09-01 14:51:48.617 UTC
2015-08-04 17:09:24.683 UTC
null
4,650,297
null
4,650,297
null
1
23
vba|excel
21,636
<p>Ah, it was more simple than I thought. Just use the workbook name before the macro - so</p> <pre><code>=Personal.xlsb![macroname] </code></pre> <p>So in my case, I just put this into the cell: <code>=Personal.xlsb!GetColumnLetter(2)</code> to return &quot;B&quot;.</p>
28,484,398
Starting Zookeeper Cluster. Error: Could not find or load main class org.apache.zookeeper.server.quorum.QuorumPeerMain
<p>(I'm running on CentOS 5.8). I've been following the direction for a <a href="http://zookeeper.apache.org/doc/r3.3.3/zookeeperAdmin.html#sc_zkMulitServerSetup" rel="noreferrer">Clustered (Multiserver) Zookeeper Set-up</a>, but getting an error when I try to start up my server. When I run the command as described in ...
28,488,883
7
0
null
2015-02-12 17:51:47.74 UTC
6
2022-07-08 12:52:23.427 UTC
2015-02-12 19:05:55.673 UTC
null
923,986
null
923,986
null
1
25
apache|cluster-computing|apache-zookeeper
55,702
<p>You should be able to run zkServer.sh to get a clustered setup. It will use the same conf/zoo.cfg that you are providing manually, which will contain the cluster endpoints.</p> <p>The best way to check what you are missing from your classpath (and see the proper java command) is to run the zkServer.sh you said work...
5,662,538
Android display another dialog from a dialog
<p>I am trying to display a dialog from the onClick listener of a button of another dialog, but the 2nd dialog won't display. I searched and found a similar problem- <a href="https://stackoverflow.com/questions/3989767/dialogs-order-in-android">Dialogs order in Android</a>, tried the solution provided, but even that do...
5,663,010
3
2
null
2011-04-14 11:29:40.133 UTC
6
2016-09-08 07:29:01.29 UTC
2017-05-23 10:31:06.357 UTC
null
-1
null
705,627
null
1
15
android|dialog
52,379
<p>This is how I'm doing it:</p> <pre><code> if (!appPrefs.getAcceptedUsageAggrement()) { tracker.trackPageView("/UsageAgreementDialog"); acceptedUsage_alertDialog = new AlertDialog.Builder(BroadcastSMSActivity.this) .setTitle(R.string.accept_usage_title) .setMessage(R.string.accept_...
6,154,879
Nginx - wordpress in a subdirectory, what data should be passed?
<p>I've tried so many different things. The point I'm at right now is this:</p> <pre><code>location ^~ /wordpress { alias /var/www/example.com/wordpress; index index.php index.html index.htm; try_files $uri $uri/ /wordpress/index.php; location ~ \.php$ { include fastcgi_params; fastcgi...
6,155,935
3
0
null
2011-05-27 16:04:24.03 UTC
22
2020-01-07 13:12:06.947 UTC
null
null
null
null
299,216
null
1
36
php|wordpress|path|nginx|webserver
36,345
<p>Since your location alias end match, you should just use root. Also, not <em>everything</em> is routed through index.php on wordpress afaik. Also, unless you know you need path info, you probably dont. I think you want something like:</p> <pre><code>location @wp { rewrite ^/wordpress(.*) /wordpress/index.php?q...
6,080,596
How can I load this file into an NUnit Test?
<p>I have the following IntegrationTest project structure ...</p> <p><img src="https://i.stack.imgur.com/HRR0O.png" alt="enter image description here"></p> <p>If i wish to use that test data <code>126.txt</code> in an <code>NUnit Test</code>, how do I load that plain txt file data? </p> <p>NOTE: The file is <code>-l...
6,080,607
4
0
null
2011-05-21 08:35:43.99 UTC
13
2022-02-18 14:32:45.35 UTC
null
null
null
null
30,674
null
1
64
c#|.net|testing|tdd|nunit
40,678
<p>You could specify in the properties of the file to be copied to the output folder and inside the unit test:</p> <pre><code>string text = File.ReadAllText(Path.Combine(TestContext.CurrentContext.TestDirectory, &quot;TestData&quot;, &quot;126.txt&quot;)); </code></pre> <p>As an alternative you could embed this file as...
34,786,115
Swift doesn't convert Objective-C NSError** to throws
<p>I have some Objective-C legacy code, that declares method like</p> <pre><code>- (void)doSomethingWithArgument:(ArgType)argument error:(NSError **)error </code></pre> <p>As written here <a href="https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/AdoptingCocoaDesignPatterns.html...
34,787,941
2
1
null
2016-01-14 09:40:47.15 UTC
8
2021-08-04 09:45:09.01 UTC
2019-01-03 08:20:25.01 UTC
null
100,297
null
3,989,175
null
1
29
ios|objective-c|swift|nserror
9,143
<p>Only <code>Objective-C</code> methods are translated to throwing <code>Swift</code> methods, which do return a <code>BOOL</code> (not lower-cased <code>bool</code>), or a nullable-object. (Tested with Xcode 11.7, and Swift 5 language.)</p> <p>The reason is that Cocoa methods always use a return value <code>NO</code>...
28,973,253
How to search nearby places stored in my database?
<p>I'm developing a web app where the user sets a place in a map (Google Maps API) and I store the coordinates in a database.</p> <p>At another page, I want to do a search which consists in getting my local coordinates and retrieve nearby places previously stored at my database based on a radius.</p> <p>How can I do th...
28,982,339
2
1
null
2015-03-10 20:14:06.82 UTC
9
2020-08-12 04:18:40.02 UTC
2020-08-12 04:18:40.02 UTC
null
214,143
null
1,521,080
null
1
8
google-maps|google-maps-api-3
6,887
<p>You can use what is called the <a href="http://en.wikipedia.org/wiki/Haversine_formula">Haversine formula</a>.</p> <pre><code>$sql = "SELECT *, ( 3959 * acos( cos( radians(" . $lat . ") ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(" . $lng . ") ) + sin( radians(" . $lat . ") ) * sin( radians( lat ) ) )...
50,482,814
Image preview before upload in angular 5
<p>I have this code to show the image preview before uploading it. However I am working with Angular 5 so I have a <code>.ts</code> file instead of a <code>.js</code> one. How can I do the same in Angular 5? I also want to show the image in all browsers.</p> <p>My HTML:</p> <pre class="lang-html prettyprint-override"><...
50,483,118
9
2
null
2018-05-23 07:53:53.647 UTC
7
2021-12-19 15:51:14.017 UTC
2021-12-19 15:51:14.017 UTC
null
16,543,631
null
9,762,627
null
1
23
javascript|angular|image|file-upload|path
58,730
<p>.html</p> <p>Update event attr and handler param for input. And you should use data binding for src attribute. Following will apply src if it's not null or undefined or hardcoded url ('<a href="http://placehold.it/180" rel="noreferrer">http://placehold.it/180</a>')</p> <pre><code>&lt;input type='file' (change)="re...
32,393,026
Exclude multiple folders using AWS S3 sync
<p>How to exclude multiple folders while using aws s3 syn ?</p> <p>I tried :</p> <pre><code> # aws s3 sync s3://inksedge-app-file-storage-bucket-prod-env \ s3://inksedge-app-file-storage-bucket-test-env \ --exclude 'reportTemplate/* orders/* customers/*' </code></pre> <p>But stil...
32,394,703
4
1
null
2015-09-04 08:01:54.947 UTC
10
2021-08-27 04:20:58.327 UTC
2021-08-27 04:20:58.327 UTC
null
11,861,319
null
3,425,138
null
1
77
amazon-web-services|amazon-s3|s3cmd
79,010
<p>At last this worked for me:</p> <pre><code>aws s3 sync s3://my-bucket s3://my-other-bucket \ --exclude 'customers/*' \ --exclude 'orders/*' \ --exclude 'reportTemplate/*' </code></pre> <p><strong>Hint</strong>: you have to enclose your wildcards and special characters in single ...
5,652,957
What event catches a change of value in a combobox in a DataGridViewCell?
<p>I want to handle the event when a value is changed in a <code>ComboBox</code> in a <code>DataGridView</code> cell.</p> <p>There's the <code>CellValueChanged</code> event, but that one doesn't fire until I click somewhere else inside the <code>DataGridView</code>. </p> <p>A simple <code>ComboBox</code> <code>Selec...
21,321,724
5
0
null
2011-04-13 17:09:27.783 UTC
9
2021-04-14 19:55:27.167 UTC
2016-06-15 21:19:40.147 UTC
null
214,296
null
249,878
null
1
35
c#|.net|datagridview|combobox|event-handling
73,140
<p>The above answer led me down the primrose path for awhile. It does not work as it causes multiple events to fire and just keeps adding events. The problem is that the above catches the DataGridViewEditingControlShowingEvent and it does not catch the value changed. So it will fire every time you focus then leave t...
5,630,689
Select all empty tables in SQL Server
<p>How to get the list of the tables in my <code>sql-server</code> database that do not have any records in them?</p>
5,630,752
6
1
null
2011-04-12 05:15:13.083 UTC
9
2021-06-18 06:04:56.627 UTC
2018-05-30 11:31:07.237 UTC
null
6,281,993
null
507,669
null
1
30
sql-server|tsql
40,100
<p>On SQL Server 2005 and up, you can use something like this:</p> <pre><code>;WITH TableRows AS ( SELECT SUM(row_count) AS [RowCount], OBJECT_NAME(OBJECT_ID) AS TableName FROM sys.dm_db_partition_stats WHERE index_id = 0 OR index_id = 1 GROUP BY OBJECT_ID ) SELECT * FROM...
6,225,392
How to get first two characters of a string in oracle query?
<p>Suppose I have a column name <code>OrderNo</code> with value <code>AO025631</code> in a table <code>shipment</code>.</p> <p>I am trying to query the table so that I can get only first two character of column value i.e. <code>AO</code>.</p> <p>Can I do this in the SQL query itself? </p>
6,225,414
6
0
null
2011-06-03 09:40:00.93 UTC
4
2022-08-09 21:57:36.91 UTC
2013-06-19 08:15:14.487 UTC
null
1,065,525
null
517,066
null
1
61
sql|oracle
317,166
<p><strong><em>SUBSTR</em></strong> <a href="http://download.oracle.com/docs/cd/B28359_01/olap.111/b28126/dml_functions_2101.htm" rel="noreferrer">(documentation)</a>:</p> <pre><code>SELECT SUBSTR(OrderNo, 1, 2) As NewColumnName from shipment </code></pre> <p>When selected, it's like any other column. You should give...
5,956,999
What does "return $this" mean?
<p>I'm trying to understand this code, and when I arrived at the final line, I didn't get it. :(</p> <p><strong>Can I have your help in order to find out, what does <code>return $this</code> mean ?</strong></p> <pre><code>public function setOptions(array $options) { $methods = get_class_methods($this); foreac...
5,957,038
7
2
null
2011-05-10 21:59:00.677 UTC
16
2019-02-11 14:11:53.393 UTC
2014-01-30 17:11:52.297 UTC
null
507,738
null
378,170
null
1
33
php|oop|zend-framework|return
28,905
<p>This way of coding is called <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Fluent_interface"><em>fluent interface</em></a>. <code>return $this</code> returns the current object, so you can write code like this:</p> <pre><code>$object -&gt;function1() -&gt;function2() -&gt;function3() ; </code></pr...
17,708,971
Using custom simpleCursorAdapter
<p>I am trying to access a list-activity using custom adapter.I have tried it directly without using any custom adapter it was working good but because I want to add more functions in list-view I want to implement a custom adapter.Now I have tried it but I am getting an empty list-view with no data visible. List-Activi...
17,709,253
2
0
null
2013-07-17 19:51:05.527 UTC
11
2021-12-28 17:10:44.503 UTC
2021-12-28 17:10:44.503 UTC
null
4,294,399
null
1,810,612
null
1
5
android|listview|android-listview|simplecursoradapter|android-cursor
12,806
<p>When extending a cursor adapter you should override the methods <a href="http://developer.android.com/reference/android/widget/CursorAdapter.html#bindView%28android.view.View,%20android.content.Context,%20android.database.Cursor%29">bindView</a> and <a href="http://developer.android.com/reference/android/widget/Curs...
44,060,253
How to Remove Chrome Logo from PWA App Home Screen Link (Android O Preview)
<p>I just updated to Android O Preview and installed a few PWAs. On the home screen a miniature Chrome logo is placed by the icon. This wasn't there before the OS update. </p> <p>Ideally, I would like the PWA to look like a regular app on the home screen considering it has service workers enabled.</p> <p>Is it pos...
49,761,109
6
0
null
2017-05-19 01:56:29.103 UTC
8
2021-09-18 06:09:25.72 UTC
null
null
null
null
6,606,273
null
1
37
android|google-chrome|homescreen|progressive-web-apps
32,419
<p>Above answer is not accurate except for the part that Chrome had the issue of adding Chrome badge to App icon, which is changed in the following updates. </p> <p><strong>Before getting into whats wrong, here is how web apps are added to home screen.</strong> </p> <p>1) <strong>As a simple shortcut</strong>(like a ...
27,829,051
Enable submit button only when all fields are filled
<p>In my form, I want to enable form only when all fields (and radio button list) has been selected. </p> <p>So far, I have successfully made the submit button <code>enable</code> when the <code>title</code> field has content with: </p> <pre><code>onkeyup="if(this.textLength != 0) {subnewtopic.disabled = false} else ...
27,829,274
5
1
null
2015-01-07 21:35:22.76 UTC
5
2018-01-31 19:18:24.43 UTC
null
null
null
null
1,185,126
null
1
8
jquery|html|forms
64,637
<p>Here is a fiddle for you. <a href="http://jsfiddle.net/soyn0xag/6/" rel="noreferrer">http://jsfiddle.net/soyn0xag/6/</a></p> <pre><code>$("input[type='text'], textarea").on("keyup", function(){ if($(this).val() != "" &amp;&amp; $("textarea").val() != "" &amp;&amp; $("input[name='category']").is(":checked") == t...
42,402,064
Using a Strategy and Factory Pattern with Dependency Injection
<p>I am working on a side project to better understand Inversion of Control and Dependency Injection and different design patterns.</p> <p>I am wondering if there are <strong>best practices to using DI with the factory and strategy patterns</strong>?</p> <p><strong>My challenge comes about when a strategy (built from...
42,402,842
5
1
null
2017-02-22 20:53:14.94 UTC
11
2022-08-23 07:26:23.617 UTC
2017-02-22 21:21:40.273 UTC
null
3,211,509
null
3,211,509
null
1
28
c#|design-patterns|dependency-injection|factory-pattern|strategy-pattern
31,315
<p>There are a few ways of doing this, but the way I prefer is to inject a list of available strategies into your factory, and then filtering them to return the one(s) you're interested in.</p> <p>Working with your example, I'd modify <code>IShippingStrategy</code> to add a new property:</p> <pre><code>public interfa...
51,330,155
Implicit conversion from data type varchar to varbinary is not allowed. (SQL)
<p>Error: </p> <blockquote> <p>Implicit conversion from data type varchar to varbinary is not allowed. Use the CONVERT function to run this query.</p> </blockquote> <p>Any question? I am new to SQL Server</p> <pre><code>USE schemas GO CREATE PROCEDURE Table @LineaNegocioId INT, --null @PaisId INT, -- req...
51,330,242
2
2
null
2018-07-13 17:28:50.193 UTC
null
2022-05-22 05:37:14.613 UTC
2018-07-13 19:41:22.59 UTC
null
13,302
null
3,562,098
null
1
5
sql-server|tsql
41,692
<p>Either the field <code>Nombre</code> or <code>Descripcion</code> is a <code>varbinary</code> and you must explicitly <code>convert</code> those inputs for your <code>insert</code> clause. </p> <p>It would look like this. </p> <p><code>VALUES (... ,CONVERT(varbinary, [@Nombre or @Descripcion]) ,...)</code></p>
9,455,838
Create user with admin option oracle 11g command not working
<p>okay , This command is not working </p> <p><code>create user username identified by password with admin option ;</code></p> <p>It throws an error which says <code>missing or invalid option</code> </p> <p>And i am logged in as system . I have tried searching Oracle docs and they have written the same command...
9,455,877
3
0
null
2012-02-26 18:28:29.823 UTC
8
2017-08-03 13:03:01.707 UTC
2012-02-26 18:44:20.957 UTC
null
1,096,194
null
1,096,194
null
1
7
sql|oracle|oracle11g
52,960
<p>You need to first create the user;</p> <pre><code>CREATE USER username IDENTIFIED BY password; </code></pre> <p>then separately grant privileges with ADMIN OPTION;</p> <pre><code>GRANT dba TO username WITH ADMIN OPTION; </code></pre>
9,595,925
How to get ipa file from Xcode to run an iPhone app in real device?
<p>My client asked me to get the review of the app on which I am working. So, I want to get the ipa file and mobile provision file from Xcode 4.2 to share my app to run in real device. I have a paid account of apple with me. Please tell me the procedure to get it.</p> <p>Thanks in advance.</p>
9,596,069
5
0
null
2012-03-07 04:39:08.067 UTC
7
2016-02-04 00:32:37.797 UTC
2012-03-07 04:46:40.94 UTC
null
147,019
null
775,761
null
1
13
iphone|ios|xcode|distribution|ipa
50,689
<p><strong>STEP-1:</strong> </p> <p>You need to refer steps for <strong>AdHoc Distribution</strong></p> <p>I think you need to login with your credentials at <a href="https://daw.apple.com/cgi-bin/WebObjects/DSAuthWeb.woa/wa/login?appIdKey=d4f7d769c2abecc664d0dadfed6a67f943442b5e9c87524d4587a95773750cea&amp;path=//de...
9,262,871
Android: two Spinner onItemSelected()
<p>I have two spinners (day_spin and time_spin) in one <code>Activity</code>. I want to save the selected day_spin value into a variable. Is it possible to differenciate between the two spinners in the same <code>Listener</code>? Or do I have to write my own <code>Listener</code> class for each spinner?</p> <p>Also I ...
9,263,046
6
0
null
2012-02-13 15:15:00.633 UTC
9
2020-11-21 07:09:53.643 UTC
2013-03-21 22:43:23.337 UTC
null
12,388
null
1,197,351
null
1
44
android|spinner|listener|android-spinner
64,197
<pre><code>public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) { if(parent.getId() == R.id.spinner1) { //do this } else if(parent.getId() == R.id.spinner2) { //do this } } </code></pre>
9,238,953
how to empty recyclebin through command prompt?
<p>Usually we delete the recycle bin contents by right-clicking it with the mouse and selecting "Empty Recycle Bin". But I have a requirement where I need to delete the recycle bin contents using the command prompt. Is this possible? If so, how can I achieve it?</p>
9,239,158
14
0
null
2012-02-11 08:50:22.883 UTC
33
2021-03-19 22:06:27.913 UTC
2016-12-09 15:04:51.983 UTC
null
4,666,542
null
1,016,403
null
1
87
windows|windows-7|command-line|batch-file|recycle-bin
297,138
<p>You can effectively "empty" the Recycle Bin from the command line by permanently deleting the Recycle Bin directory on the drive that contains the system files. (In most cases, this will be the <code>C:</code> drive, but you shouldn't hardcode that value because it won't always be true. Instead, use the <code>%syste...
34,104,270
Filter and sort on multiple values with Firebase
<p>I'm building a social app using Firebase. I store posts in Firebase like this:</p> <pre><code>posts: { "postid": { author: "userid" text: "", date: "timestamp" category: "categoryid" likes: 23 } } </code></pre> <p>Each post belong to a category and it's possible to like posts.<...
34,105,063
1
1
null
2015-12-05 11:22:11.583 UTC
15
2015-12-05 12:46:36.223 UTC
null
null
null
null
543,224
null
1
13
firebase
18,047
<p>You can use only one ordering function <a href="https://www.firebase.com/docs/ios/guide/retrieving-data.html#section-queries" rel="noreferrer">with Firebase database queries</a>, <strong>but proper data structure will allow you to query by multiple fields</strong>.</p> <p>In your case you want to order by category....
47,349,422
How to interpret adfuller test results?
<p>I am struggling to understand the concept of p-value and the various other results of adfuller test.</p> <p>The code I am using:</p> <p>(I found this code in Stack Overflow)</p> <pre class="lang-py prettyprint-override"><code>import numpy as np import os import pandas as pd import statsmodels.api as sm import cython...
54,953,670
3
1
null
2017-11-17 11:15:59.23 UTC
9
2021-12-26 11:47:57.167 UTC
2021-12-26 11:47:57.167 UTC
null
4,685,471
null
6,387,095
null
1
14
statistics|statsmodels
23,018
<p>what you stated in your question is correct. Once you applied the Adfuller test over your OLS regression residue, you were checking whether your residue had any heterocedasticity, in another words, if your residue was stationary.</p> <p>Since your adfuller p-value is lower than a certain specified alpha (i.e.: 5%),...
10,818,319
When do I need to call setNeedsDisplay in iOS?
<p>When creating an iOS app, I'm confused as to when exactly I need to call <code>setNeedsDisplay</code>? I know that it has something to do with updating/redrawing the UI; however, do I need to call this every time I change any of my views?</p> <p>For example, do I need to call it:</p> <ul> <li>After programaticall...
10,818,417
5
1
null
2012-05-30 14:28:04.103 UTC
34
2018-04-25 15:27:48.757 UTC
2018-04-25 15:27:48.757 UTC
null
5,175,709
null
1,174,719
null
1
67
ios|objective-c|swift|uiview|setneedsdisplay
48,622
<p>You should only be calling setNeedsDisplay if you override drawRect in a subclass of UIView which is basically a custom view drawing something on the screen, like lines, images, or shapes like a rectangle.</p> <p>So you should call setNeedsDisplay when you make changes to few variables on which this drawing depends...
10,477,607
Avoid printStackTrace(); use a logger call instead
<p>In my application, I am running my code through PMD.It shows me this message:</p> <blockquote> <ul> <li>Avoid printStackTrace(); use a logger call instead. </li> </ul> </blockquote> <p>What does that mean?</p>
10,477,646
7
1
null
2012-05-07 06:23:57.383 UTC
32
2021-12-06 07:27:12.11 UTC
2012-05-07 06:29:02.073 UTC
null
605,744
null
1,305,398
null
1
99
java|logging|pmd|printstacktrace
135,551
<p>It means you should use logging framework like <a href="/questions/tagged/logback" class="post-tag" title="show questions tagged 'logback'" rel="tag">logback</a> or <a href="/questions/tagged/log4j" class="post-tag" title="show questions tagged 'log4j'" rel="tag">log4j</a> and instead of printing exceptions directly...
22,968,631
How to filter filter_horizontal in Django admin?
<p>I'm looking for a way to use filter_horizontal on the base of a filtered queryset.</p> <p>I've tried to use it with a custom manager:</p> <p><strong>In models.py:</strong></p> <pre><code>class AvailEquipManager(models.Manager): def get_query_set(self): return super(AvailEquipManager, self).get_query_s...
23,140,826
2
1
null
2014-04-09 16:31:08.563 UTC
8
2020-06-13 19:50:56.373 UTC
null
null
null
null
427,942
null
1
17
python|django|django-admin
34,702
<p>I found a solution by adapting the answer to a different question which I found in <a href="https://groups.google.com/forum/#!topic/django-users/-46GAa0FMlc">Google Groups</a></p> <p>It works with a custom ModelForm like so:</p> <p>Create a new forms.py:</p> <pre><code>from django import forms from models import ...
23,066,756
What are tracepoints used for?
<p>They can only be placed on method names. How are they used and what are they for?</p> <p><img src="https://i.stack.imgur.com/UJVwc.png" alt="enter image description here"></p>
23,115,921
3
1
null
2014-04-14 17:48:00.067 UTC
7
2019-03-28 14:10:45.027 UTC
2017-12-06 01:49:33.57 UTC
null
933,198
null
2,037,335
null
1
37
c#|c++|asp.net|visual-studio|debugging
19,946
<p>The Debugger team has a good blog post on this subject with examples as well: <s><a href="http://blogs.msdn.com/b/visualstudioalm/archive/2013/10/10/tracepoints.aspx" rel="noreferrer">http://blogs.msdn.com/b/visualstudioalm/archive/2013/10/10/tracepoints.aspx</a></s></p> <p><a href="https://web.archive.org/web/2019...
18,977,320
Convert from .mov to .mp4 (or h264) using avconv
<p>Looking at the avconv website there seem to be a vast array of options to convert video.</p> <p>However, I'm getting lost in all the technical detail.</p> <p>Is there a simple way to convert a .mov to a .mp4 (or h264)?</p> <p>I'm happy if it's slightly lossy. </p> <p>If it helps I'm on Ubuntu 12.04.2 LTS.</p>
18,979,552
1
1
null
2013-09-24 09:11:24.093 UTC
9
2017-05-11 08:13:20.037 UTC
null
null
null
null
343,204
null
1
17
mp4|mov|avconv
39,455
<p>In a very basic form, it would look a bit like this:</p> <blockquote> <p>avconv -i inputfile.mov -c:v libx264 outputfile.mp4</p> </blockquote> <p>This will only work if you compiled avconv with libx264 support - you can <a href="https://stackoverflow.com/questions/11234662/how-to-compile-avconv-with-libx264-on-u...
18,968,963
SELECT COUNT(DISTINCT... ) error on multiple columns?
<p>I have a table, VehicleModelYear, containing columns id, year, make, and model.</p> <p>The following two queries work as expected:</p> <pre><code>SELECT DISTINCT make, model FROM VehicleModelYear SELECT COUNT(DISTINCT make) FROM VehicleModelYear </code></pre> <p>However, this query doesn't work</p> <pre><code>S...
18,969,000
3
1
null
2013-09-23 21:11:12.09 UTC
4
2016-07-30 07:04:28.82 UTC
null
null
null
null
2,631,315
null
1
22
sql|sql-server|tsql
62,788
<p><code>COUNT()</code> in <code>SQL Server</code> accepts the following syntax</p> <pre><code>COUNT(*) COUNT(colName) COUNT(DISTINCT colName) </code></pre> <p>You can have a subquery which returns unique set of <code>make</code> and <code>model</code> that you can count with.</p> <pre><code>SELECT COUNT(*) FROM ...
21,090,076
How to get error_message from SQL Server TRY.....CATCH block
<pre><code>BEGIN TRY BEGIN TRANSACTION --Lots of T-SQL Code here COMMIT END TRY BEGIN CATCH ROLLBACK USE [msdb]; EXEC sp_send_dbmail @profile_name='Mail Profile', @recipients='myEmail@mydomain.org', @subject='Data Error', @body = SELECT ERROR_MESSAGE(); END CATCH </code></p...
21,090,122
3
2
null
2014-01-13 11:24:04.143 UTC
3
2014-01-13 11:48:58.85 UTC
2014-01-13 11:48:43.91 UTC
null
13,302
null
77,121
null
1
21
sql-server|tsql
49,381
<p>You can not issue a SELECT statement directly into the parameter of a stored procedure. Do something like this instead:</p> <pre><code>DECLARE @err_msg AS NVARCHAR(MAX); SET @err_msg = ERROR_MESSAGE(); EXEC sp_send_dbmail @profile_name='your Mail Profile here', @recipients='myEmail@mydomain.org', @subject='...
18,554,889
Difference between XML Over HTTP & SOAP Over HTTP
<p>Is SOAP over HTTP a subset of XML over HTTP since I assume SOAP also an xml that confirms to a schema (SOAP schema)? I assume XML over HTTP service can either be accessed using GET or POST method. Does SOAP over HTTP always use POST method? In case of XML over HTTP I assume the disadvantage is that schema file has t...
18,555,101
1
0
null
2013-09-01 03:19:31.033 UTC
16
2013-09-01 04:03:08.907 UTC
null
null
null
null
1,042,646
null
1
23
web-services|http|soap|service|xmlhttprequest
57,543
<p>SOAP is a specialization of XML, as it has a schema, such as <a href="http://www.xmlsoap.org/soap/envelope/" rel="noreferrer">http://www.xmlsoap.org/soap/envelope/</a>, whereas XML is more general.</p> <p>For using GET, you can read through this discussion: <a href="http://www.coderanch.com/t/463869/Web-Services/ja...
8,624,633
org.hibernate.MappingException: Unable to find column with logical name
<p>hi my tables are as follows:</p> <p>1- <strong>medical_company</strong>:</p> <ul> <li>medical_company_id <strong>foreign key</strong> on <strong>account_entity</strong> table <strong>account_entity_id</strong> column (not a pk)</li> <li>column1</li> <li>column2</li> <li>column3</li> </ul> <p>2- <strong>account_en...
8,625,429
4
1
null
2011-12-24 12:51:05.783 UTC
6
2021-06-03 08:08:28.757 UTC
null
null
null
null
429,377
null
1
29
hibernate|jakarta-ee|jpa|hibernate-mapping|hbm2ddl
83,936
<p>This error is telling you that there is no column on the medical_company table called medical_company_id. The column on medical_company is just called id. </p>
19,797,139
How to make a button scroll down page in HTML?
<p>Couldn't find a tutorial for this anywhere or just didn't use the right keywords. I'm making a one-paged website, and I'd like the navigation bar buttons to scroll the page up/down to the right part. Would this be possible in just HTML and CSS?<br> I'm not so experienced with JavaScript.</p> <p>Similar to ''Scroll...
19,797,171
2
1
null
2013-11-05 19:24:26.007 UTC
3
2017-02-13 09:30:27.857 UTC
null
null
null
null
2,907,241
null
1
15
javascript|html|css|scroll
55,989
<p><strong>Update:</strong> There is now a better way to use this, using the HTML <code>id</code> attribute:</p> <p>Set the destination id: <code>&lt;h1 id="section1"&gt;Section 1&lt;/h1&gt;</code></p> <p>And create a link to that destination using the anchor tag: <code>&lt;a href="#section1"&gt;Go to section 1&lt;/a...
19,787,747
Insert a date into a textbox and then that date would be selected in the calendar asp.net c#
<p>I need to know is it possible to insert a date into a textbox and then that date would be selected in the calendar. I am using the calendar in Microsoft visual studio express 2012 for web.</p> <p>Below is the code for inserting a date into a textbox by selecting the date on the calendar. (However I want to do the o...
19,787,820
3
1
null
2013-11-05 11:18:01.277 UTC
2
2013-11-06 14:22:10.053 UTC
null
null
null
null
2,855,068
null
1
3
c#|asp.net|calendar
47,321
<p>How about</p> <pre><code>protected void TextBox1_TextChanged(object sender, EventArgs e) { Calendar1.SelectedDate = Convert.ToDateTime(TextBox1.Text); } </code></pre>
962,449
Array of Labels
<p>How to create array of labels with Microsoft Visual C# Express Edition ? Is there way to do it with graphical (drag'n'drop) editor or I have to manually add it to auto generated code ?</p>
962,453
4
1
null
2009-06-07 18:16:00.163 UTC
1
2014-01-07 20:17:14.397 UTC
null
null
null
null
80,204
null
1
5
c#|.net
49,806
<p>You have to manually add it. But don't add it to auto generated code as it can be overwritten by Visual Studio designer.</p> <p>I would add it in Load event handler for the form. The code can look like this: </p> <pre><code>Label[] labels = new Label[10]; labels[0] = new Label(); labels[0].Text = "blablabla"; la...
40,071,845
How to import CSS from node_modules in webpack angular2 app
<p>Let's say that we start with the following starter pack: <a href="https://github.com/angularclass/angular2-webpack-starter" rel="noreferrer">https://github.com/angularclass/angular2-webpack-starter</a></p> <p>After <code>npm install</code> and <code>npm run start</code> everything works fine.</p> <p>I want to add ...
40,073,067
3
2
null
2016-10-16 15:12:36.893 UTC
17
2019-02-07 19:08:48.647 UTC
2017-10-06 20:02:11.48 UTC
null
3,885,376
null
1,010,777
null
1
70
css|angular|typescript|npm|webpack
101,621
<p>You won't be able to import any css to your <strong>vendors</strong> file using that stack, without making some changes.</p> <p>Why? Well because this line:</p> <pre><code>import 'bootstrap/dist/css/bootstrap.css'; </code></pre> <p>It's only importing your css as string, when in reality what you want is your vend...
22,107,788
How include an external JS file in a JSP page
<p>I have an spring mvc app where in my main page, I need use an javascript file. I try include the file this way:</p> <pre><code>&lt;script type="text/javascript" src="js/index.js"&gt;&lt;/script&gt; </code></pre> <p>but when I running the application, the system behavior seems like no script is running. T also try ...
42,076,844
3
1
null
2014-02-28 23:30:41.78 UTC
5
2021-08-17 00:20:45.087 UTC
2014-02-28 23:47:15.89 UTC
null
2,692,962
null
2,692,962
null
1
15
javascript|jsp
93,030
<blockquote> <p>but when I running the application, the system behavior seems like no script is running.</p> </blockquote> <p>This is because the browser is unable to load the javascript 'index.js' from the specified location. If you open the browser console and go to the 'networks' tab, you will see 404 (resourc...
35,375,757
Test ActiveModel::Serializer classes with Rspec
<p>Given the following <code>ActiveModel::Serializer</code> class:</p> <pre><code>class SampleSerializer &lt; ActiveModel::Serializer attributes :id, :name end </code></pre> <p>How can this be tested with <code>RSpec</code>?</p>
35,375,758
5
0
null
2016-02-13 03:33:16.47 UTC
10
2021-03-03 13:55:31.177 UTC
2019-07-10 16:48:08.387 UTC
null
3,678,689
null
2,259,144
null
1
38
ruby-on-rails|ruby-on-rails-4|rspec|active-model-serializers
18,093
<h3>Assumptions</h3> <p>This answer assumes you have the <code>rspec-rails</code>, <code>active_model_serializers</code> and <code>factory_girl_rails</code> gems installed and configured.</p> <p>This answer also assumes you have defined a factory for the <code>Sample</code> resource.</p> <h3>Serializer spec</h3> <p...
25,838,183
What is the OAuth 2.0 Bearer Token exactly?
<p>According to <a href="https://www.rfc-editor.org/rfc/rfc6750" rel="noreferrer">RFC6750</a>-The OAuth 2.0 Authorization Framework: Bearer Token Usage, the bearer token is:</p> <blockquote> <p>A security token with the property that any party in possession of the token (a &quot;bearer&quot;) can use the token in any w...
25,843,058
6
1
null
2014-09-14 21:27:46.397 UTC
89
2021-08-04 23:23:25.733 UTC
2021-10-07 05:46:31.917 UTC
null
-1
null
933,211
null
1
241
oauth|bearer-token
236,871
<blockquote> <p>Bearer Token<br> A security token with the property that any party in possession of the token (a "bearer") can use the token in any way that any other party in possession of it can. Using a bearer token does not require a bearer to prove possession of cryptographic key material (proof-of-po...
30,678,303
Extremely large numbers in javascript
<p>I'm working on the Project Euler problems (currently <a href="http://projecteuler.net/problem=13" rel="noreferrer">question 13</a>).</p> <p>For this question I have to find the first 10 digits of the sum of 100 numbers all of a size similar to this:</p> <pre><code>91,942,213,363,574,161,572,522,430,563,301,811,072...
30,678,327
5
2
null
2015-06-06 02:21:30.73 UTC
8
2020-03-24 10:15:37.253 UTC
2017-07-15 09:19:50.687 UTC
null
46,914
null
2,558,418
null
1
15
javascript|types|numbers|integer|biginteger
46,089
<p>You are going to need a javascript based BigInteger library. There are many to choose from. Here is one <a href="https://github.com/peterolson/BigInteger.js" rel="noreferrer">https://github.com/peterolson/BigInteger.js</a></p> <p>You can use it like this </p> <pre><code>var n = bigInt("9194221336357416157252243056...
20,807,131
Espresso: return boolean if view exists
<p>I am trying to check to see if a view is displayed with Espresso. Here is some pseudo code to show what I am trying:</p> <pre><code>if (!Espresso.onView(withId(R.id.someID)).check(doesNotExist()){ // then do something } else { // do nothing, or what have you } </code></pre> <p>But my problem is <code>.chec...
20,811,193
8
1
null
2013-12-27 20:07:34.94 UTC
6
2020-07-29 18:09:18.587 UTC
2017-10-23 17:03:58.173 UTC
null
1,642,079
null
1,642,079
null
1
47
java|android|android-testing|android-espresso
41,964
<p>Conditional logic in tests is <a href="http://xunitpatterns.com/Conditional%20Test%20Logic.html" rel="noreferrer">undesirable</a>. With that in mind, Espresso's API was designed to guide the test author away from it (by being explicit with test actions and assertions).</p> <p>Having said that, you can still achieve...