See what the Stackoverflow community is most excited about today.
Date: 2017-12-06
-
tags: git, git-merge, git-cherry-pick
207 votes, 2 answers and 72369 views
\r\n I created a new branch named newbranch from the master branch in git. Now I have done some work and want to merge newbranch to master; however, I have made some extra changes to newbranch and I want ...\r\n
-
How do I delete (unset) an exported environment variable?
tags: linux, environment-variables, unset
967 votes, 3 answers and 547486 views
\r\n Before installing gnuplot I set the environment variable GNUPLOT_DRIVER_DIR = /home/gnuplot/build/src.\n\nDuring the installation something went wrong; now I want to remove the GNUPLOT_DRIVER_DIR ...\r\n
-
How to add many functions in ONE ng-click?
tags: javascript, angularjs
229 votes, 4 answers and 220663 views
\r\n I've be looking for how to execute this but I can't find anything related so far, :( \nI could nest both functions yes but I'm just wondering if this is possible?\nI'd like to do this literally:\n\n<td&...\r\n
-
How do I get the name of a Ruby class?
tags: ruby-on-rails, ruby, rails-activerecord
305 votes, 4 answers and 182446 views
\r\n How can I get the class name from an ActiveRecord object?\n\nI have:\n\nresult = User.find(1)\r\nI tried:\n\nresult.class\n# => User(id: integer, name: string ...)\nresult.to_s\n# => #User:0x3d07cdc...\r\n
-
tags: python, python-3.x, python-import
342 votes, 5 answers and 176057 views
\r\n I want to import a function from another file in the same directory.\n\nSometimes it works for me with from .mymodule import myfunction but sometimes I get a:\n\nSystemError: Parent module '' not loaded, ...\r\n
-
Is there a standardized method to swap two variables in Python?
tags: python, syntax, swap, conventions
184 votes, 5 answers and 100816 views
\r\n In Python, I've seen two variable values swapped using this syntax:\n\nleft, right = right, left\r\nIs this considered the standard way to swap two variable values or is there some other means by which ...\r\n
-
How can Python iterate over dictionaries with 'for' loops using only the dict keys?
tags: python, python-2.7, dictionary, key, iteration
1657 votes, 12 answers and 2233477 views
\r\n I am a bit puzzled by the following code:\n\nd = {'x': 1, 'y': 2, 'z': 3} \nfor key in d:\n print key, 'corresponds to', d[key]\r\nWhat I don't understand is the key portion. How does Python recognize ...\r\n
-
What is the difference between state and props in React?
tags: javascript, reactjs
203 votes, 7 answers and 63149 views
\r\n I was watching a Pluralsight course on React and the instructor stated that props should not be changed. I'm now reading an article (uberVU/react-guide) on props vs. state and it says \r\n Both props ...\r\n
-
In Python, when to use a Dictionary, List or Set?
tags: python, list, dictionary, set
207 votes, 7 answers and 110534 views
\r\n When should I use a dictionary, list or set?\n\nAre there scenarios that are more suited for each data type?\r\n
-
When to delete branches in Git?
tags: git, github, git-branch, git-gui
206 votes, 7 answers and 43470 views
\r\n Suppose we have an application that's stable. \n\nTomorrow, someone reports a big ol' bug that we decide to hotfix right away. So we create a branch for that hotfix off of "master", we name it "...\r\n