Most Popular

1500 questions
1097
votes
24 answers

How do I duplicate a line or selection within Visual Studio Code?

Using Microsoft's Visual Studio Code, how do I duplicate a line of code and then move it up and down? (Similar to Sublime's cmd+shift+d behaviour) It's a feature that I use constantly, and am struggling using Visual Studio Code without it.
Chris
  • 54,599
  • 30
  • 149
  • 186
1097
votes
21 answers

Static way to get 'Context' in Android?

Is there a way to get the current Context instance inside a static method? I'm looking for that way because I hate saving the 'Context' instance each time it changes.
Andrea Baccega
  • 27,211
  • 13
  • 45
  • 46
1097
votes
26 answers

Error message "No exports were found that match the constraint contract name"

This morning I faced a problem while opening my Visual Studio solution, and when I tried to run it, it said: No exports were found that match the constraint contract name How can I fix this problem?
Simon B.Robert
  • 31,754
  • 4
  • 16
  • 24
1097
votes
18 answers

How to upgrade Git on Windows to the latest version

I just upgraded to Git 1.8.0.1 for Windows, from my previous version 1.7.9.mysysgit.0. I downloaded the new version from the Git site and installed through the normal Git installer EXE. That said, when I fire up my terminal window, it still is…
BrianScottK
  • 11,105
  • 3
  • 14
  • 7
1097
votes
10 answers

How would I extract a single file (or changes to a file) from a git stash?

Is it possible to extract a single file or diff of a file from a git stash without popping the stash changeset off?
Danny
  • 13,194
  • 4
  • 31
  • 36
1096
votes
22 answers

How to create a file in memory for user to download, but not through server?

Is there a way to create a text file on the client side and prompt the user to download it without any interaction with the server? I know I can't write directly to their machine (security and all), but can I create the file and prompt them to save…
Joseph Silber
  • 214,931
  • 59
  • 362
  • 292
1096
votes
24 answers

How to set the Content-Type header for an HttpClient request?

I'm trying to set the Content-Type header of an HttpClient object as required by an API I am calling. I tried setting the Content-Type like below: using (var httpClient = new HttpClient()) { httpClient.BaseAddress = new…
mynameiscoffey
  • 15,244
  • 5
  • 33
  • 45
1095
votes
3 answers

What does the "~" (tilde/squiggle/twiddle) CSS selector mean?

Searching for the ~ character isn't easy. I was looking over some CSS and found this .check:checked ~ .content { } What does it mean?
Tarang
  • 75,157
  • 39
  • 215
  • 276
1095
votes
6 answers

Force "git push" to overwrite remote files

I want to push my local files, and have them on a remote repo, without having to deal with merge conflicts. I just want my local version to have priority over the remote one. How can I do this with Git?
opensas
  • 60,462
  • 79
  • 252
  • 386
1093
votes
13 answers

How to get first N number of elements from an array

I am working with Javascript(ES6) /FaceBook react and trying to get the first 3 elements of an array that varies in size. I would like do the equivalent of Linq take(n). In my Jsx file I have the following: var items = list.map(i => { return ( …
user1526912
  • 15,818
  • 14
  • 57
  • 92
1091
votes
24 answers

Getting the ID of the element that fired an event

Is there any way to get the ID of the element that fires an event? I'm thinking something like: $(document).ready(function() { $("a").click(function() { var test = caller.id; alert(test.val()); }); });
Joda
  • 12,796
  • 10
  • 34
  • 33
1091
votes
11 answers

jQuery's jquery-1.10.2.min.map is triggering a 404 (Not Found)

I'm seeing error messages about a file, min.map, being not found: GET jQuery's jquery-1.10.2.min.map is triggering a 404 (Not Found) Screenshot Where is this coming from?
Paul Irish
  • 47,354
  • 22
  • 98
  • 132
1090
votes
59 answers

Git: cannot checkout branch - error: pathspec '...' did not match any file(s) known to git

I'm not sure why I'm unable to checkout a branch that I had worked on earlier. See the commands below (note: co is an alias for checkout): ramon@ramon-desktop:~/source/unstilted$ git branch -a * develop feature/datts_right …
Ramon Tayag
  • 15,224
  • 9
  • 43
  • 69
1090
votes
34 answers

How can I generate an MD5 hash in Java?

Is there any method to generate MD5 hash of a string in Java?
Akshay
  • 11,803
  • 5
  • 29
  • 26
1090
votes
23 answers

How do I remove/delete a folder that is not empty?

I am getting an 'access is denied' error when I attempt to delete a folder that is not empty. I used the following command in my attempt: os.remove("/folder_name"). What is the most effective way of removing/deleting a folder/directory that is not…
Amara
  • 13,839
  • 9
  • 32
  • 28
1 2 3
99
100