Most Popular
1500 questions
1288
votes
28 answers
How do I remove the process currently using a port on localhost in Windows?
How can I remove the current process/application which is already assigned to a port?
For example: localhost:8080
KavinduWije
- 39,451
- 4
- 14
- 17
1287
votes
22 answers
.gitignore for Visual Studio Projects and Solutions
Which files should I include in .gitignore when using Git in conjunction with Visual Studio Solutions (.sln) and Projects?
Martin Suchanek
- 3,006
- 6
- 31
- 31
1286
votes
14 answers
Are HTTPS URLs encrypted?
Are all URLs encrypted when using TLS/SSL (HTTPS) encryption? I would like to know because I want all URL data to be hidden when using TLS/SSL (HTTPS).
If TLS/SSL gives you total URL encryption then I don't have to worry about hiding confidential…
Daniel Kivatinos
- 24,088
- 23
- 61
- 81
1285
votes
8 answers
Create a git patch from the uncommitted changes in the current working directory
Say I have uncommitted changes in my working directory. How can I make a patch from those without having to create a commit?
vrish88
- 20,047
- 8
- 38
- 56
1285
votes
23 answers
jQuery get specific option tag text
All right, say I have this:
What would the selector look like if I wanted to get "Option B" when I…
Paolo Bergantino
- 480,997
- 81
- 517
- 436
1284
votes
43 answers
How to get current time and date in Android
How can I get the current time and date in an Android app?
M7M
- 12,891
- 3
- 15
- 4
1283
votes
23 answers
Extract file name from path, no matter what the os/path format
Which Python library can I use to extract filenames from paths, no matter what the operating system or path format could be?
For example, I'd like all of these paths to return me c:
a/b/c/
a/b/c
\a\b\c
\a\b\c\
a\b\c
a/b/../../a/b/c/
a/b/../../a/b/c
BuZz
- 16,318
- 31
- 86
- 141
1283
votes
11 answers
Assigning default values to shell variables with a single command in bash
I have a whole bunch of tests on variables in a bash (3.00) shell script where if the variable is not set, then it assigns a default, e.g.:
if [ -z "${VARIABLE}" ]; then
FOO='default'
else
FOO=${VARIABLE}
fi
I seem to recall there's some…
Edward Q. Bridges
- 16,712
- 8
- 35
- 42
1282
votes
8 answers
What is "Linting"?
PHPLint, JSLint, and I recently came across "you can lint your JS code on the fly" while reading something about some IDE.
So, what is "linting"?
Ashkan Kh. Nazary
- 21,844
- 13
- 44
- 68
1282
votes
48 answers
Activity has leaked window that was originally added
What is this error, and why does it happen?
05-17 18:24:57.069: ERROR/WindowManager(18850): Activity com.mypkg.myP has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@44c46ff0 that was originally added here
05-17 18:24:57.069:…
Pentium10
- 204,586
- 122
- 423
- 502
1282
votes
17 answers
Get JavaScript object from array of objects by value of property
Let's say I have an array of four objects:
var jsObjects = [
{a: 1, b: 2},
{a: 3, b: 4},
{a: 5, b: 6},
{a: 7, b: 8}
];
Is there a way that I can get the third object ({a: 5, b: 6}) by the value of the property b for example without a…
user765368
- 19,590
- 27
- 96
- 167
1281
votes
13 answers
How do I get file creation and modification date/times?
What's the best cross-platform way to get file creation and modification dates/times, that works on both Linux and Windows?
Mark Biek
- 146,731
- 54
- 156
- 201
1280
votes
12 answers
What's the difference between implementation, api and compile in Gradle?
After updating to Android Studio 3.0 and creating a new project, I noticed that in build.gradle there is a new way to add new dependencies instead of compile there is implementation and instead of testCompile there is testImplementation.
Example:
…
humazed
- 74,687
- 32
- 99
- 138
1280
votes
9 answers
How do I use reflection to call a generic method?
What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?
Consider the following sample code - inside the Example() method, what's the most concise way to invoke…
Bevan
- 43,618
- 10
- 81
- 133
1279
votes
29 answers
Sort ArrayList of custom Objects by property
I read about sorting ArrayLists using a Comparator but in all of the examples people used compareTo which according to some research is a method for Strings.
I wanted to sort an ArrayList of custom objects by one of their properties: a Date…
Samuel
- 18,286
- 18
- 52
- 88