itemId stringlengths 1 34 | itemType stringclasses 4
values | site stringclasses 4
values | scrapedAt timestamp[s]date 2026-08-03 00:21:25 2026-08-03 04:01:45 | tagName stringlengths 1 34 ⌀ | questionCount int64 2 2.53M ⌀ | hasSynonyms bool 2
classes | isModeratorOnly bool 1
class | isRequired bool 1
class | link stringlengths 32 258 | _run_id stringclasses 57
values | _dataset_id stringclasses 57
values | questionId int64 1 80M ⌀ | title stringlengths 15 150 ⌀ | score int64 -10 35.3k ⌀ | viewCount int64 6 16.7M ⌀ | answerCount int64 0 296 ⌀ | isAnswered bool 2
classes | hasAcceptedAnswer bool 2
classes | tags listlengths 1 6 ⌀ | createdAt timestamp[s]date 2008-08-01 04:18:04 2026-08-03 03:37:34 ⌀ | lastActivityAt timestamp[s]date 2008-10-30 09:20:18 2026-08-03 01:36:51 ⌀ | ownerDisplayName stringlengths 3 30 ⌀ | isClosed bool 2
classes | contentLicense stringclasses 3
values | acceptedAnswerId int64 4 80M ⌀ | ownerUserId int64 1 33M ⌀ | ownerReputation int64 1 1.53M ⌀ | userId int64 13 33M ⌀ | displayName stringclasses 897
values | reputation int64 1 1.53M ⌀ | userType stringclasses 3
values | lastAccessAt timestamp[s]date 2011-01-10 08:55:57 2026-08-03 03:38:13 ⌀ | goldBadges int64 0 895 ⌀ | silverBadges int64 0 9.32k ⌀ | bronzeBadges int64 0 9.36k ⌀ | reputationChangeMonth int64 -40 1.43k ⌀ | reputationChangeYear int64 -1,146 11.7k ⌀ | websiteUrl stringclasses 302
values | location stringclasses 279
values | acceptRate int64 17 100 ⌀ | answerId int64 1.13k 80M ⌀ | isAccepted bool 2
classes | bodyText stringlengths 31 24.4k ⌀ | bodyHtml stringlengths 39 34.9k ⌀ | answers listlengths 1 3 ⌀ | answersFetched int64 0 3 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4907053 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/4907053 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 4,906,977 | null | 4,869 | null | null | null | null | null | 2011-02-05T13:18:00 | 2022-12-14T19:47:20 | Rod | null | CC BY-SA 4.0 | null | 64,633 | 56,811 | null | null | null | null | null | null | null | null | null | null | null | null | null | 4,907,053 | true | Environment variables are accessed through os.environ : import os print(os.environ['HOME']) To see a list of all environment variables: print(os.environ) If a key is not present, attempting to access it will raise a KeyError . To avoid this: # Returns `None` if the key doesn't exist print(os.environ.get('KEY_THAT_MIGHT... | <p>Environment variables are accessed through <a href="https://docs.python.org/library/os.html#os.environ" rel="noreferrer"><code>os.environ</code></a>:</p>
<pre><code>import os
print(os.environ['HOME'])
</code></pre>
<p>To see a list of all environment variables:</p>
<pre><code>print(os.environ)
</code></pre>
<hr />
<... | null | null |
793867 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/793867 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 793,858 | null | 4,867 | null | null | null | null | null | 2009-04-27T14:49:46 | 2019-01-23T21:04:22 | Brian Campbell | null | CC BY-SA 4.0 | null | 69,755 | 336,075 | null | null | null | null | null | null | null | null | null | null | null | null | null | 793,867 | true | Try mkdir -p : mkdir -p foo Note that this will also create any intermediate directories that don't exist; for instance, mkdir -p foo/bar/baz will create directories foo , foo/bar , and foo/bar/baz if they don't exist. Some implementation like GNU mkdir include mkdir --parents as a more readable alias, but this is not ... | <p>Try <a href="http://pubs.opengroup.org/onlinepubs/009695399/utilities/mkdir.html" rel="noreferrer"><code>mkdir -p</code></a>:</p>
<pre><code>mkdir -p foo
</code></pre>
<p>Note that this will also create any intermediate directories that don't exist; for instance,</p>
<pre><code>mkdir -p foo/bar/baz
</code></pre>
... | null | null |
5137509 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/5137509 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 5,137,497 | null | 4,848 | null | null | null | null | null | 2011-02-28T01:54:18 | 2016-07-31T12:34:02 | Russell Dias | null | CC BY-SA 3.0 | null | 322,129 | 73,993 | null | null | null | null | null | null | null | null | null | null | null | null | null | 5,137,509 | true | To get the full path to the directory a Python file is contained in, write this in that file: import os dir_path = os.path.dirname(os.path.realpath(__file__)) (Note that the incantation above won't work if you've already used os.chdir() to change your current working directory, since the value of the __file__ constant ... | <p>To get the full path to the directory a Python file is contained in, write this in that file:</p>
<pre><code>import os
dir_path = os.path.dirname(os.path.realpath(__file__))
</code></pre>
<p>(Note that the incantation above won't work if you've already used <code>os.chdir()</code> to change your current working d... | null | null |
22050116 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/22050116 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 22,049,212 | null | 4,843 | null | null | null | null | null | 2014-02-26T18:31:40 | 2019-11-07T15:25:50 | creack | null | CC BY-SA 4.0 | null | 884,978 | 122,992 | null | null | null | null | null | null | null | null | null | null | null | null | null | 22,050,116 | true | In order to copy a file from a container to the host, you can use the command docker cp <containerId>:/file/path/within/container /host/path/target Here's an example: $ sudo docker cp goofy_roentgen:/out_read.jpg . Here goofy_roentgen is the container name I got from the following command: $ sudo docker ps CONTAINER ID... | <p>In order to copy a file from a container to the host, you can use the command</p>
<pre><code>docker cp <containerId>:/file/path/within/container /host/path/target
</code></pre>
<p>Here's an example:</p>
<pre><code>$ sudo docker cp goofy_roentgen:/out_read.jpg .
</code></pre>
<p>Here <strong>goofy_roentgen<... | null | null |
1139797 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1139797 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,139,762 | null | 4,830 | null | null | null | null | null | 2009-07-16T19:32:50 | 2024-08-28T20:37:42 | trobrock | null | CC BY-SA 4.0 | null | 134,482 | 47,613 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,139,797 | true | To untrack a single file that has already been added/initialized to your repository, i.e. , stop tracking the file but not delete it from your system use: git rm --cached filename To untrack every file that is now in your .gitignore : First commit any outstanding code changes , and then, run this command: git rm -r --c... | <p>To untrack a <em>single</em> file that has already been added/initialized to your repository, <em>i.e.</em>, stop tracking the file but not delete it from your system use: <code>git rm --cached filename</code></p>
<p>To untrack <em>every</em> file that is now in your <code>.gitignore</code>:</p>
<p><strong>First com... | null | null |
11277439 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/11277439 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 11,277,432 | null | 4,828 | null | null | null | null | null | 2012-06-30T20:29:18 | 2023-01-23T09:50:59 | Sven Marnach | null | CC BY-SA 4.0 | null | 279,627 | 609,730 | null | null | null | null | null | null | null | null | null | null | null | null | null | 11,277,439 | true | To delete a key regardless of whether it is in the dictionary, use the two-argument form of dict.pop() : my_dict.pop('key', None) This will return my_dict[key] if key exists in the dictionary, and None otherwise. If the second parameter is not specified (i.e. my_dict.pop('key') ) and key does not exist, a KeyError is r... | <p>To delete a key regardless of whether it is in the dictionary, use the two-argument form of <a href="http://docs.python.org/library/stdtypes.html#dict.pop" rel="noreferrer"><code>dict.pop()</code></a>:</p>
<pre class="lang-py prettyprint-override"><code>my_dict.pop('key', None)
</code></pre>
<p>This will return <cod... | null | null |
2596835 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/2596835 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 2,596,805 | null | 4,797 | null | null | null | null | null | 2010-04-08T00:34:28 | 2022-07-11T06:33:07 | digitaldreamer | null | CC BY-SA 4.0 | null | 129,190 | 56,552 | null | null | null | null | null | null | null | null | null | null | null | null | null | 2,596,835 | true | Setting the default editor for Git Pick one: Set core.editor in your Git config: git config --global core.editor "vim" Set the GIT_EDITOR environment variable: export GIT_EDITOR=vim Setting the default editor for all programs Set the standardized VISUAL and EDITOR environment variables*: export VISUAL=vim export EDITOR... | <h4>Setting the default editor for Git</h4>
<p>Pick one:</p>
<ul>
<li><p>Set <a href="http://git-scm.com/book/en/Customizing-Git-Git-Configuration#Basic-Client-Configuration" rel="noreferrer"><code>core.editor</code></a> in your Git config:</p>
<pre><code>git config --global core.editor "vim"
</code></pre>
</... | null | null |
11227877 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/11227877 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 11,227,809 | null | 4,768 | null | null | null | null | null | 2012-06-27T13:54:45 | 2016-08-05T07:53:10 | Daniel Fischer | null | CC BY-SA 4.0 | null | 1,011,995 | 184,634 | null | null | null | null | null | null | null | null | null | null | null | null | null | 11,227,877 | false | Branch prediction. With a sorted array, the condition data[c] >= 128 is first false for a streak of values, then becomes true for all later values. That's easy to predict. With an unsorted array, you pay for the branching cost. | <p><strong>Branch prediction.</strong></p>
<p>With a sorted array, the condition <code>data[c] >= 128</code> is first <code>false</code> for a streak of values, then becomes <code>true</code> for all later values. That's easy to predict. With an unsorted array, you pay for the branching cost.</p>
| null | null |
8881376 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/8881376 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 8,881,291 | null | 4,767 | null | null | null | null | null | 2012-01-16T14:26:16 | 2023-12-27T05:12:02 | Jon Skeet | null | CC BY-SA 4.0 | null | 22,656 | 1,528,952 | null | null | null | null | null | null | null | null | null | null | null | null | null | 8,881,376 | true | Strings are immutable . That means once you've created the String , if another process can dump memory, there's no way (aside from reflection ) you can get rid of the data before garbage collection kicks in. With an array, you can explicitly wipe the data after you're done with it. You can overwrite the array with anyt... | <p><a href="https://stackoverflow.com/questions/1552301/immutability-of-strings-in-java">Strings are immutable</a>. That means once you've created the <code>String</code>, if another process can dump memory, there's no way (aside from <a href="https://en.wikipedia.org/wiki/Reflection_%28computer_programming%29" rel="no... | null | null |
1146981 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1146981 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,146,973 | null | 4,756 | null | null | null | null | null | 2009-07-18T07:57:46 | 2022-07-17T00:43:33 | 1800 INFORMATION | null | CC BY-SA 4.0 | null | 3,146 | 136,959 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,146,981 | true | To revert changes made to your working copy, do this: git checkout . Or equivalently, for git version >= 2.23: git restore . To revert changes made to the index (i.e., that you have added), do this. Warning this will reset all of your unpushed commits to master! : git reset To revert a change that you have committed: g... | <p>To revert changes made to your working copy, do this:</p>
<pre><code>git checkout .
</code></pre>
<p>Or equivalently, for git version >= 2.23:</p>
<pre><code>git restore .
</code></pre>
<p>To revert changes made to the index (i.e., that you have added), do this. <strong>Warning this will reset all of your unpushe... | null | null |
29485 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/29485 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 29,482 | null | 4,744 | null | null | null | null | null | 2008-08-27T03:59:42 | 2024-06-02T11:11:25 | FlySwat | null | CC BY-SA 4.0 | null | 1,965 | 176,523 | null | null | null | null | null | null | null | null | null | null | null | null | null | 29,485 | true | From an int: YourEnum foo = (YourEnum)yourInt; From a string: YourEnum foo = (YourEnum) Enum.Parse(typeof(YourEnum), yourString); // The foo.ToString().Contains(",") check is necessary for // enumerations marked with a [Flags] attribute. if (!Enum.IsDefined(typeof(YourEnum), foo) && !foo.ToString().Contains(",")) { thr... | <p>From an int:</p>
<pre><code>YourEnum foo = (YourEnum)yourInt;
</code></pre>
<p>From a string:</p>
<pre><code>YourEnum foo = (YourEnum) Enum.Parse(typeof(YourEnum), yourString);
// The foo.ToString().Contains(",") check is necessary for
// enumerations marked with a [Flags] attribute.
if (!Enum.IsDefined(... | null | null |
1394804 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1394804 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,394,797 | null | 4,744 | null | null | null | null | null | 2009-09-08T15:59:03 | 2021-10-25T15:39:22 | knittl | null | CC BY-SA 4.0 | null | 112,968 | 270,547 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,394,804 | true | Update 2020 / Git 2.23 Git 2.23 adds the new switch subcommand in an attempt to clear some of the confusion that comes from the overloaded usage of checkout (switching branches, restoring files, detaching HEAD, etc.) Starting with this version of Git, replace the checkout command with: git switch -c <new-branch> The be... | <h3>Update 2020 / Git 2.23</h3>
<p>Git 2.23 adds the new <a href="https://git-scm.com/docs/git-switch" rel="noreferrer"><code>switch</code></a> subcommand in an attempt to clear some of the confusion that comes from the overloaded usage of <a href="https://git-scm.com/docs/git-checkout" rel="noreferrer"><code>checkout<... | null | null |
14438954 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/14438954 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,960,473 | null | 4,734 | null | null | null | null | null | 2013-01-21T12:46:24 | 2023-04-03T13:09:01 | TLindig | null | CC BY-SA 4.0 | null | 496,587 | 50,538 | null | null | null | null | null | null | null | null | null | null | null | null | null | 14,438,954 | true | With JavaScript 1.6 / ECMAScript 5 you can use the native filter method of an Array in the following way to get an array with unique values: function onlyUnique(value, index, array) { return array.indexOf(value) === index; } // usage example: var a = ['a', 1, 'a', 2, '1']; var unique = a.filter(onlyUnique); console.log... | <p>With <em>JavaScript 1.6</em> / <em>ECMAScript 5</em> you can use the native <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/filter" rel="noreferrer" title="filter"><code>filter</code></a> method of an Array in the following way to get an array with unique values:</p>
<p><d... | null | null |
1109108 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1109108 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,109,022 | null | 4,720 | null | null | null | null | null | 2009-07-10T11:52:00 | 2021-02-21T09:44:50 | Reto Meier | null | CC BY-SA 4.0 | null | 822 | 96,876 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,109,108 | false | You can force Android to hide the virtual keyboard using the InputMethodManager , calling hideSoftInputFromWindow , passing in the token of the window containing your focused view. // Check if no view has focus: View view = this.getCurrentFocus(); if (view != null) { InputMethodManager imm = (InputMethodManager)getSyst... | <p>You can force Android to hide the virtual keyboard using the <a href="http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html" rel="noreferrer">InputMethodManager</a>, calling <a href="http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html#hideSoftInpu... | null | null |
11354850 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/11354850 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 11,346,283 | null | 4,718 | null | null | null | null | null | 2012-07-06T01:48:15 | 2023-06-12T16:52:21 | lexual | null | CC BY-SA 4.0 | null | 1,505,540 | 49,142 | null | null | null | null | null | null | null | null | null | null | null | null | null | 11,354,850 | false | Rename Specific Columns Use the df.rename() function and refer the columns to be renamed. Not all the columns have to be renamed: df = df.rename(columns={'oldName1': 'newName1', 'oldName2': 'newName2'}) # Or rename the existing DataFrame (rather than creating a copy) df.rename(columns={'oldName1': 'newName1', 'oldName2... | <h2>Rename Specific Columns</h2>
<p>Use the <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.rename.html" rel="noreferrer"><code>df.rename()</code></a> function and refer the columns to be renamed. Not all the columns have to be renamed:</p>
<pre><code>df = df.rename(columns={'oldNam... | null | null |
5511507 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/5511507 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 2,353,818 | null | 4,713 | null | null | null | null | null | 2011-04-01T09:28:07 | 2022-05-23T12:42:40 | yojimbo87 | null | CC BY-SA 4.0 | null | 217,288 | 68,945 | null | null | null | null | null | null | null | null | null | null | null | null | null | 5,511,507 | false | You can follow these tutorials to get started: Tutorials NodeSchool.io interactive lessons The Art of Node (an introduction to Node.js) Hello World Hello World Web Server (paid) Node.js guide Build a blog with Node.js, express and MongoDB Node.js for Beginners Learn Node.js Completely and with Confidence Node JS Proces... | <p>You can follow these tutorials to get started:</p>
<p><strong>Tutorials</strong></p>
<ul>
<li><p><a href="http://nodeschool.io/" rel="noreferrer">NodeSchool.io interactive lessons</a></p>
</li>
<li><p><a href="https://github.com/maxogden/art-of-node/#the-art-of-node" rel="noreferrer">The Art of Node (an introduction... | null | null |
7229996 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/7229996 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 7,229,885 | null | 4,693 | null | null | null | null | null | 2011-08-29T12:20:54 | 2021-10-21T14:16:07 | Wooble | null | CC BY-SA 4.0 | null | 110,707 | 90,920 | null | null | null | null | null | null | null | null | null | null | null | null | null | 7,229,996 | true | .gitkeep isn’t documented, because it’s not a feature of Git. Git cannot add a completely empty directory . People who want to track empty directories in Git have created the convention of putting files called .gitkeep in these directories. The file could be called anything; Git assigns no special significance to this ... | <p><code>.gitkeep</code> isn’t documented, because it’s not a feature of Git.</p>
<p>Git <a href="https://git.wiki.kernel.org/index.php/Git_FAQ#Can_I_add_empty_directories.3F" rel="noreferrer">cannot add a completely empty directory</a>. People who want to track empty directories in Git have created the convention of p... | null | null |
196038 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/196038 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 195,951 | null | 4,678 | null | null | null | null | null | 2008-10-12T20:45:36 | 2024-08-13T09:02:43 | Peter Boughton | null | CC BY-SA 4.0 | null | 9,360 | 112,718 | null | null | null | null | null | null | null | null | null | null | null | null | null | 196,038 | true | Modern HTML5 Techniques for changing classes Modern browsers have added classList which provides methods to make it easier to manipulate classes without needing a library: document.getElementById("MyElement").classList.add('MyClass'); document.getElementById("MyElement").classList.remove('MyClass'); if ( document.getEl... | <h2>Modern HTML5 Techniques for changing classes</h2>
<p>Modern browsers have added <a href="https://developer.mozilla.org/en-US/docs/DOM/element.classList" rel="noreferrer"><strong>classList</strong></a> which provides methods to make it easier to manipulate classes without needing a library:</p>
<pre><code>document.g... | null | null |
1186549 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1186549 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,186,535 | null | 4,675 | null | null | null | null | null | 2009-07-27T05:28:02 | 2023-06-04T07:34:57 | ZelluX | null | CC BY-SA 4.0 | null | 111,896 | 74,015 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,186,549 | true | Use git rebase . For example, to modify commit bbc643cd , run: git rebase --interactive bbc643cd~ Please note the tilde ~ at the end of the command, because you need to reapply commits on top of the previous commit of bbc643cd (i.e. bbc643cd~ ). In the default editor, modify pick to edit in the line mentioning bbc643cd... | <p>Use <a href="https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase" rel="noreferrer"><code>git rebase</code></a>. For example, to modify commit <code>bbc643cd</code>, run:</p>
<pre class="lang-bash prettyprint-override"><code>git rebase --interactive bbc643cd~
</code></pre>
<p>Please note the tilde <c... | null | null |
677212 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/677212 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 592,620 | null | 4,604 | null | null | null | null | null | 2009-03-24T12:45:20 | 2025-06-01T11:10:42 | lhunath | null | CC BY-SA 4.0 | null | 58,803 | 127,029 | null | null | null | null | null | null | null | null | null | null | null | null | null | 677,212 | true | Answer POSIX compatible: command -v <the_command> Example use: if ! command -v <the_command> >/dev/null 2>&1 then echo "<the_command> could not be found" exit 1 fi For Bash specific environments: hash <the_command> # For regular commands. Or... type <the_command> # To check built-ins and keywords Explanation Avoid whic... | <h2>Answer</h2>
<p>POSIX compatible:</p>
<pre><code>command -v <the_command>
</code></pre>
<p>Example use:</p>
<pre><code>if ! command -v <the_command> >/dev/null 2>&1
then
echo "<the_command> could not be found"
exit 1
fi
</code></pre>
<p>For Bash specific environments:</p... | null | null |
141098 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/141098 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 141,088 | null | 4,600 | null | null | null | null | null | 2008-09-26T18:22:10 | 2017-12-20T23:14:01 | Pablo Fernandez | null | CC BY-SA 3.0 | null | 7,595 | 105,688 | null | null | null | null | null | null | null | null | null | null | null | null | null | 141,098 | true | foreach(KeyValuePair<string, string> entry in myDictionary) { // do something with entry.Value or entry.Key } | <pre class="lang-cs prettyprint-override"><code>foreach(KeyValuePair<string, string> entry in myDictionary)
{
// do something with entry.Value or entry.Key
}
</code></pre>
| null | null |
2669766 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/2669766 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 2,669,690 | null | 4,599 | null | null | null | null | null | 2010-04-19T18:11:41 | 2019-03-10T18:30:03 | rjh | null | CC BY-SA 4.0 | null | 74,496 | 50,522 | null | null | null | null | null | null | null | null | null | null | null | null | null | 2,669,766 | true | It prevents JSON hijacking , a major JSON security issue that is formally fixed in all major browsers since 2011 with ECMAScript 5. Contrived example: say Google has a URL like mail.google.com/json?action=inbox which returns the first 50 messages of your inbox in JSON format. Evil websites on other domains can't make A... | <p>It prevents <a href="http://haacked.com/archive/2009/06/25/json-hijacking.aspx" rel="noreferrer">JSON hijacking</a>, a major JSON security issue that is formally <a href="https://security.stackexchange.com/questions/155518/why-json-hijacking-attack-doesnt-work-in-modern-browsers-how-was-it-fixed">fixed</a> in all ma... | null | null |
1034642 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1034642 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,034,621 | null | 4,597 | null | null | null | null | null | 2009-06-23T19:29:00 | 2025-04-09T07:31:39 | VolkerK | null | CC BY-SA 4.0 | null | 4,833 | 96,285 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,034,642 | true | Use: window.location.href As noted in the comments, the line below works, but breaks if you have a frame, image, or form with name="URL" . document.URL See URL of type DOMString, readonly . | <p>Use:</p>
<pre class="lang-none prettyprint-override"><code>window.location.href
</code></pre>
<p>As noted in the comments, the line below works, but breaks if you have a frame, image, or form with <code>name="URL"</code>.</p>
<pre class="lang-none prettyprint-override"><code>document.URL
</code></pre>
<p>S... | null | null |
5585800 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/5585800 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 5,585,779 | null | 4,581 | null | null | null | null | null | 2011-04-07T18:29:41 | 2025-03-14T15:53:12 | Rob Hruska | null | CC BY-SA 4.0 | null | 29,995 | 121,002 | null | null | null | null | null | null | null | null | null | null | null | null | null | 5,585,800 | true | String myString = "1234"; int foo = Integer.parseInt(myString); If you look at the Java documentation you'll notice the "catch" is that this function can throw a NumberFormatException , which you can handle: int foo; try { foo = Integer.parseInt(myString); } catch (NumberFormatException e) { foo = 0; } (This treatment ... | <pre><code>String myString = "1234";
int foo = Integer.parseInt(myString);
</code></pre>
<p>If you look at the <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html#parseInt(java.lang.String)" rel="noreferrer">Java documentation</a> you'll notice the "catch" is... | null | null |
35942890 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/35942890 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 35,942,754 | null | 4,573 | null | null | null | null | null | 2016-03-11T14:36:13 | 2024-06-14T07:39:58 | Neetika | null | CC BY-SA 4.0 | null | 5,574,889 | 45,984 | null | null | null | null | null | null | null | null | null | null | null | null | null | 35,942,890 | true | Attention: This method saves the credentials in plaintext on your PC's disk. Everyone on your computer can access it, e.g. malicious NPM modules. Run : git config --global credential.helper store then : git pull provide a username and password and those details will then be remembered later. The credentials are stored ... | <h2>Attention:</h2>
<p>This method saves the credentials in <strong>plaintext</strong> on your PC's disk. Everyone on your computer can access it, e.g. malicious NPM modules.</p>
<p><strong>Run</strong>:</p>
<pre><code>git config --global credential.helper store
</code></pre>
<p><strong>then</strong>:</p>
<pre><code>gi... | null | null |
990779 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/990779 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 990,754 | null | 4,559 | null | null | null | null | null | 2009-06-13T14:31:00 | 2019-11-26T16:19:27 | Brandon Rhodes | null | CC BY-SA 4.0 | null | 85,360 | 91,457 | null | null | null | null | null | null | null | null | null | null | null | null | null | 990,779 | true | Usually, activating a virtualenv gives you a shell function named: $ deactivate which puts things back to normal. I have just looked specifically again at the code for virtualenvwrapper , and, yes, it too supports deactivate as the way to escape from all virtualenvs. If you are trying to leave an Anaconda environment, ... | <p>Usually, activating a virtualenv gives you a shell function named:</p>
<pre><code>$ deactivate
</code></pre>
<p>which puts things back to normal.</p>
<p>I have just looked specifically again at the code for <code>virtualenvwrapper</code>, and, yes, it too supports <code>deactivate</code> as the way to escape from... | null | null |
805113 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/805113 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 805,107 | null | 4,558 | null | null | null | null | null | 2009-04-30T02:15:20 | 2024-11-30T19:28:44 | Anonymous | null | CC BY-SA 4.0 | null | 97,408 | 50,667 | null | null | null | null | null | null | null | null | null | null | null | null | null | 805,113 | true | ECMAScript 6 (ES6) introduces a new type of literal, namely template literals . They have many features, variable interpolation among others, but most importantly for this question, they can be multiline. A template literal is delimited by backticks : var html = ` <div> <span>Some HTML here</span> </div> `; (Note: I'm ... | <p><a href="https://en.wikipedia.org/wiki/ECMAScript#6th_Edition_%E2%80%93_ECMAScript_2015" rel="noreferrer">ECMAScript 6</a> (ES6) introduces a new type of literal, namely <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings" rel="noreferrer"><strong>template literals</strong></a... | null | null |
6677069 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/6677069 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 6,677,035 | null | 4,557 | null | null | null | null | null | 2011-07-13T09:52:36 | 2021-09-01T06:42:15 | Steve | null | CC BY-SA 4.0 | null | 343,088 | 50,591 | null | null | null | null | null | null | null | null | null | null | null | null | null | 6,677,069 | true | Assuming you have a button with the id button , try this example: $("#button").click(function() { $([document.documentElement, document.body]).animate({ scrollTop: $("#elementtoScrollToID").offset().top }, 2000); }); I got the code from the article Smoothly scroll to an element without a jQuery plugin . And I have test... | <p>Assuming you have a button with the id <code>button</code>, try this example:</p>
<pre><code>$("#button").click(function() {
$([document.documentElement, document.body]).animate({
scrollTop: $("#elementtoScrollToID").offset().top
}, 2000);
});
</code></pre>
<p>I got the code from ... | null | null |
965072 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/965072 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 965,053 | null | 4,548 | null | null | null | null | null | 2009-06-08T14:05:19 | 2025-03-21T07:22:40 | Anya Shenanigans | null | CC BY-SA 4.0 | null | 17,833 | 95,577 | null | null | null | null | null | null | null | null | null | null | null | null | null | 965,072 | true | First, get file name without the path: filename=$(basename -- "$fullfile") extension="${filename##*.}" filename="${filename%.*}" Alternatively, you can focus on the last '/' of the path instead of the '.' which should work even if you have unpredictable file extensions: filename="${fullfile##*/}" You may want to check ... | <p>First, get file name without the path:</p>
<pre class="lang-bash prettyprint-override"><code>filename=$(basename -- "$fullfile")
extension="${filename##*.}"
filename="${filename%.*}"
</code></pre>
<p>Alternatively, you can focus on the last '/' of the path instead of the '.' which shoul... | null | null |
6245587 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/6245587 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 6,245,570 | null | 4,542 | null | null | null | null | null | 2011-06-05T20:17:04 | 2023-07-20T10:28:15 | roberttdev | null | CC BY-SA 4.0 | null | 675,618 | 47,473 | null | null | null | null | null | null | null | null | null | null | null | null | null | 6,245,587 | true | git branch should show all the local branches of your repo. The starred branch is your current branch. To retrieve only the name of the branch you are on: git rev-parse --abbrev-ref HEAD Version 2.22 adds the --show-current option to ”print the name of the current branch” . The combination also works for freshly initia... | <pre><code>git branch
</code></pre>
<p>should show all the local branches of your repo. The starred branch is your current branch.</p>
<hr />
<p>To retrieve only the name of the branch you are on:</p>
<pre><code>git rev-parse --abbrev-ref HEAD
</code></pre>
<p>Version 2.22 adds the <code>--show-current</code> option to... | null | null |
651079 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/651079 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 651,038 | null | 4,536 | null | null | null | null | null | 2009-03-16T16:08:24 | 2020-09-19T09:42:56 | Can Berk Güder | null | CC BY-SA 4.0 | null | 2,119 | 114,490 | null | null | null | null | null | null | null | null | null | null | null | null | null | 651,079 | true | Option A: git clone git@github.com:whatever folder-name Ergo, for right here use: git clone git@github.com:whatever . Option B: Move the .git folder, too. Note that the .git folder is hidden in most graphical file explorers, so be sure to show hidden files. mv /where/it/is/right/now/* /where/I/want/it/ mv /where/it/is/... | <p><strong>Option A:</strong></p>
<pre><code>git clone git@github.com:whatever folder-name
</code></pre>
<p>Ergo, for <code>right here</code> use:</p>
<pre><code>git clone git@github.com:whatever .
</code></pre>
<p><strong>Option B:</strong></p>
<p>Move the <code>.git</code> folder, too. Note that the <code>.git</code>... | null | null |
312464 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/312464 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 312,443 | null | 4,506 | null | null | null | null | null | 2008-11-23T12:33:53 | 2022-06-04T21:22:56 | Ned Batchelder | null | CC BY-SA 4.0 | null | 14,343 | 379,020 | null | null | null | null | null | null | null | null | null | null | null | null | null | 312,464 | true | Here's a generator that yields evenly-sized chunks: def chunks(lst, n): """Yield successive n-sized chunks from lst.""" for i in range(0, len(lst), n): yield lst[i:i + n] import pprint pprint.pprint(list(chunks(range(10, 75), 10))) [[10, 11, 12, 13, 14, 15, 16, 17, 18, 19], [20, 21, 22, 23, 24, 25, 26, 27, 28, 29], [30... | <p>Here's a generator that yields evenly-sized chunks:</p>
<pre><code>def chunks(lst, n):
"""Yield successive n-sized chunks from lst."""
for i in range(0, len(lst), n):
yield lst[i:i + n]
</code></pre>
<pre><code>import pprint
pprint.pprint(list(chunks(range(10, 75), 10)))... | null | null |
5905066 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/5905066 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 5,905,054 | null | 4,492 | null | null | null | null | null | 2011-05-05T23:03:37 | 2023-12-29T09:16:26 | tux21b | null | CC BY-SA 4.0 | null | 82,219 | 96,255 | null | null | null | null | null | null | null | null | null | null | null | null | null | 5,905,066 | true | Use find : find . -name "foo*" find needs a starting point, so the . (dot) points to the current directory. If you need case insensitive search use : find . -iname "foo*" | <p>Use <a href="http://linux.die.net/man/1/find" rel="noreferrer"><code>find</code></a>:</p>
<pre><code>find . -name "foo*"
</code></pre>
<p><code>find</code> needs a starting point, so the <code>.</code> (dot) points to the current directory.</p>
<p>If you need <strong>case insensitive</strong> search use :<... | null | null |
466376 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/466376 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 466,345 | null | 4,471 | null | null | null | null | null | 2009-01-21T18:08:52 | 2022-08-07T23:30:57 | Patrick Harrington | null | CC BY-SA 4.0 | null | 41,165 | 48,042 | null | null | null | null | null | null | null | null | null | null | null | null | null | 466,376 | true | datetime.strptime parses an input string in the user-specified format into a timezone-naive datetime object: >>> from datetime import datetime >>> datetime.strptime('Jun 1 2005 1:33PM', '%b %d %Y %I:%M%p') datetime.datetime(2005, 6, 1, 13, 33) To obtain a date object using an existing datetime object, convert it using ... | <p><a href="https://docs.python.org/3/library/datetime.html#datetime.datetime.strptime" rel="noreferrer"><code>datetime.strptime</code></a> parses an input string in the user-specified format into a <em>timezone-naive</em> <a href="https://docs.python.org/3/library/datetime.html#datetime-objects" rel="noreferrer"><code... | null | null |
1024851 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1024851 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,024,847 | null | 4,464 | null | null | null | null | null | 2009-06-21T22:09:06 | 2021-02-12T09:08:03 | Paolo Bergantino | null | CC BY-SA 4.0 | null | 16,417 | 490,380 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,024,851 | true | You create a new key/value pair on a dictionary by assigning a value to that key d = {'key': 'value'} print(d) # {'key': 'value'} d['mynewkey'] = 'mynewvalue' print(d) # {'key': 'value', 'mynewkey': 'mynewvalue'} If the key doesn't exist, it's added and points to that value. If it exists, the current value it points to... | <p>You create a new key/value pair on a dictionary by assigning a value to that key</p>
<pre><code>d = {'key': 'value'}
print(d) # {'key': 'value'}
d['mynewkey'] = 'mynewvalue'
print(d) # {'key': 'value', 'mynewkey': 'mynewvalue'}
</code></pre>
<p>If the key doesn't exist, it's added and points to that value. If it... | null | null |
37938036 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/37938036 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 37,937,984 | null | 4,460 | null | null | null | null | null | 2016-06-21T07:26:25 | 2025-09-28T08:59:51 | blue112 | null | CC BY-SA 4.0 | null | 440,564 | 57,442 | null | null | null | null | null | null | null | null | null | null | null | null | null | 37,938,036 | false | You can use --allow-unrelated-histories to force the merge to happen. The reason behind this is that default behavior has changed since Git 2.9: "git merge" used to allow merging two branches that have no common base by default, which led to a brand new history of an existing project created and then get pulled by an u... | <p>You can use <code>--allow-unrelated-histories</code> to force the merge to happen.</p>
<p>The reason behind this is that default behavior has changed since Git 2.9:</p>
<blockquote>
<p>"git merge" used to allow merging two branches that have no common
base by default, which led to a brand new history of an... | null | null |
2047477 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/2047477 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 2,047,465 | null | 4,413 | null | null | null | null | null | 2010-01-12T07:52:32 | 2020-06-19T10:02:47 | Greg Hewgill | null | CC BY-SA 4.0 | null | 893 | 1,007,155 | null | null | null | null | null | null | null | null | null | null | null | null | null | 2,047,477 | true | Use git rm . If you want to remove the file from the Git repository and the filesystem , use: git rm file1.txt git commit -m "remove file1.txt" But if you want to remove the file only from the Git repository and not remove it from the filesystem, use: git rm --cached file1.txt git commit -m "remove file1.txt" And to pu... | <p>Use <a href="https://git-scm.com/docs/git-rm" rel="noreferrer"><code>git rm</code></a>.</p>
<p>If you want to remove the file from the Git repository <strong>and the filesystem</strong>, use:</p>
<pre class="lang-sh prettyprint-override"><code>git rm file1.txt
git commit -m "remove file1.txt"
</code></pre>
<p>But... | null | null |
47990 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/47990 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 47,981 | null | 4,405 | null | null | null | null | null | 2008-09-07T00:50:45 | 2023-10-19T13:14:44 | Paige Ruten | null | CC BY-SA 4.0 | null | 813 | 177,555 | null | null | null | null | null | null | null | null | null | null | null | null | null | 47,990 | true | Setting a bit Use the bitwise OR operator ( | ) to set n th bit of number to 1 . // Can be whatever unsigned integer type you want, but // it's important to use the same type everywhere to avoid // performance issues caused by mixing integer types. typedef unsigned long Uint; // In C++, this can be template. // In C11,... | <h3>Setting a bit</h3>
<p>Use the bitwise OR operator (<code>|</code>) to set <code>n</code>th bit of <code>number</code> to <code>1</code>.</p>
<pre class="lang-cpp prettyprint-override"><code>// Can be whatever unsigned integer type you want, but
// it's important to use the same type everywhere to avoid
// performan... | null | null |
363692 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/363692 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 363,681 | null | 4,404 | null | null | null | null | null | 2008-12-12T18:25:27 | 2024-08-22T05:52:13 | Greg Case | null | CC BY-SA 4.0 | null | 462 | 47,529 | null | null | null | null | null | null | null | null | null | null | null | null | null | 363,692 | false | Java 7+ In Java 1.7 or later , the standard way to do this (generate a basic non-cryptographically secure random integer in the range [min, max] ) is as follows: import java.util.concurrent.ThreadLocalRandom; // nextInt is normally exclusive of the top value, // so add 1 to make it inclusive int randomNum = ThreadLocal... | <h2>Java 7+</h2>
<p>In <strong>Java 1.7 or later</strong>, the standard way to do this (generate a basic non-cryptographically secure random integer in the range <em>[min, max]</em>) is as follows:</p>
<pre><code>import java.util.concurrent.ThreadLocalRandom;
// nextInt is normally exclusive of the top value,
// so ad... | null | null |
91795 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/91795 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 89,332 | null | 4,399 | null | null | null | null | null | 2008-09-18T11:38:25 | 2024-12-30T18:18:24 | Aristotle Pagaltzis | null | CC BY-SA 4.0 | null | 9,410 | 120,044 | null | null | null | null | null | null | null | null | null | null | null | null | null | 91,795 | true | Once you know the hash of the stash commit you dropped, you can apply it as a stash: git stash apply $stash_hash Or, you can create a separate branch for it with git branch recovered $stash_hash After that, you can do whatever you want with all the normal tools. When you’re done, just blow the branch away. Finding the ... | <p>Once you know the hash of the stash commit you dropped, you can apply it as a stash:</p>
<pre class="lang-bash prettyprint-override"><code>git stash apply $stash_hash
</code></pre>
<p>Or, you can create a separate branch for it with</p>
<pre class="lang-bash prettyprint-override"><code>git branch recovered $stash_ha... | null | null |
15321456 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/15321456 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 12,481,639 | null | 4,398 | null | null | null | null | null | 2013-03-10T10:56:37 | 2026-06-21T20:52:35 | juzzlin | null | CC BY-SA 4.0 | null | 2,153,571 | 49,023 | null | null | null | null | null | null | null | null | null | null | null | null | null | 15,321,456 | true | This is a question of moving the mistakenly committed files back to the staging area from the previous commit, without cancelling the changes done to them. This can be done like Paritosh Singh suggested: git reset --soft HEAD^ or git reset --soft HEAD~1 Then reset the unwanted files in order to leave them out from the ... | <p>This is a question of moving the mistakenly committed files back to the staging area from the previous commit, without cancelling the changes done to them. This can be done like Paritosh Singh suggested:</p>
<pre><code>git reset --soft HEAD^
</code></pre>
<p>or</p>
<pre><code>git reset --soft HEAD~1
</code></pre>
<... | null | null |
1732454 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1732454 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,732,348 | null | 4,394 | null | null | null | null | null | 2009-11-13T23:04:30 | 2020-11-12T14:21:18 | bobince | null | CC BY-SA 4.0 | null | 18,936 | 538,574 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,732,454 | true | You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool that is insufficiently so... | <p>You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool that is insufficiently... | null | null |
5235160 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/5235160 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 5,235,142 | null | 4,384 | null | null | null | null | null | 2011-03-08T16:17:12 | 2021-05-22T05:07:37 | Donut | null | CC BY-SA 4.0 | null | 121,493 | 113,613 | null | null | null | null | null | null | null | null | null | null | null | null | null | 5,235,160 | true | The following CSS rule disables resizing behavior for textarea elements: textarea { resize: none; } To disable it for some (but not all) textarea s, there are a couple of options . You can use class attribute in your tag( <textarea class="textarea1"> ): .textarea1 { resize: none; } To disable a specific textarea with t... | <p>The following CSS rule disables resizing behavior for <a href="http://www.w3.org/wiki/HTML/Elements/textarea" rel="noreferrer"><code>textarea</code></a> elements:</p>
<pre class="lang-css prettyprint-override"><code>textarea {
resize: none;
}
</code></pre>
<p>To disable it for some (but not all) <code>textarea</co... | null | null |
12830454 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/12830454 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 11,832,914 | null | 4,381 | null | null | null | null | null | 2012-10-11T00:27:24 | 2022-05-05T15:47:35 | A Kunin | null | CC BY-SA 4.0 | null | 1,736,537 | 44,792 | null | null | null | null | null | null | null | null | null | null | null | null | null | 12,830,454 | false | If the value is a text type: parseFloat("123.456").toFixed(2); If the value is a number: var numb = 123.23454; numb = numb.toFixed(2); There is a downside that values like 1.5 will give "1.50" as the output. A fix suggested by @minitech: var numb = 1.5; numb = +numb.toFixed(2); // Note the plus sign that drops any "ext... | <p>If the value is a text type:</p>
<pre><code>parseFloat("123.456").toFixed(2);
</code></pre>
<p>If the value is a number:</p>
<pre><code>var numb = 123.23454;
numb = numb.toFixed(2);
</code></pre>
<p>There is a downside that values like 1.5 will give "1.50" as the output. A fix suggested by @minit... | null | null |
9537923 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/9537923 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 9,537,392 | null | 4,360 | null | null | null | null | null | 2012-03-02T17:45:18 | 2026-01-04T04:24:36 | ralphtheninja | null | CC BY-SA 4.0 | null | 106,205 | 134,552 | null | null | null | null | null | null | null | null | null | null | null | null | null | 9,537,923 | true | Update: Using Git Switch All of the information written below was accurate, but a new command, git switch has been added that simplifies the effort. If daves_branch exists on the remote repository, but not on your local branch, you can simply type: git fetch --all git switch daves_branch Since you do not have the branc... | <h1>Update: Using Git Switch</h1>
<p>All of the information written below was accurate, but a new command, <a href="https://git-scm.com/docs/git-switch" rel="noreferrer"><code>git switch</code></a> has been added that simplifies the effort.</p>
<p>If <code>daves_branch</code> exists on the remote repository, but not on... | null | null |
24065533 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/24065533 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 2,052,390 | null | 4,329 | null | null | null | null | null | 2014-06-05T16:30:58 | 2021-02-15T08:39:21 | Aaron Hall | null | CC BY-SA 4.0 | null | 541,136 | 402,065 | null | null | null | null | null | null | null | null | null | null | null | null | null | 24,065,533 | true | How do I manually throw/raise an exception in Python? Use the most specific Exception constructor that semantically fits your issue . Be specific in your message, e.g.: raise ValueError('A very specific bad thing happened.') Don't raise generic exceptions Avoid raising a generic Exception . To catch it, you'll have to ... | <blockquote>
<h2>How do I manually throw/raise an exception in Python?</h2>
</blockquote>
<p><a href="https://docs.python.org/3/library/exceptions.html#exception-hierarchy" rel="noreferrer">Use the most specific Exception constructor that semantically fits your issue</a>.</p>
<p>Be specific in your message, e.g.:</p>
<... | null | null |
8467449 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/8467449 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 8,467,424 | null | 4,325 | null | null | null | null | null | 2011-12-11T21:04:56 | 2025-07-16T17:42:38 | sth | null | CC BY-SA 4.0 | null | 56,338 | 231,768 | null | null | null | null | null | null | null | null | null | null | null | null | null | 8,467,449 | true | Use printf instead: printf 'Hello, \nWorld!\n' printf behaves more consistently across different environments than echo . | <p>Use <code>printf</code> instead:</p>
<pre><code>printf 'Hello, \nWorld!\n'
</code></pre>
<p><code>printf</code> behaves more consistently across different environments than <code>echo</code>.</p>
| null | null |
596369 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/596369 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 596,351 | null | 4,306 | null | null | null | null | null | 2009-02-27T19:58:39 | 2022-07-05T13:36:05 | Peter J | null | CC BY-SA 4.0 | null | 56,018 | 57,947 | null | null | null | null | null | null | null | null | null | null | null | null | null | 596,369 | true | To get the value of the selected radioName item of a form with id myForm : $('input[name=radioName]:checked', '#myForm').val() Here's an example: $('#myForm input').on('change', function() { alert($('input[name=radioName]:checked', '#myForm').val()); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/j... | <p>To get the value of the <strong>selected</strong> <code>radioName</code> item of a form with id <code>myForm</code>:</p>
<pre><code>$('input[name=radioName]:checked', '#myForm').val()
</code></pre>
<p>Here's an example:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="fal... | null | null |
121163 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/121163 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 121,162 | null | 4,297 | null | null | null | null | null | 2008-09-23T13:59:04 | 2024-05-30T21:19:47 | Skizz | null | CC BY-SA 4.0 | null | 1,898 | 71,592 | null | null | null | null | null | null | null | null | null | null | null | null | null | 121,163 | true | The compiler is allowed to make one implicit conversion to resolve the parameters to a function. This means that the compiler can use constructors callable with a single parameter to convert from one type to another in order to get the right type for a parameter. Here's an example with converting constructors that show... | <p>The compiler is allowed to make one implicit conversion to resolve the parameters to a function. This means that the compiler can use constructors callable with a <strong>single parameter</strong> to convert from one type to another in order to get the right type for a parameter.</p>
<p>Here's an example with <em>co... | null | null |
1519032 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1519032 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,519,006 | null | 4,283 | null | null | null | null | null | 2009-10-05T09:29:17 | 2022-07-08T06:32:33 | Ikke | null | CC BY-SA 4.0 | null | 20,261 | 101,779 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,519,032 | false | First, create a new local branch and check it out: git checkout -b <branch-name> The remote branch is automatically created when you push it to the remote server: git push <remote-name> <branch-name> <remote-name> is typically origin , which is the name which git gives to the remote you cloned from. Your colleagues may... | <p>First, create a new local branch and check it out:</p>
<pre><code>git checkout -b <branch-name>
</code></pre>
<p>The remote branch is automatically created when you push it to the remote server:</p>
<pre><code>git push <remote-name> <branch-name>
</code></pre>
<p><code><remote-name></code> i... | null | null |
40878 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/40878 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 40,471 | null | 4,266 | null | null | null | null | null | 2008-09-02T23:02:37 | 2023-02-07T13:26:15 | Josh Brown | null | CC BY-SA 4.0 | null | 2,030 | 53,452 | null | null | null | null | null | null | null | null | null | null | null | null | null | 40,878 | true | There are several differences between HashMap and Hashtable in Java: Hashtable is synchronized , whereas HashMap is not. This makes HashMap better for non-threaded applications, as unsynchronized Objects typically perform better than synchronized ones. Hashtable does not allow null keys or values. HashMap allows one nu... | <p>There are several differences between <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/HashMap.html" rel="noreferrer"><code>HashMap</code></a> and <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Hashtable.html" rel="noreferrer"><code>Hashtable</code></a>... | null | null |
21947627 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/21947627 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 21,947,452 | null | 4,262 | null | null | null | null | null | 2014-02-22T00:02:01 | 2017-03-13T07:16:29 | T.J. Crowder | null | CC BY-SA 3.0 | null | 157,247 | 1,083,808 | null | null | null | null | null | null | null | null | null | null | null | null | null | 21,947,627 | true | Pure speculation is that you're using a terminal that attempts to do word-wrapping rather than character-wrapping, and treats B as a word character but # as a non-word character. So when it reaches the end of a line and searches for a place to break the line, it sees a # almost immediately and happily breaks there; whe... | <p><em>Pure speculation</em> is that you're using a terminal that attempts to do <a href="http://en.wikipedia.org/wiki/Word_wrap" rel="noreferrer">word-wrapping</a> rather than character-wrapping, and treats <code>B</code> as a word character but <code>#</code> as a non-word character. So when it reaches the end of a l... | null | null |
218510 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/218510 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 218,384 | null | 4,227 | null | null | null | null | null | 2008-10-20T13:54:24 | 2022-09-08T01:07:47 | Vincent Ramdhanie | null | CC BY-SA 4.0 | null | 27,439 | 103,300 | null | null | null | null | null | null | null | null | null | null | null | null | null | 218,510 | true | There are two overarching types of variables in Java: Primitives : variables that contain data. If you want to manipulate the data in a primitive variable you can manipulate that variable directly. By convention primitive types start with a lowercase letter. For example variables of type int or char are primitives. Ref... | <p>There are two overarching types of variables in Java:</p>
<ol>
<li><p><em>Primitives</em>: variables that contain data. If you want to manipulate the data in a primitive variable you can manipulate that variable directly. By convention primitive types start with a lowercase letter. For example variables of type <cod... | null | null |
1984225 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1984225 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 176,264 | null | 4,218 | null | null | null | null | null | 2009-12-31T06:32:58 | 2014-06-23T15:11:47 | Roger Pate | null | CC BY-SA 4.0 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,984,225 | false | URI s identify and URL s locate ; however, locators are also identifiers , so every URL is also a URI, but there are URIs which are not URLs. Examples Roger Pate This is my name, which is an identifier. It is like a URI, but cannot be a URL, as it tells you nothing about my location or how to contact me. In this case i... | <p><strong><a href="http://en.wikipedia.org/wiki/Uniform_Resource_Identifier" rel="noreferrer">URI</a>s identify</strong> and <strong><a href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator" rel="noreferrer">URL</a>s locate</strong>; however, <strong>locators are also identifiers</strong>, so every URL is also a... | null | null |
9339460 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/9339460 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 9,339,429 | null | 4,213 | null | null | null | null | null | 2012-02-18T07:29:42 | 2023-05-09T08:18:24 | Philip Fourie | null | CC BY-SA 4.0 | null | 11,123 | 118,207 | null | null | null | null | null | null | null | null | null | null | null | null | null | 9,339,460 | true | Cherry-picking in Git means choosing a commit from one branch and applying it to another. This contrasts with other ways such as merge and rebase which normally apply many commits to another branch. It's also possible to cherry-pick multiple commits but merge is the preferred way over cherry-picking. Make sure you are ... | <p>Cherry-picking in Git means choosing a commit from one branch and applying it to another.</p>
<p>This contrasts with other ways such as <code>merge</code> and <code>rebase</code> which normally apply many commits to another branch.</p>
<p>It's also possible to <a href="https://stackoverflow.com/questions/1670970/how... | null | null |
1027367 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1027367 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,027,354 | null | 4,209 | null | null | null | null | null | 2009-06-22T14:00:00 | 2019-06-15T06:10:48 | Paul Dixon | null | CC BY-SA 4.0 | null | 6,521 | 302,402 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,027,367 | true | You can remove bullets by setting the list-style-type to none on the CSS for the parent element (typically a <ul> ), for example: ul { list-style-type: none; } You might also want to add padding: 0 and margin: 0 to that if you want to remove indentation as well. See Listutorial for a great walkthrough of list formattin... | <p>You can remove bullets by setting the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type" rel="noreferrer"><code>list-style-type</code></a> to <code>none</code> on the CSS for the parent element (typically a <code><ul></code>), for example:</p>
<pre class="lang-css prettyprint-override"... | null | null |
5404869 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/5404869 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 5,404,839 | null | 4,209 | null | null | null | null | null | 2011-03-23T11:57:51 | 2022-07-17T06:30:14 | Roy | null | CC BY-SA 4.0 | null | 333,426 | 44,328 | null | null | null | null | null | null | null | null | null | null | null | null | null | 5,404,869 | true | Use location.reload() . For example, to reload whenever an element with id="something" is clicked: $('#something').click(function() { location.reload(); }); The reload() function takes an optional parameter that can be set to true to force a reload from the server rather than the cache. The parameter defaults to false ... | <p>Use <a href="https://developer.mozilla.org/en-US/docs/Web/API/Location/reload" rel="noreferrer"><code>location.reload()</code></a>.</p>
<p>For example, to reload whenever an element with <code>id="something"</code> is clicked:</p>
<pre><code>$('#something').click(function() {
location.reload();
});
</c... | null | null |
31971697 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/31971697 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 22,907,231 | null | 4,203 | null | null | null | null | null | 2015-08-12T17:25:00 | 2026-01-01T20:48:28 | 0x7d7b | null | CC BY-SA 4.0 | null | 2,706,422 | 54,880 | null | null | null | null | null | null | null | null | null | null | null | null | null | 31,971,697 | true | The cp command can be used to copy files. One specific file can be copied to the container like: docker cp foo.txt container_id:/foo.txt One specific file can be copied from the container like: docker cp container_id:/foo.txt foo.txt For emphasis, container_id is a container ID, not an image ID. (Use docker ps to view ... | <p>The <code>cp</code> command can be used to copy files.</p>
<p>One specific file can be copied <em><strong>to</strong></em> the container like:</p>
<pre class="lang-none prettyprint-override"><code>docker cp foo.txt container_id:/foo.txt
</code></pre>
<p>One specific file can be copied <em><strong>from</strong></em> ... | null | null |
171256 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/171256 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 171,251 | null | 4,198 | null | null | null | null | null | 2008-10-05T00:33:25 | 2023-03-28T10:48:45 | John Millikin | null | CC BY-SA 4.0 | null | 3,560 | 202,258 | null | null | null | null | null | null | null | null | null | null | null | null | null | 171,256 | true | ECMAScript 2018 Standard Method You would use object spread : let merged = {...obj1, ...obj2}; merged is now the union of obj1 and obj2 . Properties in obj2 will overwrite those in obj1 . /** There's no limit to the number of objects you can merge. * Later properties overwrite earlier properties with the same name. */ ... | <p><strong>ECMAScript 2018 Standard Method</strong></p>
<p>You would use <a href="https://github.com/tc39/proposal-object-rest-spread" rel="noreferrer">object spread</a>:</p>
<pre><code>let merged = {...obj1, ...obj2};
</code></pre>
<p><code>merged</code> is now the union of <code>obj1</code> and <code>obj2</code>. Pro... | null | null |
92123 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/92123 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 92,082 | null | 4,189 | null | null | null | null | null | 2008-09-18T12:34:33 | 2018-07-03T20:44:15 | James Boother | null | CC BY-SA 4.0 | null | 16,030 | 43,003 | null | null | null | null | null | null | null | null | null | null | null | null | null | 92,123 | true | Syntax: ALTER TABLE {TABLENAME} ADD {COLUMNNAME} {TYPE} {NULL|NOT NULL} CONSTRAINT {CONSTRAINT_NAME} DEFAULT {DEFAULT_VALUE} WITH VALUES Example: ALTER TABLE SomeTable ADD SomeCol Bit NULL --Or NOT NULL. CONSTRAINT D_SomeTable_SomeCol --When Omitted a Default-Constraint Name is autogenerated. DEFAULT (0)--Optional Defa... | <h2>Syntax:</h2>
<pre><code>ALTER TABLE {TABLENAME}
ADD {COLUMNNAME} {TYPE} {NULL|NOT NULL}
CONSTRAINT {CONSTRAINT_NAME} DEFAULT {DEFAULT_VALUE}
WITH VALUES
</code></pre>
<h2>Example:</h2>
<pre><code>ALTER TABLE SomeTable
ADD SomeCol Bit NULL --Or NOT NULL.
CONSTRAINT D_SomeTable_SomeCol --When Omitted a ... | null | null |
1130 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1130 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,108 | null | 4,173 | null | null | null | null | null | 2008-08-04T10:41:04 | 2026-01-31T23:53:43 | Xenph Yan | null | CC BY-SA 4.0 | null | 264 | 84,191 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,130 | true | Why is it needed? When data is stored on disk-based storage devices, it is stored as blocks of data. These blocks are accessed in their entirety, making them the atomic disk access operation. Disk blocks are structured in much the same way as linked lists; both contain a section for data, a pointer to the location of t... | <p><strong>Why is it needed?</strong></p>
<p>When data is stored on disk-based storage devices, it is stored as blocks of data. These blocks are accessed in their entirety, making them the atomic disk access operation. Disk blocks are structured in much the same way as linked lists; both contain a section for data, a p... | null | null |
1414366 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1414366 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,414,365 | null | 4,170 | null | null | null | null | null | 2009-09-12T05:23:34 | 2014-06-25T20:18:33 | gnarf | null | CC BY-SA 3.0 | null | 91,914 | 106,660 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,414,366 | true | jQuery 1.6+ To change the disabled property you should use the .prop() function. $("input").prop('disabled', true); $("input").prop('disabled', false); jQuery 1.5 and below The .prop() function doesn't exist, but .attr() does similar: Set the disabled attribute. $("input").attr('disabled','disabled'); To enable again, ... | <h2>jQuery 1.6+</h2>
<p>To change the <code>disabled</code> property you should use the <a href="http://api.jquery.com/prop" rel="noreferrer"><code>.prop()</code></a> function.</p>
<pre><code>$("input").prop('disabled', true);
$("input").prop('disabled', false);
</code></pre>
<h2>jQuery 1.5 and below</h2>
<p>The <c... | null | null |
949391 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/949391 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 949,314 | null | 4,160 | null | null | null | null | null | 2009-06-04T09:05:57 | 2025-03-04T04:15:10 | Jakub Narębski | null | CC BY-SA 4.0 | null | 46,058 | 328,820 | null | null | null | null | null | null | null | null | null | null | null | null | null | 949,391 | true | To turn any extended object reference into a hash, use git-rev-parse : git rev-parse HEAD or git rev-parse --verify HEAD As noted by Alexander's answer , you can also retrieve the short hash: git rev-parse --short HEAD To turn references (e.g. branches and tags ) into hashes, use git show-ref and git for-each-ref . | <p>To turn any extended object reference into a hash, use <strong><a href="http://git-scm.com/docs/git-rev-parse" rel="noreferrer" title="git-rev-parse - Pick out and massage parameters"><code>git-rev-parse</code></a></strong>:</p>
<pre><code>git rev-parse HEAD
</code></pre>
<p>or</p>
<pre><code>git rev-parse --verify ... | null | null |
2612815 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/2612815 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 2,612,802 | null | 4,158 | null | null | null | null | null | 2010-04-10T08:55:21 | 2025-12-21T05:36:37 | Felix Kling | null | CC BY-SA 4.0 | null | 218,196 | 821,265 | null | null | null | null | null | null | null | null | null | null | null | null | null | 2,612,815 | true | new_list = my_list doesn't actually create a second list. The assignment just copies the reference to the list, not the actual list, so both new_list and my_list refer to the same list after the assignment. To actually copy the list, you have several options: You can use the built-in list.copy() method (available since... | <p><code>new_list = my_list</code> doesn't actually create a second list. The assignment just copies the reference to the list, not the actual list, so both <code>new_list</code> and <code>my_list</code> refer to the same list after the assignment.</p>
<p>To actually copy the list, you have several options:</p>
<ul>
<l... | null | null |
1951752 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1951752 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,951,742 | null | 4,147 | null | null | null | null | null | 2009-12-23T09:52:24 | 2020-07-30T10:49:56 | hsz | null | CC BY-SA 4.0 | null | 223,386 | 152,903 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,951,752 | true | To create a new symlink (will fail if symlink exists already): ln -s /path/to/file /path/to/symlink To create or update a symlink: ln -sf /path/to/file /path/to/symlink | <p>To create a new symlink (will fail if symlink exists already):</p>
<pre><code>ln -s /path/to/file /path/to/symlink
</code></pre>
<p>To create or update a symlink:</p>
<pre><code>ln -sf /path/to/file /path/to/symlink
</code></pre>
| null | null |
111200 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/111200 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 111,102 | null | 4,145 | null | null | null | null | null | 2008-09-21T15:16:36 | 2020-03-28T05:44:05 | Ali | null | CC BY-SA 4.0 | null | 8,689 | 1,044 | null | null | null | null | null | null | null | null | null | null | null | null | null | 111,200 | false | Every function in JavaScript maintains a link to its outer lexical environment. A lexical environment is a map of all the names (eg. variables, parameters) within a scope, with their values. So, whenever you see the function keyword, code inside that function has access to variables declared outside the function. funct... | <p>Every function in JavaScript maintains a link to its outer lexical environment. A lexical environment is a map of all the names (eg. variables, parameters) within a scope, with their values.</p>
<p>So, whenever you see the <code>function</code> keyword, code inside that function has access to variables declared out... | null | null |
6127884 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/6127884 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 6,127,328 | null | 4,131 | null | null | null | null | null | 2011-05-25T16:40:19 | 2024-12-15T14:26:55 | Adam Dymitruk | null | CC BY-SA 4.0 | null | 1,864,976 | 131,312 | null | null | null | null | null | null | null | null | null | null | null | null | null | 6,127,884 | true | NOTE: You can add other branches to exclude like master and dev if your workflow has those as a possible ancestor. Usually I branch off of a "sprint-start" tag and master , dev and qa are not ancestors. First, list locally-tracking branches that were merged in remote (consider using -r flag to list all remote-tracking ... | <p>NOTE: You can add other branches to exclude like master and dev if your workflow has those as a possible ancestor. Usually I branch off of a "sprint-start" tag and <code>master</code>, <code>dev</code> and <code>qa</code> are not ancestors.</p>
<hr />
<p>First, list locally-tracking branches that were merg... | null | null |
17239853 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/17239853 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 15,852,122 | null | 4,111 | null | null | null | null | null | 2013-06-21T16:15:35 | 2022-01-20T18:58:49 | Ben Clayton | null | CC BY-SA 4.0 | null | 228,109 | 82,367 | null | null | null | null | null | null | null | null | null | null | null | null | null | 17,239,853 | true | Here's a correct table of percentages to hex values for opacity. E.g. for 50% white you'd use #80FFFFFF. To think in terms of transparency instead, flip the order of the percentages (more opaque = less transparent). % Hex 100% FF 95% F2 90% E6 85% D9 80% CC 75% BF 70% B3 65% A6 60% 99 55% 8C 50% 80 45% 73 40% 66 35% 59... | <p>Here's a correct table of percentages to hex values for opacity. E.g. for 50% white you'd use #80FFFFFF. To think in terms of transparency instead, flip the order of the percentages (more opaque = less transparent).</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>%</th>
<th>Hex</th>
</tr... | null | null |
9834872 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/9834872 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 9,834,689 | null | 4,091 | null | null | null | null | null | 2012-03-23T06:11:26 | 2024-04-12T09:08:22 | Lazy Badger | null | CC BY-SA 4.0 | null | 960,558 | 98,243 | null | null | null | null | null | null | null | null | null | null | null | null | null | 9,834,872 | false | Use git diff . git diff [<options>] <commit>..<commit> [--] [<path>…] <commit> is a branch name, a commit hash, or a shorthand symbolic reference. Examples: git diff abc123..def567 git diff HEAD..origin/master That will produce the diff between the tips of the two branches. If you'd prefer to find the changes that oc... | <p>Use <a href="https://git-scm.com/docs/git-diff" rel="noreferrer"><code>git diff</code></a>.</p>
<pre><code>git diff [<options>] <commit>..<commit> [--] [<path>…]
</code></pre>
<p><code><commit></code> is a branch name, a commit hash, or a shorthand symbolic reference.</p>
<p>Examples:... | null | null |
8073687 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/8073687 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 8,073,673 | null | 4,069 | null | null | null | null | null | 2011-11-10T00:37:49 | 2024-02-11T14:50:13 | user229044 | null | CC BY-SA 4.0 | null | 229,044 | 241,245 | null | null | null | null | null | null | null | null | null | null | null | null | null | 8,073,687 | true | Use unshift . It's like push , except it adds elements to the beginning of the array instead of the end. unshift / push - add an element to the beginning/end of an array shift / pop - remove and return the first/last element of an array A simple diagram... unshift -> [array] <- push shift <- [array] -> pop and chart: a... | <p>Use <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/unshift" rel="noreferrer"><code>unshift</code></a>. It's like <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/push" rel="noreferrer"><code>push</code></a>, except it adds elements to the beginn... | null | null |
8909176 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/8909176 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,642,028 | null | 4,069 | null | null | null | null | null | 2012-01-18T11:18:08 | 2020-01-08T22:51:59 | unsynchronized | null | CC BY-SA 4.0 | null | 830,899 | 4,928 | null | null | null | null | null | null | null | null | null | null | null | null | null | 8,909,176 | false | Or for something completely different... x slides to 0 . while (x --\ \ \ \ > 0) printf("%d ", x); Not so mathematical, but... every picture paints a thousand words... | <p>Or for something completely different... <code>x</code> slides to <code>0</code>.</p>
<pre><code>while (x --\
\
\
\
> 0)
printf("%d ", x);
</code></pre>
<p>Not so mathematical, but... every picture paints a thousand words...</p>
| null | null |
415519 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/415519 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 415,511 | null | 4,054 | null | null | null | null | null | 2009-01-06T04:57:05 | 2026-01-06T17:34:20 | Harley Holcombe | null | CC BY-SA 4.0 | null | 1,057 | 183,952 | null | null | null | null | null | null | null | null | null | null | null | null | null | 415,519 | true | Use datetime : >>> import datetime >>> now = datetime.datetime.now() >>> now datetime.datetime(2009, 1, 6, 15, 8, 24, 78915) >>> str(now) '2009-01-06 15:08:24.078915' For just the clock time without the date: >>> now.time() datetime.time(15, 8, 24, 78915) >>> str(now.time()) '15:08:24.078915' To save typing, you can im... | <p>Use <a href="https://docs.python.org/3/library/datetime.html" rel="noreferrer"><code>datetime</code></a>:</p>
<pre><code>>>> import datetime
>>> now = datetime.datetime.now()
>>> now
datetime.datetime(2009, 1, 6, 15, 8, 24, 78915)
>>> str(now)
'2009-01-06 15:08:24.078915'
</code><... | null | null |
952945 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/952945 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 952,924 | null | 4,054 | null | null | null | null | null | 2009-06-04T20:35:48 | 2025-01-21T15:33:49 | Jon Erickson | null | CC BY-SA 4.0 | null | 1,950 | 115,416 | null | null | null | null | null | null | null | null | null | null | null | null | null | 952,945 | true | You can use the substring function: let str = "12345.00"; str = str.substring(0, str.length - 1); console.log(str); This is the accepted answer, but as per the conversations below, the slice syntax is much clearer: let str = "12345.00"; str = str.slice(0, -1); console.log(str); Neither method mutates | <p>You can use the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring" rel="noreferrer">substring</a> function:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false" data-babel-preset-react="false" data-babel-preset-ts... | null | null |
1643247 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1643247 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,643,227 | null | 4,049 | null | null | null | null | null | 2009-10-29T12:05:38 | 2009-10-29T12:05:38 | rahul | null | CC BY-SA 2.5 | null | 47,738 | 187,650 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,643,247 | true | $("#yourdropdownid option:selected").text(); | <pre><code>$("#yourdropdownid option:selected").text();
</code></pre>
| null | null |
1986909 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1986909 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,986,896 | null | 4,047 | null | null | null | null | null | 2009-12-31T20:00:42 | 2021-01-26T11:08:15 | flatline | null | CC BY-SA 4.0 | null | 20,846 | 42,723 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,986,909 | true | The difference is that apply lets you invoke the function with arguments as an array; call requires the parameters be listed explicitly. A useful mnemonic is " A for a rray and C for c omma." See MDN's documentation on apply and call . Pseudo syntax: theFunction.apply(valueForThis, arrayOfArgs) theFunction.call(valueFo... | <p>The difference is that <code>apply</code> lets you invoke the function with <code>arguments</code> as an array; <code>call</code> requires the parameters be listed explicitly. A useful mnemonic is <em>"<strong>A</strong> for <strong>a</strong>rray and <strong>C</strong> for <strong>c</strong>omma."</em></p... | null | null |
16048358 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/16048358 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 16,047,306 | null | 4,045 | null | null | null | null | null | 2013-04-16T22:35:27 | 2019-11-19T19:29:30 | Ken Cochrane | null | CC BY-SA 4.0 | null | 356,788 | 77,725 | null | null | null | null | null | null | null | null | null | null | null | null | null | 16,048,358 | true | Docker originally used LinuX Containers (LXC), but later switched to runC (formerly known as libcontainer ), which runs in the same operating system as its host. This allows it to share a lot of the host operating system resources. Also, it uses a layered filesystem ( AuFS ) and manages networking. AuFS is a layered fi... | <p>Docker originally used <a href="https://linuxcontainers.org/lxc/" rel="noreferrer">LinuX Containers</a> (LXC), but later switched to <a href="https://github.com/opencontainers/runc" rel="noreferrer">runC</a> (formerly known as <strong>libcontainer</strong>), which runs in the same operating system as its host. This ... | null | null |
6877747 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/6877747 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 6,877,727 | null | 4,032 | null | null | null | null | null | 2011-07-29T19:00:39 | 2023-12-13T00:54:25 | Peder Klingenberg | null | CC BY-SA 4.0 | null | 797,604 | 42,475 | null | null | null | null | null | null | null | null | null | null | null | null | null | 6,877,747 | true | unset is the command you're looking for. unset GNUPLOT_DRIVER_DIR | <p><code>unset</code> is the command you're looking for.</p>
<pre class="lang-bash prettyprint-override"><code>unset GNUPLOT_DRIVER_DIR
</code></pre>
| null | null |
1669524 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1669524 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 136,097 | null | 4,023 | null | null | null | null | null | 2009-11-03T19:13:48 | 2021-04-12T08:43:11 | unutbu | null | CC BY-SA 4.0 | null | 190,597 | 888,423 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,669,524 | true | Maybe a bit of example code will help: Notice the difference in the call signatures of foo , class_foo and static_foo : class A(object): def foo(self, x): print(f"executing foo({self}, {x})") @classmethod def class_foo(cls, x): print(f"executing class_foo({cls}, {x})") @staticmethod def static_foo(x): print(f"executing... | <p>Maybe a bit of example code will help: Notice the difference in the call signatures of <code>foo</code>, <code>class_foo</code> and <code>static_foo</code>:</p>
<pre><code>class A(object):
def foo(self, x):
print(f"executing foo({self}, {x})")
@classmethod
def class_foo(cls, x):
... | null | null |
930398 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/930398 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 930,397 | null | 4,020 | null | null | null | null | null | 2009-05-30T19:29:55 | 2021-10-31T16:07:11 | Sasha Chedygov | null | CC BY-SA 4.0 | null | 104,184 | 131,640 | null | null | null | null | null | null | null | null | null | null | null | null | null | 930,398 | true | some_list[-1] is the shortest and most Pythonic. In fact, you can do much more with this syntax. The some_list[-n] syntax gets the nth-to-last element. So some_list[-1] gets the last element, some_list[-2] gets the second to last, etc, all the way down to some_list[-len(some_list)] , which gives you the first element. ... | <p><code>some_list[-1]</code> is the shortest and most Pythonic.</p>
<p>In fact, you can do much more with this syntax. The <code>some_list[-n]</code> syntax gets the nth-to-last element. So <code>some_list[-1]</code> gets the last element, <code>some_list[-2]</code> gets the second to last, etc, all the way down to <c... | null | null |
519157 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/519157 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 5,113,374 | null | 4,002 | null | null | null | null | null | 2009-02-06T04:56:55 | 2021-05-29T04:04:27 | Jim Puls | null | CC BY-SA 4.0 | null | 6,010 | 81,608 | null | null | null | null | null | null | null | null | null | null | null | null | null | 519,157 | false | You want the typeof operator . Specifically: if (typeof variable !== 'undefined') { // the variable is defined } | <p>You want <a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Operators/Special_Operators/typeof_Operator" rel="noreferrer">the <code>typeof</code> operator</a>. Specifically:</p>
<pre><code>if (typeof variable !== 'undefined') {
// the variable is defined
}
</code></pre>
| null | null |
33352604 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/33352604 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 3,746,725 | null | 3,984 | null | null | null | null | null | 2015-10-26T18:03:26 | 2022-02-09T08:31:16 | Niko Ruotsalainen | null | CC BY-SA 4.0 | null | 4,079,317 | 54,492 | null | null | null | null | null | null | null | null | null | null | null | null | null | 33,352,604 | false | In ES6 using Array from() and keys() methods. Array.from(Array(10).keys()) //=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] Shorter version using spread operator . [...Array(10).keys()] //=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] Start from 1 by passing map function to Array from() , with an object with a length property: Array.from({lengt... | <p>In ES6 using Array <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from" rel="noreferrer"><code>from()</code></a> and <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/keys" rel="noreferrer"><code>keys()</code></a> methods.... | null | null |
21718540 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/21718540 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 4,114,095 | null | 3,981 | null | null | null | null | null | 2014-02-12T04:18:01 | 2024-11-24T14:23:29 | Yarin | null | CC BY-SA 4.0 | null | 165,673 | 186,519 | null | null | null | null | null | null | null | null | null | null | null | null | null | 21,718,540 | false | Lots of complicated and dangerous answers here, but it's actually easy: git revert --no-commit 0d1d7fc3..HEAD git commit git push This will revert everything from the HEAD back to the commit hash (excluded), meaning it will recreate that commit state in the working tree as if every commit after 0d1d7fc3 had been walked... | <p>Lots of complicated and dangerous answers here, but it's actually easy:</p>
<pre><code>git revert --no-commit 0d1d7fc3..HEAD
git commit
git push
</code></pre>
<p>This will revert everything from the HEAD back to the commit hash (excluded), meaning it will recreate that commit state in the working tree <em>as if</em>... | null | null |
477578 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/477578 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 549 | null | 3,977 | null | null | null | null | null | 2009-01-25T11:27:46 | 2021-11-11T12:03:07 | Jens Roland | null | CC BY-SA 4.0 | null | 57,068 | 27,830 | null | null | null | null | null | null | null | null | null | null | null | null | null | 477,578 | true | PART I: How To Log In We'll assume you already know how to build a login+password HTML form which POSTs the values to a script on the server side for authentication. The sections below will deal with patterns for sound practical auth, and how to avoid the most common security pitfalls. To HTTPS or not to HTTPS? Unless ... | <h2>PART I: How To Log In</h2>
<p>We'll assume you already know how to build a login+password HTML form which POSTs the values to a script on the server side for authentication. The sections below will deal with patterns for sound practical auth, and how to avoid the most common security pitfalls.</p>
<p><strong>To HTT... | null | null |
10726185 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/10726185 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 10,725,729 | null | 3,972 | null | null | null | null | null | 2012-05-23T18:58:49 | 2024-03-05T20:50:14 | simont | null | CC BY-SA 4.0 | null | 1,084,945 | 73,795 | null | null | null | null | null | null | null | null | null | null | null | null | null | 10,726,185 | true | From man git-stash (which can also be obtained via git help stash ): The modifications stashed away by this command can be listed with git stash list , inspected with git stash show , and ... show [<stash>] Show the changes recorded in the stash as a diff between the stashed state and its original parent. When no <stas... | <p>From <code>man git-stash</code> (which can also be obtained via <code>git help stash</code>):</p>
<blockquote>
<p>The modifications stashed away by this command can be listed with <code>git stash list</code>, inspected with <code>git stash show</code>, and ...</p>
</blockquote>
<pre><code>show [<stash>]
Sh... | null | null |
5097495 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/5097495 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 5,097,456 | null | 3,967 | null | null | null | null | null | 2011-02-23T21:38:10 | 2026-05-15T21:21:28 | Ben Jackson | null | CC BY-SA 4.0 | null | 479,989 | 94,816 | null | null | null | null | null | null | null | null | null | null | null | null | null | 5,097,495 | true | If your excess commits are only visible to you, you can just do git reset --hard origin/<branch_name> to move back to where the origin is. This will reset the state of the repository to the previous commit. WARNING: This also discards all your uncommitted local file changes. Doing a git revert makes new commits to remo... | <p>If your excess commits are only visible to you, you can just do
<code>git reset --hard origin/<branch_name></code>
to move back to where the origin is. This will reset the state of the repository to the previous commit. WARNING: This also discards all your uncommitted local file changes.</p>
<p>Doing a <code>g... | null | null |
48199 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/48199 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 48,198 | null | 3,960 | null | null | null | null | null | 2008-09-07T06:28:33 | 2024-05-02T20:09:21 | Brad Wilson | null | CC BY-SA 4.0 | null | 1,554 | 71,272 | null | null | null | null | null | null | null | null | null | null | null | null | null | 48,199 | true | PowerShell TCP Get-Process -Id (Get-NetTCPConnection -LocalPort YourPortNumberHere).OwningProcess This shows several columns of information about the process. The Id column is the PID you need if you want to kill it with taskkill /PID <pid> . UDP Get-Process -Id (Get-NetUDPEndpoint -LocalPort YourPortNumberHere).Owning... | <h1><a href="https://en.wikipedia.org/wiki/PowerShell" rel="noreferrer">PowerShell</a></h1>
<h2>TCP</h2>
<pre><code>Get-Process -Id (Get-NetTCPConnection -LocalPort YourPortNumberHere).OwningProcess
</code></pre>
<p>This shows several columns of information about the process. The Id column is the PID you need if you w... | null | null |
2901298 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/2901298 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 2,901,102 | null | 3,957 | null | null | null | null | null | 2010-05-25T00:40:59 | 2025-12-19T16:29:38 | Elias Zamaria | null | CC BY-SA 4.0 | null | 28,324 | 101,964 | null | null | null | null | null | null | null | null | null | null | null | null | null | 2,901,298 | true | I used the idea from Kerry's answer , but I simplified it since I was just looking for something simple for my specific purpose. Here is what I have: function numberWithCommas(x) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } function numberWithCommas(x) { return x.toString().replace(/\B(?<!\.\d*)(?=(\d... | <p>I used the idea from <a href="https://stackoverflow.com/questions/2901102/how-can-i-format-a-number-with-commas-as-thousands-separators/2901136#2901136">Kerry's answer</a>, but I simplified it since I was just looking for something simple for my specific purpose. Here is what I have:</p>
<pre><code>function numberWi... | null | null |
4438292 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/4438292 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 3,796,927 | null | 3,947 | null | null | null | null | null | 2010-12-14T10:43:12 | 2018-10-19T06:46:07 | Mathias Bynens | null | CC BY-SA 4.0 | null | 96,656 | 151,024 | null | null | null | null | null | null | null | null | null | null | null | null | null | 4,438,292 | true | With version 2.13 of Git and later, --recurse-submodules can be used instead of --recursive : git clone --recurse-submodules -j8 git://github.com/foo/bar.git cd bar Editor’s note: -j8 is an optional performance optimization that became available in version 2.8, and fetches up to 8 submodules at a time in parallel — see... | <p>With version 2.13 of Git and later, <code>--recurse-submodules</code> can be used instead of <code>--recursive</code>:</p>
<pre><code>git clone --recurse-submodules -j8 git://github.com/foo/bar.git
cd bar
</code></pre>
<p><sup>Editor’s note: <code>-j8</code> is an optional performance optimization that became avai... | null | null |
23938978 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/23938978 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 23,935,141 | null | 3,935 | null | null | null | null | null | 2014-05-29T17:09:52 | 2024-03-01T17:11:30 | Daiwei | null | CC BY-SA 4.0 | null | 1,544,590 | 44,406 | null | null | null | null | null | null | null | null | null | null | null | null | null | 23,938,978 | true | You will need to save the Docker image as a tar file: docker save -o <path for generated tar file> <image name> Then copy your image to a new system with regular file transfer tools such as cp , scp , or rsync (preferred for big files). After that you will have to load the image into Docker: docker load -i <path to ima... | <p>You will need to save the Docker image as a tar file:</p>
<pre><code>docker save -o <path for generated tar file> <image name>
</code></pre>
<p>Then copy your image to a new system with regular file transfer tools such as <code>cp</code>, <code>scp</code>, or <code>rsync</code> (preferred for big files).... | null | null |
2816728 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/2816728 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 2,816,715 | null | 3,912 | null | null | null | null | null | 2010-05-12T07:24:18 | 2022-07-25T02:40:56 | Lara Bailey | null | CC BY-SA 4.0 | null | 19,563 | 805,258 | null | null | null | null | null | null | null | null | null | null | null | null | null | 2,816,728 | true | Create the branch using a commit hash: git branch branch_name <commit-hash> Or by using a symbolic reference: git branch branch_name HEAD~3 To checkout the branch while creating it, use: git checkout -b branch_name <commit-hash or HEAD~3> | <p>Create the branch using a commit hash:</p>
<pre><code>git branch branch_name <commit-hash>
</code></pre>
<p>Or by using a symbolic reference:</p>
<pre><code>git branch branch_name HEAD~3
</code></pre>
<p>To checkout the branch while creating it, use:</p>
<pre><code>git checkout -b branch_name <commit-hash o... | null | null |
3209434 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/3209434 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 339,923 | null | 3,908 | null | null | null | null | null | 2010-07-09T02:34:02 | 2024-02-28T14:11:59 | Eric Nguyen | null | CC BY-SA 4.0 | null | 98,068 | 40,692 | null | null | null | null | null | null | null | null | null | null | null | null | null | 3,209,434 | true | Basics For controlling "cellpadding" in CSS, you can simply use padding on table cells. E.g. for 10px of "cellpadding": td, th { /* table cells */ padding: 10px; } For "cellspacing", you can apply the border-spacing CSS property to your table. E.g. for 10px of "cellspacing": table { border-spacing: 10px; border-collaps... | <p><strong>Basics</strong></p>
<p>For controlling "cellpadding" in CSS, you can simply use <code>padding</code> on table cells. E.g. for 10px of "cellpadding":</p>
<pre class="lang-css prettyprint-override"><code>td, th { /* table cells */
padding: 10px;
}
</code></pre>
<p>For "cellspacing&... | null | null |
322742 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/322742 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 322,715 | null | 3,898 | null | null | null | null | null | 2008-11-27T01:49:42 | 2026-05-27T21:29:33 | Jonathan Tran | null | CC BY-SA 4.0 | null | 12,887 | 15,336 | null | null | null | null | null | null | null | null | null | null | null | null | null | 322,742 | true | Summary ArrayList with ArrayDeque are preferable in many more use-cases than LinkedList . If you're not sure — just start with ArrayList . TLDR, in ArrayList accessing an element takes constant time [O(1)] and adding an element takes O(n) time [worst case]. In LinkedList inserting an element takes O(n) time and accessi... | <p><strong>Summary</strong> <code>ArrayList</code> with <code>ArrayDeque</code> are preferable in <em>many</em> more use-cases than <code>LinkedList</code>. If you're not sure — just start with <code>ArrayList</code>.</p>
<hr />
<p>TLDR, in <code>ArrayList</code> accessing an element takes constant time [O(1)] and addi... | null | null |
1032653 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1032653 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,030,169 | null | 3,897 | null | null | null | null | null | 2009-06-23T13:42:29 | 2020-03-11T05:48:39 | Henrik Gustafsson | null | CC BY-SA 4.0 | null | 2,010 | 55,368 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,032,653 | true | If it's the first time you check-out a repo you need to use --init first: git submodule update --init --recursive For git 1.8.2 or above, the option --remote was added to support updating to latest tips of remote branches: git submodule update --recursive --remote This has the added benefit of respecting any "non defau... | <p>If it's <strong>the first time</strong> you check-out a repo you need to use <code>--init</code> first:</p>
<pre><code>git submodule update --init --recursive
</code></pre>
<p>For <strong>git 1.8.2</strong> or above, the option <code>--remote</code> was added to support updating to latest tips of remote branches:<... | null | null |
3088012 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/3088012 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 3,087,975 | null | 3,895 | null | null | null | null | null | 2010-06-21T19:50:20 | 2020-04-18T18:30:27 | Aren | null | CC BY-SA 4.0 | null | 317,975 | 56,126 | null | null | null | null | null | null | null | null | null | null | null | null | null | 3,088,012 | true | In light of the passage of time, as people have mentioned, you can now safely just use: li { cursor: pointer; } | <p>In light of the passage of time, as people have mentioned, you can now safely just use:</p>
<pre class="lang-css prettyprint-override"><code>li { cursor: pointer; }
</code></pre>
| null | null |
1825807 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1825807 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,825,585 | null | 3,893 | null | null | null | null | null | 2009-12-01T12:12:38 | 2020-01-02T07:33:10 | user156862 | null | CC BY-SA 4.0 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,825,807 | true | Use $PSVersionTable.PSVersion to determine the engine version. If the variable does not exist, it is safe to assume the engine is version 1.0 . Note that $Host.Version and (Get-Host).Version are not reliable - they reflect the version of the host only, not the engine. PowerGUI, PowerShellPLUS, etc. are all hosting appl... | <p>Use <code>$PSVersionTable.PSVersion</code> to determine the engine version. If the variable does not exist, it is safe to assume the engine is version <code>1.0</code>.</p>
<p>Note that <code>$Host.Version</code> and <code>(Get-Host).Version</code> are not reliable - they reflect
the version of the host only, not t... | null | null |
12867753 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/12867753 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 9,794,985 | null | 3,862 | null | null | null | null | null | 2012-10-12T22:06:11 | 2023-09-11T17:47:55 | chuck97224 | null | CC BY-SA 4.0 | null | 543,858 | 38,786 | null | null | null | null | null | null | null | null | null | null | null | null | null | 12,867,753 | true | I had the same problem. Don't remember where I found it on the web, but here is what I did: Click "Start button" in the search box, enter "Turn windows features on or off" in the features window, Click: "Internet Information Services" Click: "World Wide Web Services" Click: "Application Development Features" Check (ena... | <p>I had the same problem. Don't remember where I found it on the web, but here is what I did:</p>
<ul>
<li>Click "Start button"</li>
<li>in the search box, enter "Turn windows features on or off"</li>
<li>in the features window, Click: "Internet Information Services"</li>
<li>Click: "... | null | null |
11237235 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/11237235 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 11,227,809 | null | 3,861 | null | null | null | null | null | 2012-06-28T02:14:03 | 2022-07-03T15:12:52 | WiSaGaN | null | CC BY-SA 4.0 | null | 866,732 | 48,427 | null | null | null | null | null | null | null | null | null | null | null | null | null | 11,237,235 | false | The reason why performance improves drastically when the data is sorted is that the branch prediction penalty is removed, as explained beautifully in Mysticial's answer . Now, if we look at the code if (data[c] >= 128) sum += data[c]; we can find that the meaning of this particular if... else... branch is to add someth... | <p>The reason why performance improves drastically when the data is sorted is that the branch prediction penalty is removed, as explained beautifully in <a href="//stackoverflow.com/questions/11227809/why-is-it-faster-to-process-a-sorted-array-than-an-unsorted-array/11227902#11227902">Mysticial's answer</a>.</p>
<p>Now... | null | null |
1085810 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/1085810 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 1,085,801 | null | 3,844 | null | null | null | null | null | 2009-07-06T07:29:43 | 2022-07-24T22:53:54 | Paolo Bergantino | null | CC BY-SA 4.0 | null | 16,417 | 490,380 | null | null | null | null | null | null | null | null | null | null | null | null | null | 1,085,810 | true | Given a select element that looks like this: <select id="ddlViewBy"> <option value="1">test1</option> <option value="2" selected="selected">test2</option> <option value="3">test3</option> </select> Running this code: var e = document.getElementById("ddlViewBy"); var value = e.value; var text = e.options[e.selectedIndex... | <p>Given a select element that looks like this:</p>
<pre class="lang-html prettyprint-override"><code><select id="ddlViewBy">
<option value="1">test1</option>
<option value="2" selected="selected">test2</option>
<option value="3"&g... | null | null |
11369406 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/11369406 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 11,369,375 | null | 3,842 | null | null | null | null | null | 2012-07-06T20:41:39 | 2019-08-09T02:19:58 | Tadeck | null | CC BY-SA 4.0 | null | 548,696 | 138,390 | null | null | null | null | null | null | null | null | null | null | null | null | null | 11,369,406 | true | The following command deletes all your stashes: git stash clear From the git documentation : clear Remove all the stashed states. IMPORTANT WARNING: Those states will then be subject to pruning, and may be impossible to recover (...). | <p>The following command deletes all your stashes:</p>
<pre><code>git stash clear
</code></pre>
<p>From the <a href="http://www.kernel.org/pub/software/scm/git/docs/git-stash.html" rel="noreferrer">git documentation</a>:</p>
<blockquote>
<p><strong><code>clear</code></strong></p>
<p>Remove all the stashed states.</p>
<... | null | null |
47787025 | answer | stackoverflow | 2026-08-03T01:57:01 | null | null | null | null | null | https://stackoverflow.com/a/47787025 | C5IUtYwb765dRarGt | 6oAlHJZHBQQzjvMCL | 47,190,861 | null | 3,840 | null | null | null | null | null | 2017-12-13T06:42:15 | 2026-01-10T07:40:44 | LJHarb | null | CC BY-SA 4.0 | null | 632,724 | 41,524 | null | null | null | null | null | null | null | null | null | null | null | null | null | 47,787,025 | true | (nvm maintainer here) nvm alias default 6.11.5 if you want it pegged to that specific version. You can also do nvm alias default 16 or nvm alias default node . Either way, you'll want to upgrade to the latest version of nvm (v0.39.2 as of this writing) # nvm set default node.js version 16.14.2 $ nvm alias default 16.14... | <p>(nvm maintainer here)</p>
<p><code>nvm alias default 6.11.5</code> if you want it pegged to that specific version.</p>
<p>You can also do <code>nvm alias default 16</code> or <code>nvm alias default node</code>.</p>
<p>Either way, you'll want to upgrade to the latest version of <code>nvm</code> (v0.39.2 as of this w... | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.