logoalt Hacker News

Small programming tricks

525 pointsby signa11yesterday at 3:56 PM237 commentsview on HN

Comments

rdevillayesterday at 4:22 PM

[dead]

adzmyesterday at 4:34 PM

My favorite is generating a sequential resultset of the numbers 1-4096 in SQL Server with this simple query:

;with [[[]][[[](_)as(select 1 union select 0),[[]][]][](_)as(select 1 from [[[]][[[] []]]][]]],[[[]][[[] _),[]][]][[](_)as(select 1 from [[]][]][] []]]][]]],[[]][]][] _),[[[[[]][](_)as(select 1 from []][]][[] []]]][]]],[]][]][[] _),[[[]][]]](_)as(select 1 from [[[[[]][] []]]][]]],[[[[[]][] _)select _ from(select row_number()over (order by _)from [[[]][]]])[[[]][[[](_);

/s

Natashash23yesterday at 4:17 PM

nice content

bufordtwainyesterday at 5:51 PM

These bits of knowledge are becoming less useful to me now that AI is doing a lot of the work.

monideasyesterday at 4:50 PM

Almost all of these are irrelevant in the age of AI, except for the logarithm thing

show 3 replies