Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 14643

Code-golf is a competition to solve a particular problem in the fewest bytes of source code. If you want to score by characters instead of bytes, please state this explicitly in the challenge. If source code length is not the primary scoring criterion, consider using another tag instead.

0
votes
Bash (79 characters) seq 0 9|awk 'BEGIN{srand()}{print rand()"\t"$0}'|sort -nk1|cut -f2-|tr -d '\n' Note that the lottery company should not run this more than once per second! Edit: Oh rats, this …
answered Jan 18 '14 by joeytwiddle
7
votes
GNU core utils - 25 characters (29 dropping symbols) fold -1|sort -f|tr -d \\n Example (from GNU bash 3): $ echo "Johnny walked the dog to the park."|fold -1|sort -f|tr -d \\n .aaddeeeghhhJk …
answered Jan 22 '14 by joeytwiddle
2
votes
GNU coreutils (44) read N seq -100 100 | grep $N | tr '\n' ' ' echo where tr is used to convert newlines to spaces, and echo provides one final newline. $ bash ./script 9 -99 -98 -97 -96 -95 -94 - …
answered Mar 5 '14 by joeytwiddle
1
vote
grep and awk, 68 56 bytes The script: echo `grep -o '\w*'|awk '!x[tolower(substr($0,1,1))]++'` Explanation: grep -o matches the legal words, printing each on its own line. awk takes the first le …
answered Apr 10 '16 by joeytwiddle
5
votes
!/bin/sh I liked qwr's solution so much, I shamelessly made a port for POSIX shell. Please don't save it into a filename containing spaces. : '#';cat $0 #c a t $ 0 Start removing at character …
answered Mar 8 '14 by joeytwiddle
1
vote
sed (39 chars) Just a couple of regular expressions: sed 's+\<\(.\)[A-Za-z]*+\1+g;s+ *+ +g'
answered May 25 '15 by joeytwiddle
1
vote
bash and GNU coreutils, 68 bytes We assume that the list is newline-separated and passed on standard input. (paste - <(seq 0 5 9999)|tee x|grep 0$;grep 5$<x)|cut -f1|grep -v ^$ Unfortunately this …
answered Nov 21 '15 by joeytwiddle
4
votes
Haskell, 71 44 29 bytes p(a:b:r)=[a|a/=b]++p r p _=[] Extreme golfing by nimi.
answered Mar 5 '16 by joeytwiddle
2
votes
Function If you need a function in as few bytes as possible, and any function will do (perhaps you just want to access some of the goodies from Function.prototype), then here are some options (starti …
answered May 19 '16 by joeytwiddle
2
votes
Haskell, 133 116 105 100 98 91 bytes f r=[["abcdefgh"!!x,"12345678"!!y]|x<-l,y<-l,odd(x+y)||r<"l",even(x+y)||r!!0/='d'] l=[0..7] This is my first attempt at golfing Haskell. With some help from …
answered Feb 17 '16 by joeytwiddle
11
votes
GNU core utils - 29 22 20 chars (53 with formatting) Wumpus's improvement (20 chars): fold -1|sort|uniq -c Firefly's improvement (22 chars): grep -o .|sort|uniq -c joeytwiddle's original (29 ch …
answered Jan 22 '14 by joeytwiddle
2
votes
bash, 52 bytes f=")-*-*-*^_^*-*-*-(" echo "$f | Welcome User! | $f"
answered Jun 21 '17 by joeytwiddle
1
vote
GNU Core Utils, 39 33 bytes nl|sort -nk2|nl|sort -nk2|cut -f1 Produces 1-based output. Add -v0 after the second nl to get 0-based output. (+4 bytes) Commands we are using: nl adds line numbers …
answered Jul 21 '16 by joeytwiddle
0
votes
Haskell, 61 bytes import Data.Char f s=sum$g$ord<$>s g(a:b:r)=b-a:g(b:r) g _=[]
answered Sep 26 '16 by joeytwiddle