This file contains 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
from fractions import gcd | |
from itertools import count | |
def naive_get_barber_number(N): | |
customer = 1; | |
for T in count(1): | |
for barber in range(B): | |
if T % M[barber] == 0: | |
# at this point N = 0 and customer > 0.. |
This file contains 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
from plugin import BasePlugin | |
class Plugin(BasePlugin): | |
def init(self): | |
self.api.add_event_handler('conversation_msg', self.on_msg) | |
self.api.add_event_handler('private_msg', self.on_msg) | |
def on_msg(self, msg, tab): | |
tab.command_say('[Automatic response] I stopped reading Facebook chat. Do try in some other way!') |
This file contains 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
TAS=( NAME1 NAME2 ) | |
REST=rest | |
for ta in ${TAS[@]}; do | |
mkdir -p $ta; | |
done | |
mkdir -p $REST | |
for f in pdfs/*.pdf | |
do |
This file contains 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
--- a/g10/keyedit.c | |
+++ b/g10/keyedit.c | |
@@ -1877,7 +1877,7 @@ static struct | |
{ "nrsign", cmdNOP, 0, | |
N_("sign selected user IDs with a non-revocable signature")}, | |
{ "debug", cmdDEBUG, 0, NULL}, | |
- { "adduid", cmdADDUID, KEYEDIT_NOT_SK | KEYEDIT_NEED_SK, N_("add a user ID")}, | |
+ { "adduid", cmdADDUID, KEYEDIT_NOT_SK, N_("add a user ID")}, | |
{ "addphoto", cmdADDPHOTO, KEYEDIT_NOT_SK | KEYEDIT_NEED_SK, | |
N_("add a photo ID")}, |
This file contains 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/env python | |
from bs4 import BeautifulSoup | |
import requests | |
URL = "http://www.3fm.nl/welkliedjewasdat" | |
r = requests.get(URL) | |
r.encoding = 'utf-8' | |
soup = BeautifulSoup(r.text, 'lxml') |
OlderNewer