This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error: uncaptured python exception, closing channel <bot.jenny connected at 0x7fcae67f9128> (<type 'exceptions.IndexError'>:deque index out of range [/usr/lib64/python2.7/asyncore.py|write|87] [/usr/lib64/python2.7/asyncore.py|handle_write_event|454] [/usr/lib64/python2.7/asynchat.py|handle_write|174] [/usr/lib64/python2.7/asynchat.py|initiate_send|244]) | |
Closed! | |
Warning: Disconnected. Reconnecting in 20 seconds... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def leave (self, phenny, input): | |
if not self.game_on or not self.deck: | |
return | |
if input.nick not in self.players: | |
return | |
if len(self.playerOrder) < 3: | |
phenny.reply("You can't leave a 2 player game.") | |
return | |
if input.nick == self.playerOrder[self.currentPlayer]: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def leave (self, phenny, input): | |
phenny.say("list before: " + str(self.playerOrder)) | |
if not self.game_on or not self.deck: | |
return | |
if input.nick not in self.players: | |
return | |
if len(self.playerOrder) < 3: | |
phenny.reply("You can't leave a 2 player game.") | |
return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
sophia_module_add('web.dict', '1.0', \&init_web_dict, \&deinit_web_dict); | |
sub init_web_dict { | |
sophia_command_add('web.dict', \&web_dict, 'Provides definitions of a given word.', ''); | |
sophia_global_command_add('dict', \&web_dict, 'Provides definitions of a given word.', ''); | |
return 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ echo '{"query":"cat","sourceLanguage":"en","targetLanguage":"en","primaries":[{"type":"headword","terms":[{"type":"text","text":"cat","language":"en","labels":[{"text":"Verb","title":"Part-of-speech"}]},{"type":"phonetic","text":"/kat/","language":"und"},{"type":"sound","text":"http://www.gstatic.com/dictionary/static/sounds/de/0/cat.mp3","language":"und"}],"entries":[{"type":"related","terms":[{"type":"text","text":"cats","language":"und","labels":[{"text":"3rd person singular present"}]},{"type":"text","text":"catted","language":"und","labels":[{"text":"past participle"}]},{"type":"text","text":"catting","language":"und","labels":[{"text":"present participle"}]},{"type":"text","text":"catted","language":"und","labels":[{"text":"past tense"}]}]},{"type":"meaning","terms":[{"type":"text","text":"Raise (an anchor) from the surface of the water to the cathead","language":"en"}]}]},{"type":"headword","terms":[{"type":"text","text":"cat","language":"en","labels":[{"text":"Noun","title":"Part-of-speech"}]},{"typ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use warnings; | |
use JSON; | |
sophia_module_add('web.dict', '1.0', \&init_web_dict, \&deinit_web_dict); | |
sub init_web_dict { | |
sophia_command_add('web.dict', \&web_dict, 'Provides definitions of a given word.', ''); | |
sophia_global_command_add('dict', \&web_dict, 'Provides definitions of a given word.', ''); | |
return 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import curses | |
import curses.textpad | |
import time | |
stdscr = curses.initscr() | |
#curses.noecho() | |
#curses.echo() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
python -c ' | |
import sys, unicodedata | |
s = "u" | |
for i in xrange(1, 3000): | |
if unicodedata.category(unichr(i)) == "Mn": | |
s += unichr(i) | |
if len(s) > 100: break | |
sys.stdout.write(s.encode("utf-8")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import feedparser | |
loc = raw_input("Please input county code: ") | |
feed_url = 'http://alerts.weather.gov/cap/wwaatmget.php?x=%s' % (loc) | |
feed = feedparser.parse(feed_url) | |
for x in feed.entries: | |
a = x["title"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# vim: set fileencoding=UTF-8 : | |
""" | |
This script checks to see if a given phrase is profane according to Google's | |
Profane API. This script returns a 'True' if it's profane, a 'False' if it's | |
not profane and a 0 if there is an error. | |
Copyright 2011 Michael Yanovich | |
Licensed under the GNU General Public License version 3. |
OlderNewer