-
Python - Filtering Dicts
I’ve been needing to do some Python for work lately. Nothing big or fancy, but it does involve working with lists and dicts… Coming from Elixir and Ruby I can’t help but wonder if I’m missing some greater point about how Python does this stuff. Like, why does filtering a dict not return a dict but has to be cast into one? And why are items treated like tuples in the comprehension/lambda? I know the underlying form is most likely a tuple in both Python, Elixir and Ruby, but I don’t really care to be dealing directly with it.
-
XSS From Mixed Rendering
Most popular website frameworks — be they frontend or backend — have ways to safely handle user input in order to prevent injection attacks like SQLi or XSS. However, they (obviously) don’t have ways to handle it safely for other frameworks.
-
PCRE Branch Reset Operator
In Perl Compatible Regular Expressions (PCRE) and other dialects you sometimes end up with a flurry of capture groups, and if you want to use alternatives/OR/branching then you’ll end up with empty matches because of the enumeration of matches will match the capture groups regardless of branching.