RSS

Posts in 2021

  • Most votes on sorting questions 2

    May 01, 2021 in FAQ

    Most votes on sorting questions 2. #11 Sort ArrayList of custom Objects by property #12 How can I sort a dictionary by key? #13 How to sort an array of integers correctly #14 Swift Beta performance: sorting arrays #15 How to sort a list of objects based on an attribute of the objects? #16 How do you sort a dictionary by value? #17 Sorting object property by values #18 Sorting 1 million 8-decimal-digit numbers with 1 MB of RAM #19 How to sort a list/tuple of lists/tuples by the element at a given index? #20 Sort JavaScript object by key

    Read all the top votes questions and answers in a single page. #11: Sort ArrayList of custom Objects by property (Score: 1205) Created: 2010-05-06 Last updated: 2016-01-27 Tags: java, sorting, date, comparator I read about sorting ArrayLists using a …

    Read more

  • Most votes on sorting questions 10

    May 01, 2021 in FAQ

    Most votes on sorting questions 10. #91 MySQL: Sort GROUP_CONCAT values #92 Python data structure sort list alphabetically #93 Which sort algorithm works best on mostly sorted data? #94 How to use Comparator in Java to sort #95 When is each sorting algorithm used? #96 Order data frame rows according to vector with specific order #97 How to sort Counter by value? - python #98 Java 8 stream reverse order #99 Sort a list from another list IDs #100 How do I sort a Set to a List in Java?

    Read all the top votes questions and answers in a single page. #91: MySQL: Sort GROUP_CONCAT values (Score: 185) Created: 2009-06-15 Last updated: 2017-08-22 Tags: mysql, sorting, sql-order-by, group-concat In short: Is there any way to sort the …

    Read more

  • Most votes on sorting questions 1

    May 01, 2021 in FAQ

    Most votes on sorting questions 1. #1 How can I pair socks from a pile efficiently? #2 How do I sort a dictionary by value? #3 Sort array of objects by string property value #4 How do I sort a list of dictionaries by a value of the dictionary? #5 Sort a Map<Key, Value> by values #6 Sorting an array of objects by property values #7 How to sort a dataframe by multiple column(s) #8 How to Sort a List<T> by a property in the object #9 How do I sort an NSMutableArray with custom objects in it? #10 How to Sort Multi-dimensional Array by Value?

    Read all the top votes questions and answers in a single page. #1: How can I pair socks from a pile efficiently? (Score: 4004) Created: 2013-01-19 Last updated: 2020-04-23 Tags: algorithm, sorting, language-agnostic, matching Yesterday I was pairing …

    Read more

  • Most votes on shell questions 9

    May 01, 2021 in FAQ

    Most votes on shell questions 9. #81 How to get a password from a shell script without echoing #82 Aborting a shell script if any command returns a non-zero value #83 Expansion of variables inside single quotes in a command in Bash #84 How to determine whether a given Linux is 32 bit or 64 bit? #85 Using cURL to upload POST data with files #86 Can a shell script set environment variables of the calling shell? #87 How to add a progress bar to a shell script? #88 What is the difference between "#!/usr/bin/env bash" and "#!/usr/bin/bash"? #89 Pipe output and capture exit status in Bash #90 How to create a cron job using Bash automatically without the interactive editor?

    Read all the top votes questions and answers in a single page. #81: How to get a password from a shell script without echoing (Score: 484) Created: 2010-10-20 Last updated: 2012-11-26 Tags: bash, shell, scripting, sh I have a script that automates a …

    Read more

  • Most votes on shell questions 8

    May 01, 2021 in FAQ

    Most votes on shell questions 8. #71 OS X: equivalent of Linux's wget #72 Why is whitespace sometimes needed around metacharacters? #73 How to run a shell script on a Unix console or Mac terminal? #74 How to obtain the absolute path of a file via Shell (BASH/ZSH/SH)? #75 OS X Terminal Colors #76 What's a concise way to check that environment variables are set in a Unix shell script? #77 Process all arguments except the first one (in a bash script) #78 How to assign name for a screen? #79 Multi-line string with extra space (preserved indentation) #80 How to join multiple lines of file names into one with custom delimiter?

    Read all the top votes questions and answers in a single page. #71: OS X: equivalent of Linux's wget (Score: 548) Created: 2010-12-31 Tags: macos, shell, unix, http-get How can I do an HTTP GET from a Un*x shell script on a stock OS X system? …

    Read more

  • Most votes on shell questions 7

    May 01, 2021 in FAQ

    Most votes on shell questions 7. #61 How can I copy the output of a command directly into my clipboard? #62 Find and replace in file and overwrite file doesn't work, it empties the file #63 Using wget to recursively fetch a directory with arbitrary files in it #64 Command not found error in Bash variable assignment #65 How to read a file into a variable in shell? #66 Unix shell script find out which directory the script file resides? #67 How can I clear previous output in Terminal in Mac OS X? #68 Colorized grep – viewing the entire file with highlighted matches #69 How to use ADB Shell when Multiple Devices are connected? Fails with "error: more than one device and emulator" #70 How to append output to the end of a text file

    Read all the top votes questions and answers in a single page. #61: How can I copy the output of a command directly into my clipboard? (Score: 628) Created: 2011-02-27 Tags: linux, shell, unix, terminal, clipboard How can I pipe the output of a …

    Read more

  • Most votes on shell questions 6

    May 01, 2021 in FAQ

    Most votes on shell questions 6. #51 How can I reverse the order of lines in a file? #52 Bash tool to get nth line from a file #53 How do I test if a variable is a number in Bash? #54 How to determine the current shell I'm working on #55 Check if pull needed in Git #56 Automatic exit from Bash shell script on error #57 Difference between single and double quotes in Bash #58 How do I know the script file name in a Bash script? #59 How can I compare numbers in Bash? #60 sudo echo "something" >> /etc/privilegedFile doesn't work

    Read all the top votes questions and answers in a single page. #51: How can I reverse the order of lines in a file? (Score: 703) Created: 2009-04-12 Last updated: 2012-12-04 Tags: shell, unix, command-line I’d like to reverse the order of lines …

    Read more

  • Most votes on shell questions 5

    May 01, 2021 in FAQ

    Most votes on shell questions 5. #41 Count number of lines in a git repository #42 What does set -e mean in a bash script? #43 Use grep –exclude/–include syntax to not grep through certain files #44 Add line break to 'git commit -m' from the command line #45 How do I pause my shell script for a second before continuing? #46 Extract substring in Bash #47 Why can't I change directories using "cd" in a script? #48 How to 'grep' a continuous stream? #49 Redirect stderr and stdout in Bash #50 When do we need curly braces around shell variables?

    Read all the top votes questions and answers in a single page. #41: Count number of lines in a git repository (Score: 847) Created: 2011-01-27 Last updated: 2018-04-01 Tags: bash, git, shell, line-count How would I count the total number of lines …

    Read more

  • Most votes on shell questions 4

    May 01, 2021 in FAQ

    Most votes on shell questions 4. #31 How to echo shell commands as they are executed #32 Replace one substring for another string in shell script #33 How do I put an already-running process under nohup? #34 Should I put #! (shebang) in Python scripts, and what form should it take? #35 Shell command to sum integers, one per line? #36 Shell command to tar directory excluding certain files/folders #37 Get current directory name (without full path) in a Bash script #38 How to call one shell script from another shell script? #39 Assigning default values to shell variables with a single command in bash #40 Given two directory trees, how can I find out which files differ by content?

    Read all the top votes questions and answers in a single page. #31: How to echo shell commands as they are executed (Score: 1038) Created: 2010-05-18 Last updated: 2019-04-26 Tags: bash, shell, sh, posix, trace In a shell script, how do I echo all …

    Read more

  • Most votes on shell questions 3

    May 01, 2021 in FAQ

    Most votes on shell questions 3. #21 How to convert a string to lower case in Bash? #22 How to specify the private SSH-key to use when executing shell command on Git? #23 How to use SSH to run a local shell script on a remote machine? #24 YYYY-MM-DD format date in shell script #25 How to call shell commands from Ruby #26 Why do people write #!/usr/bin/env python on the first line of a Python script? #27 How can I declare and use Boolean variables in a shell script? #28 How to reload .bash_profile from the command line? #29 Defining a variable with or without export #30 Running shell command and capturing the output

    Read all the top votes questions and answers in a single page. #21: How to convert a string to lower case in Bash? (Score: 1420) Created: 2010-02-15 Last updated: 2020-03-29 Tags: string, bash, shell, lowercase Is there a way in [tag:Bash] to convert …

    Read more