Skip to main content
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
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
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 answers only not deleted user 12390

Code that loads code at runtime for execution

3 votes

Filter, Validate, and Generate Redbean models programmatically

This expression is needlessly too complex: return strtolower(trim(preg_replace("/(_)\\1+/", "$1",preg_replace('/([^a-zA-Z_])/','_',$key)),'_')); It replaces non-alphabetic and non-underscore …
janos's user avatar
  • 112k
2 votes
Accepted

I command thee: do SOMETHING

I recommend this implementation, see the explanation after: class CommandHandle { private final Predicate<String> matchesSyntax; private final Consumer<ChatMessage> executor; private fin …
janos's user avatar
  • 112k
8 votes
Accepted

Function autoloading in bash

Bug because of subshell You are losing the value of ret_val in a subshell here: ... || (echo "ERROR: Missing required ${each_func}"; ret_val=1) Variable assignments in a subshell are local to th …
janos's user avatar
  • 112k
2 votes

Implementing Multi-File Programs in Vitsy

Yeah this looks like golfed code :) It's never a pleasure to review spaghetti code. So I won't give a comprehensive review, with luck somebody else will, or we can each improve some bits and pieces. …
janos's user avatar
  • 112k
19 votes
Accepted

Python exception handler to recommend package

An ImportError instance doesn't have a replace method. You can use e.name instead of messy string replacements. Instead of '%s' % x, it's recommended to use '{}'.format(x). The example output i …
janos's user avatar
  • 112k