一键导入
catch-expected-errors
For iteration with errors: catch exceptions during exploration, skip invalid cases, continue to next attempt.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
For iteration with errors: catch exceptions during exploration, skip invalid cases, continue to next attempt.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Conducts iterative deep research on any topic using web search, progressive exploration, and structured synthesis. Use when asked for comprehensive research, deep investigation, thorough analysis, or multi-source exploration of any topic. Triggers: research, investigate, deep dive, comprehensive analysis, explore thoroughly, find everything about.
For cross-cutting concerns: add behavior without modifying functions, caching, timing, logging, validation wrappers.
For performance work: measure before changing, profile to find bottlenecks, compare before and after.
For symbolic computation: ASTs, mathematical expressions, code that manipulates code structure, expression transformations.
For ordered processing: A* search, Dijkstra, event simulation, task scheduling. Efficient min/max extraction with heap-based queue.
For dynamic programming: overlapping subproblems, recursive solutions with repeated computations, memoization to avoid redundant work.
| name | catch-expected-errors |
| description | For iteration with errors: catch exceptions during exploration, skip invalid cases, continue to next attempt. |
Wrap potentially failing code in try/except, continue on expected errors.
for candidate in candidates:
try:
result = process(candidate)
if is_valid(result):
return result
except (ValueError, ArithmeticError):
continue # Skip this candidate
return None # None worked
# Cryptarithmetic solver (Cryptarithmetic.ipynb)
def faster_solve(formula):
"""Fill in digits to solve formula."""
python_lambda, letters = translate_formula(formula)
formula_fn = eval(python_lambda)
for digits in permutations((1,2,3,4,5,6,7,8,9,0), len(letters)):
try:
if formula_fn(*digits) is True:
yield format_solution(digits, letters, formula)
except ArithmeticError:
pass # Division by zero - skip this combination
# Simple validator (Cryptarithmetic.ipynb)
def valid(pformula):
"""Valid iff no leading zero and evaluates to True."""
try:
return (not leading_zero(pformula)) and (eval(pformula) is True)
except ArithmeticError:
return False
# Type conversion cascade (lispy.py)
def atom(token):
"""Convert token to appropriate type."""
if token == '#t': return True
if token == '#f': return False
if token[0] == '"': return token[1:-1]
try:
return int(token)
except ValueError:
try:
return float(token)
except ValueError:
try:
return complex(token.replace('i', 'j', 1))
except ValueError:
return Sym(token)
# Version compatibility (beal.py)
try:
from math import gcd
except ImportError:
from fractions import gcd