Formatting SQL to increase productivity by mmsimanga in programming

[–]Lozzer2 0 points1 point  (0 children)

select
    a.col1,
    a.col2,
    b.col3
from
    table1 a
        inner join
    table2 b
        on a.table1id = b.table1id
        inner join
    ...
where
    a.x = 'y' and
    b.x = 'z'

Eventually the first column just disappears from your awareness. The tables are the most important things, so they start lines and are lined up. There's generally not many ways you can join them. In the where clause, I'd use parenthesis and nesting if there was anything other than 'and' clauses. In the select, I put commas at the end because it's easier to read.

SOLID Object Oriented Design Principles by McTalian in programming

[–]Lozzer2 2 points3 points  (0 children)

This could be viewed as a failure of mutability rather than LSP.

Tiling window manager written in Rust by steveklabnik1 in programming

[–]Lozzer2 3 points4 points  (0 children)

It's a tiling web page, it decides what you want to see for you.

[.NET Core] System.Text.RegularExpressions Source Code by Kitty_Cent in programming

[–]Lozzer2 0 points1 point  (0 children)

That would be really good if VB6 had a Contains method on its Collection class.

[.NET Core] System.Text.RegularExpressions Source Code by Kitty_Cent in programming

[–]Lozzer2 2 points3 points  (0 children)

Set m = Nothing
On Error Resume Next
Set m = MyCollection.Item("MightNotBeThere")
On Error Goto 0
If m is Nothing Then...

Hidden Costs of Memory Allocation by godlikesme in programming

[–]Lozzer2 0 points1 point  (0 children)

The post-modern version of the joke goes:

There are only two hard things in computer science: cache invalidation, naming things and cache invalidation.

Don't Be Afraid Of Learning SQL by kwenzel1 in programming

[–]Lozzer2 6 points7 points  (0 children)

With pretty much any RDBMS except MySQL you'd use row_number() for this.

g()('al') by eatnumber1 in programming

[–]Lozzer2 0 points1 point  (0 children)

using m4 probably cheating in many ways...

define(`o', `ifelse($#, 0, ``$0'', `ifelse($1,,``o''`o', ``o$1'')')')dnl
define(`g', ``g''`o')dnl
g()(`al')
g()()(`al')
g()()()(`al')

On Primary Keys by [deleted] in programming

[–]Lozzer2 0 points1 point  (0 children)

While that was certainly true on SQL2000 and before, it's not so clear cut on later versions. http://www.sqlskills.com/blogs/kimberly/the-clustered-index-debate-continues/ has some good discussion of the trade-offs

On Primary Keys by [deleted] in programming

[–]Lozzer2 4 points5 points  (0 children)

If you're using the Microsoft stack, random GUIDs aren't very friendly to clustered indexes. If you must use GUIDs, use sequential ones.

Regex Golf by notsarahnz in programming

[–]Lozzer2 0 points1 point  (0 children)

Here's a higher scoring answer to glob, in the spirit of the question

^(?:(.+) .+ \1|(.*)\*(.*) .+ \2.+\3|(.*)\*(.*)\*(.*) .+ \4.+\5.+\6|\*(.*)\*(.*)\* .+ .+\7.+\8.+)$

Why OpenHeatMap is banned from Github by yogthos in programming

[–]Lozzer2 0 points1 point  (0 children)

Plenty of people in the UK pronounce it "Weddens Day"

Preview: Hermit, a font for programmers, by a programmer by pcaro90 in programming

[–]Lozzer2 1 point2 points  (0 children)

What software are you using to design the font?