Skip to content

Latest commit

 

History

History
97 lines (43 loc) · 4.84 KB

2017-11-26.md

File metadata and controls

97 lines (43 loc) · 4.84 KB

Trending in Stackoverflow

See what the Stackoverflow community is most excited about today.

Date: 2017-11-26

  1. 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

  2. How do I return the response from an asynchronous call?

    tags: javascript, ajax, asynchronous, ecmascript-6, ecmascript-2017

    3543 votes, 24 answers and 928827 views

    \r\n I have a function foo which makes an Ajax request. How can I return the response from foo?\n\nI tried to return the value from the success callback as well as assigning the response to a local variable ...\r\n

  3. 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

  4. How to write a bash script that takes optional input arguments?

    tags: bash

    226 votes, 8 answers and 112567 views

    \r\n I want my script to be able to take an optional input, \n\ne.g. currently my script is \n\n#!/bin/bash\nsomecommand foo\r\nbut I would like it to say:\n\n#!/bin/bash\nsomecommand [ if $1 exists, $1, else, foo ]...\r\n

  5. What are the uses of the exec command in shell scripts?

    tags: shell, unix, exec

    182 votes, 2 answers and 204064 views

    \r\n Can anyone explain what are the uses of the exec command in shell scripting with simple examples?\r\n

  6. Is bool a native C type?

    tags: c, gcc, linux-kernel, boolean

    196 votes, 10 answers and 213752 views

    \r\n I've noticed that the Linux kernel code uses bool, but I thought that bool was a C++ type. Is bool a standard C extension (e.g., ISO C90) or a GCC extension?\r\n

  7. When is it practical to use DFS vs BFS?

    tags: algorithm, graph, graph-algorithm, breadth-first-search, depth-first-search

    191 votes, 14 answers and 133393 views

    \r\n I understand the differences between DFS (Depth First Search) and BFS (Breadth First Search), but I'm interested to know when it's more practical to use one over the other? \n\nCould anyone give any ...\r\n

  8. Access an arbitrary element in a dictionary in Python

    tags: python, dictionary

    290 votes, 11 answers and 254760 views

    \r\n If a dict is not empty, I access an arbitrary element as:\n\ndict[dict.keys()[0]]\r\nIs there any better way to do this?\r\n

  9. How can I force gradle to redownload dependencies?

    tags: gradle

    423 votes, 11 answers and 274353 views

    \r\n How can I tell gradle to redownload dependencies from repositories?\r\n

  10. What's the difference between tilde(~) and caret(^) in package.json?

    tags: javascript, node.js, npm

    1847 votes, 12 answers and 348616 views

    \r\n After I upgraded to latest stable node and npm, I tried npm install moment --save. It saves the entry in the package.json with the caret(^) prefix. Previously, it was a tilde(~) prefix. \r\nWhy are ...\r\n