Highest scored questions

7586 votes
40 answers
3.4m views

Given an object: let myObject = { "ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*" }; How do I remove the property ...
johnstok's user avatar
  • 98.6k
7530 votes
26 answers
1.3m views

What are metaclasses? What are they used for?
Bite code's user avatar
  • 602k
7403 votes
3 answers
8.4m views

Usually I would expect a String.contains() method, but there doesn't seem to be one. What is a reasonable way to check for this?
7347 votes
41 answers
6.1m views

How do I check whether a file exists or not, without using the try statement?
spence91's user avatar
  • 80.8k
7126 votes
45 answers
3.7m views

I want to merge two dictionaries into a new dictionary. x = {'a': 1, 'b': 2} y = {'b': 3, 'c': 4} z = merge(x, y) >>> z {'a': 1, 'b': 3, 'c': 4} Whenever a key k is present in both ...
Carl Meyer's user avatar
  • 128k
6902 votes
36 answers
5.4m views

I have a repo (origin) on a USB key that I cloned on my hard drive (local). I moved "origin" to a NAS and successfully tested cloning it from here. I would like to know if I can change the ...
Bite code's user avatar
  • 602k
6771 votes
26 answers
2.0m views

How do I move my recent commits on master to a new branch, and reset master to before those commits were made? e.g. From this: master A - B - C - D - E To this: newbranch C - D - E / ...
Mark A. Nicolosi's user avatar
6744 votes
44 answers
2.2m views

How do I return the response/result from a function foo that makes an asynchronous request? I am trying to return the value from the callback, as well as assigning the result to a local variable ...
Felix Kling's user avatar
6480 votes
41 answers
4.6m views

How do I discard changes in my working copy that are not in the index?
readonly's user avatar
  • 359k
6462 votes
42 answers
3.7m views

Background Information Analysis: According to RFC 2616, § 9.5, POST is used to create a resource: The POST method is used to request that the origin server accept the entity enclosed in the request ...
alex's user avatar
  • 76.4k
6431 votes
35 answers
1.5m views

What is the difference between the units of measure px, dip, dp, and sp?
capecrawler's user avatar
  • 68.4k
6414 votes
82 answers
2.9m views

How do I get the path of the directory in which a Bash script is located, inside that script? I want to use a Bash script as a launcher for another application. I want to change the working directory ...
6413 votes
38 answers
2.4m views

ECMAScript 6 introduced the let declaration keyword. I've heard that it's described as a local variable, but I'm still not quite sure how it behaves differently than the var keyword. What are the ...
TM.'s user avatar
  • 112k
6381 votes
72 answers
4.5m views

How do I include a JavaScript file inside another JavaScript file, similar to @import in CSS?
Alec Smart's user avatar
  • 96.2k
6293 votes
66 answers
5.2m views

How do I call an external command within Python as if I had typed it in a shell or command prompt?
freshWoWer's user avatar
  • 64.7k

15 30 50 per page