"class BankAccount(object):" => "python" "def __init__(self, initial_balance=0):" => "python" "self.balance = initial_balance" => "python" "def deposit(self, amount):" => "python" "self.balance += amount" => "python" "def withdraw(self, amount):" => "python" "self.balance -= amount" => "python" "def overdrawn(self):" => "python" "return self.balance < 0" => "python" "my_account = BankAccount(15)" => "python" "my_account.withdraw(5)" => "python" "print my_account.balance" => "python" "// Logic: Checks every 10 seconds and clears full cache when" => "javax" "// anything changed in the DB. So it's as good as traffic-free" => "javax" "// when the DB is not changing." => "javax" "!747" => "javax" "!named thread" => "javax" "m {" => "javax" "static int updateInterval = 10000;" => "javax" "static long lastVersionCount;" => "javax" "static new Map titles;" => "javax" "p {" => "javax" "startBot(\"Version Count Bot\", \"#1001745\");" => "javax" "makeAndroid3(\"Snippet Title Bot.\");" => "javax" "updateLoop();" => "javax" "}" => "javax" "static void update() {" => "javax" "new Matches m;" => "javax" "if (match3(\"version count: *\", sendToLocalBot_cached(\"Version Count Bot\", \... => "javax" "long count = parseLong(m.get(0));" => "javax" "if (count != lastVersionCount) {" => "javax" "lastVersionCount = count;" => "javax" "clear();" => "javax" "}" => "javax" "}" => "javax" "}" => "javax" "static synchronized S answer(S s) {" => "javax" "new Matches m;" => "javax" "if (match3(\"what is the title of snippet *\", s, m)) {" => "javax" "S snippetID = formatSnippetID(m.unq(0));" => "javax" "S title = titles.get(snippetID);" => "javax" "if (title == null) {" => "javax" "title = getSnippetTitle(snippetID);" => "javax" "if (title == null) ret \"null\";" => "javax" "titles.put(snippetID, title);" => "javax" "}" => "javax" "ret format(\"The title of snippet * is *.\", snippetID, title);" => "javax" "}" => "javax" "if (match3(\"clear snippet title cache\", s, m)) {" => "javax" "clear();" => "javax" "ret \"OK.\";" => "javax" "}" => "javax" "if (match3(\"get snippet title cache size\", s, m)) {" => "javax" "ret \"Cache entries: \" + titles.size();" => "javax" "}" => "javax" "ret null;" => "javax" "}" => "javax" "static synchronized void clear() {" => "javax" "titles.clear();" => "javax" "}" => "javax" "}" => "javax"