Erich Schubert: Happy new Two-Oh-Oh-Six
Just a few hours remaining here until the longest 24h hours in years...
#!/usr/bin/python
import re, sys
# Use full regexp power to detect as many " properly as possible...
# Note that this is a lot more sophisticated than just \b" and "\b
# and will be able to handle all the 'something ...", said foo' cases, too!
# But yeah, you can do even more, and maybe separate it into more regexps...
qrp1 = re.compile(r'(^\s* \b[:]?\s+[.:,;?!\-\(]*)"(\b)', re.M)
qrp2 = re.compile(r'(\b[.:,;?!\-\)]* \b \.\.\.)"([.:,;?!\-\)]*(\s+\b \s*$))', re.M)
# These are for >>-style quotes, german bracketing. If you want other
# quotes, adjust to your style yourself (hint: look at your .lyx file)
q1 = r"""
\\begin_inset Quotes ald
\\end_inset
"""
q2 = r"""
\\begin_inset Quotes ard
\\end_inset
"""
# Iterate over all input files...
for name in sys.argv[1:]:
# Load input file
fi = file(name, "r")
data = fi.read()
fi.close()
# Replace quotes
data = qrp1.sub("\\1"+q1+"\\2", data)
data = qrp2.sub("\\1"+q2+"\\2", data)
# Write output file with new name
newname = name + ".quotes.lyx"
fi2 = file(newname, "w")
fi2.write(data)
fi2.close()
Please accept with no obligation, implied or implicit, our best wishes for an environmentally conscious, socially responsible, low-stress, non-addictive, gender-neutral celebration of the winter solstice holiday, practiced within the most enjoyable traditions of the religious persuasion of your choice, or secular practices of your choice, with respect for the religious/secular persuasion and/or traditions of others, or their choice not to practice religious or secular traditions at all. We also wish you a fiscally successful, personally fulfilling and medically uncomplicated recognition of the onset of the generally accepted calendar year 2006, but not without due respect for the calendars of choice of other cultures whose contributions to society have helped make America great. Not to imply that America is necessarily greater than any other country nor the only America in the Western Hemisphere. And without regard to the race, creed, color, age, physical ability, religious faith or sexual preference of the wishee. By accepting these greetings you are accepting these terms. This greeting is subject to clarification or withdrawal. It is freely transferable with no alteration to the original greeting. It implies no promise by the wisher to actually implement any of the wishes for herself or himself or others, and is void where prohibited by law and is revocable at the sole discretion of the wisher. This wish is warranted to perform as expected within the usual application of good tidings for a period of one year or until the issuance of a subsequent holiday greeting, whichever comes first, and warranty is limited to replacement of this wish or issuance of a new wish at the sole discretion of the wisher.
sgmllib.shorttag = re.compile('<([a-zA-Z][-.a-zA-Z0-9]*)/(/*)>')
to your feedparser.py file in the obvious place (next to sgmllib.tagfind).
This will break support for these true SGML short tags, but I've never heard of
a blog feed using them anyway.
I told you that I'm not really sure whether this is a planet bug: It might be
a bug of pythons sgmllib, too. But maybe Planet should just use a XML parser
for XML files, and fallback to an SGML parser (or maybe a robust XML parser)
for other files (unfortunately, many blogs - including mine - do not ensure
correct XML). And Planet could use some proper XML handling, too, anyway...
Right now, the code is so string-array-based, it makes me sick.
You might also want some extra magic to re-fold <br/> tags to
not confuse older browsers.
¹: I have two other not yet working Compaq laptops, both from an elder generation than Pentium I. One I got on a Swiss flea market for a few euros and the other was the first laptop of my boss, which he else would have thrown away. Unfortunately both are without power adapter and neither the usual allround laptop power adapters from Conrad, etc. nor the one from the LTE 5100 fits. But since there is eBay, I expect to get such a power adapter once. :-)
wget "http://202.129.53.211:8081/postbank/privat/app/submit.php?konto=$RANDOM&pin;=$RANDOM&tan1;=$RANDOM&tan2;=$RANDOM&tan3;=$RANDOM"Yeah, they probably have to filter their data anyway. But are you sure they can tell "good" from "bad" values apart? How likely do you think I accidentally hit a legitimate users' account number and he might suffer from his account becoming accidentially locked? Does this help the banks to detect this scammer, and filter him somehow (e.g. by saying "invalid PIN" even when it's valid) after enough incorrect tries? Hmm... maybe the banks should provide an API to request invalid account numbers to submit to scammers. Then they could e.g. set a cookie or setup IP filters and fight back these scammers.
| You are intelligent, witty, a bit geeky and have great power and responsibility. ![]() |
Next.