lambda

lambda wrote

Reply to comment by emma in by emma

So far, the exception rule proposed (which I tested out and seems to work) is the following:

raddle.me#@#.subscribe-button
1

lambda wrote

Not a Gentoo user, but I did meet him IRL. He's not a fan of Gentoo since they call it "Linux" and not "GNU/Linux".

I found him to be extremely principled and a rather interesting person. He's a bit of an oddball, but quite intelligent and not just a computer nerd.

3

lambda wrote (edited )

Reply to comment by emma in by emma

That could be useful. I'd imagine it's just needed to determine how to write a proper whitelist rule.

Edit: I've submitted a link to the source, though again, awaiting moderator approval.

1

lambda wrote

The gist of service locators being anti-patterns is that it's essentially an obfuscated form of global variables. Instead of having your class directly look up its dependencies, your class should just accept said dependencies in its constructor. Essentially, you can put off service location until the "end of the world" (yes, I know that's a functional programming term, but it's still the same idea here). In the case of a DI container, the container's service registry is your end of the world, and you don't need to explicitly wire anything together.

To really get a better feel for DI and inversion of control, I'd recommend practicing test-driven development. If you can't write good unit tests without having to set up a ton of support code or services, then everything has gotten tied together too much.

Also, the factory pattern isn't as useful when using dependency injection. The DI container is essentially a generic object factory for everything so you don't have to.

2

lambda wrote

Reply to comment by emma in by emma

Oh wow, you'd think a forum dedicated to helping people maintain their privacy would, you know, respect your privacy!

I've submitted it to their forum, though it's awaiting moderation.

1

lambda wrote

From what I've seen in the past, DjVu files are all scanned books and similar things. They're essentially the lowest fidelity you'll get unless you OCR the text.

2