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 8305

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.

2
votes
T-SQL (2008+): 344 Brute force a CTE to find primes, window function to count n, followed by a join to find the twin. Works in a second for outputs < 1,000, just under a minute for outputs < 10,000. …
answered Jun 17 '14 by comfortablydrei
0
votes
VBScript 435 Does not support non-ASCII chars. I was pretty far along with my code so I thought I'd post it for reference. I don't think anyone else used this approach. i=inputbox(i) a=SPLIT("1 abc …
answered Jul 3 '14 by comfortablydrei
1
vote
T-SQL (2012) 189 171 Edit: removed ORDER BY because rules allow any output order. Takes input from a CHAR variable, @a, and uses a recursive CTE to create a row for each character in the string and …
answered Jun 25 '14 by comfortablydrei
4
votes
VBScript 181 109 Updated to use a completely different algorithm. Beats JavaScript! Pretty: dim b(99):i=ucase(inputbox(k)) for y=65to 90 c=chr(y) a=len(replace(i,c,k)) b(a)=c+b(a) next …
answered Jul 1 '14 by comfortablydrei
5
votes
Code compression using SQL SQL is wordy,scores high, and as much as we love'em, SELECT FROM WHERE cost 23 bytes with every use. You can compress these and other repeated words or entire code snippets …
answered Jul 2 '14 by comfortablydrei
4
votes
Here's a funny one. This will convert the values in a column into a single tuple. EDIT: Thank you for the comments. It seems like the shortest way of rolling up without the XML tags is: SELECT (SELE …
answered Jul 1 '14 by comfortablydrei
-1
votes
T-SQL 134 This challenge is asking to return the Cartesian power of {(0),(1)}. This snippet builds the code which would execute the Cartesian product of {(0),(1)} n times. DECLARE @ int=4,@s varchar …
answered Jul 3 '14 by comfortablydrei
1
vote
Shorter IF Then: save 10 bytes If you terminate an IF/THEN clause with a carriage return, you don't need to use an END IF. Example: For x=1 to 1 IF x=1 THEN MSGBOX "No Error" Next
answered Jul 1 '14 by comfortablydrei
3
votes
T-SQL 178 Basically, this is my VBScript solution but implemented in SQL. This is XML output abuse to concatenate a column. In practical use, it can be joined to an outer table to emulate GROUP_CONC …
answered Jul 1 '14 by comfortablydrei
2
votes
VBScript 98 80 75 msgbox split(" one two three four five six seven eight nine")(inputbox(""))
answered Jun 21 '14 by comfortablydrei
1
vote
TSQL, 148 Edit: down to 148 with manatwork's suggestion and tweak to ORDER BY. Readable: WITH t AS( SELECT 1n, CAST(1 AS VARCHAR(MAX)) o UNION ALL SELECT n+1,o+CHAR(n+49) FROM t WH …
answered Jun 6 '13 by comfortablydrei
0
votes
VBScript 101 95 74 Edit: Looks like a lot of answers accept bool directions. For char directions, replace -d with +(d="r") for a score increase of 6. function f(a,p,d):for x=1to a:f=f+mid("/|\",3-d+ …
answered Jul 9 '14 by comfortablydrei
2
votes
T-SQL(2012): 794 689 580 Inspired by @Jonathan-Van-Matre 's T-SQL answer in combination with @Lego-Stormtroopr's algorithm. I wanted to do this because I enjoyed the 99 Bottles of Beer challenge so m …
answered Jun 16 '14 by comfortablydrei