Hi all,
Please give me an idea about Multiprocessing and Multithreading.
Thanks & Regards,
Chandru
CAUTION - Disclaimer *
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended rec
Hi,
I am trying to split up the re pattern for Apache log file format and seem
to be having some trouble in getting Python to understand multi-line
pattern:
#!/usr/bin/python
import re
#this is a single line
string = '192.168.122.3 - - [29/Sep/2013:03:52:33 -0700] "GET / HTTP/1.0"
302 276 "-" "
Chris Angelico wrote:
>On Tue, Oct 8, 2013 at 5:48 PM, wrote:
>> And if we were actually trying then that filename should just be
>"/w". Would get rid of another 19 chars.
>
>I'm working this on the assumption that the dictionary file already
>exists (that's where it is on my Debian Linux system
On Tue, Oct 8, 2013 at 6:02 PM, Steve Simmons wrote:
> Typical MUD Master - making up rules as you go along :-)
Totally. Under the auspices of Rule Zero:
http://tvtropes.org/pmwiki/pmwiki.php/Main/RuleOfFun
:)
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
random...@fastmail.us writes:
> The entire point of tail call optimization requires not keeping the
> intervening stack frames around, in _any_ form, so as to allow
> arbitrarily deep recursion without ever having the possibility of a
> stack overflow. An implementation which reduced but did not
>
On 10/8/2013 1:34 AM, Chandru Rajendran wrote:
Please give me an idea about Multiprocessing and Multithreading.
Please give us some idea of what you know and what you actually want to
know.
CAUTION - Disclaimer *
This e-mail contains PRIVILEGED AND CONFIDEN
On 08/10/2013 06:34, Chandru Rajendran wrote:
Hi all,
Please give me an idea about Multiprocessing and Multithreading.
Thanks & Regards,
Chandru
I'll assume that you're a newbie so I'll keep it simple.
Multiprocessing is about more than one process and multithreading is
about more than on
Steven D'Aprano writes:
> Far more useful would be a high-level description of Scheme's
> programming model. If names can be rebound on the fly, how does
> Scheme even tell whether something is a recursive call or not?
>
> def foo(arg):
> do stuff here
> foo(arg-1) # how does Scheme know
On 08/10/2013 07:48, sprucebond...@gmail.com wrote:
On Monday, October 7, 2013 8:45:39 PM UTC-10, spruce...@gmail.com wrote:
On Monday, October 7, 2013 8:17:21 PM UTC-10, Chris Angelico wrote:
Who's up for some fun? Implement an XKCD-936-compliant password
generator in Python 3, in less code t
On Tue, 08 Oct 2013 10:46:50 +0530, Ravi Sahni wrote:
> On Tue, Oct 8, 2013 at 8:47 AM, rusi wrote:
>> I can only say how ironic it sounds to someone who is familiar with the
>> history of our field: Turing was not a computer scientist (the term did
>> not exist then) but a mathematician. And hi
esmaspäev, 7. oktoober 2013 18:52.21 UTC+3 kirjutas Piet van Oostrum:
> markot...@gmail.com writes:
>
>
>
> > This is the code i came up with:
>
> > from teisendaja import *
>
> > from operator import *
>
> > import binascii
>
> >
>
> > teisendus = teisendus()
>
> > kood = input("Kood: ")
esmaspäev, 7. oktoober 2013 17:16.29 UTC+3 kirjutas Mark Lawrence:
> On 07/10/2013 14:54, markot...@gmail.com wrote:
>
> > I forgot to tell. The teisendaja module that i have imported, is a number
> > converter that allow to convert numbers from one base to another. i mostly
> > use it for HEX t
I cant just subclassing doesent work. It seem the init method of the source
class also calls out another class. And the problem is, i can subclass the
other class to with the required function but the end result is that it doesent
work, since the source class cant accsess the subclass functions.
On 08/10/2013 09:13, markot...@gmail.com wrote:
esmaspäev, 7. oktoober 2013 17:16.29 UTC+3 kirjutas Mark Lawrence:
On 07/10/2013 14:54, markot...@gmail.com wrote:
I forgot to tell. The teisendaja module that i have imported, is a number
converter that allow to convert numbers from one base to
On Saturday, October 5, 2013 9:04:25 PM UTC-7, John Ladasky wrote:
> Hi folks,
>
>
>
> I'm trying to make some of Python class definitions behave like the ones I
> find in professional packages, such as Matplotlib. A Matplotlib class can
> often have a very large number of arguments -- some o
On 08/10/2013 09:20, markot...@gmail.com wrote:
To whom and to what are you replying?
--
Roses are red,
Violets are blue,
Most poems rhyme,
But this one doesn't.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
random...@fastmail.us writes:
> On Mon, Oct 7, 2013, at 13:15, Alain Ketterlin wrote:
>> That's fine. My point was: you can't at the same time have full
>> dynamicity *and* procedural optimizations (like tail call opt).
>> Everybody should be clear about the trade-off.
>
> Let's be clear about wha
Antoon Pardon writes:
> Op 07-10-13 19:15, Alain Ketterlin schreef:
[...]
>> That's fine. My point was: you can't at the same time have full
>> dynamicity *and* procedural optimizations (like tail call opt).
>> Everybody should be clear about the trade-off.
>
> Your wrong. Full dynamics is not i
Op 08-10-13 01:50, Steven D'Aprano schreef:
> On Mon, 07 Oct 2013 15:47:26 -0700, Mark Janssen wrote:
>
>> I challenge you to get
>> down to the machine code in scheme and formally describe how it's doing
>> both.
>
> For which machine?
>
> Or are you assuming that there's only one machine code
Hello, i'am trying to insert a new record or update an existing one in
case counterID(stands for the page's URL) and cookieID(random number) is
the same:
try:
# if first time for webpage; create new record( primary key is
automatic, hit is defaulted ), if page exists then update reco
On Mon, 07 Oct 2013 20:27:13 -0700, Mark Janssen wrote:
But even putting that aside, even if somebody wrote such a
description, it would be reductionism gone mad. What possible light
on the problem would be shined by a long, long list of machine code
operations, even if written
Στις 8/10/2013 12:15 μμ, ο/η Νίκος Αλεξόπουλος έγραψε:
Hello, i'am trying to insert a new record or update an existing one in
case counterID(stands for the page's URL) and cookieID(random number) is
the same:
try:
# if first time for webpage; create new record( primary key is
autom
Νίκος Αλεξόπουλος writes:
> Error is: ProgrammingError(ProgrammingError(1064, "You have an error
> in your SQL syntax; check the manual that corresponds to your MySQL
> server version for the right syntax to use near 'WHERE counterID = 1
> and cookieID = '3815'' at line 3"),)
This is an error fr
Op 07-10-13 23:27, random...@fastmail.us schreef:
> On Sat, Oct 5, 2013, at 3:39, Antoon Pardon wrote:
>> What does this mean?
>>
>> Does it mean that a naive implementation would arbitrarily mess up
>> stack traces and he wasn't interested in investigating more
>> sophisticated implementations?
>>
Alain Ketterlin writes:
> Antoon Pardon writes:
>
> > Op 07-10-13 19:15, Alain Ketterlin schreef:
>
> [...]
> >> That's fine. My point was: you can't at the same time have full
> >> dynamicity *and* procedural optimizations (like tail call opt).
> >> Everybody should be clear about the trade-off.
# initialize cookie and retrieve cookie from clients browser
cookie = cookies.SimpleCookie( os.environ.get('HTTP_COOKIE') )
if cookie.get('ID') is not None:
cookieID = cookie['ID'].value
else:
cookieID = random.randrange(0, )
cookie['ID'] = cookieID
cookie['ID'
In the following case:
>>> class Foo:
... _Foo__a = 100
... __a = 33
...
>>> Foo._Foo__a
33
I think this behavior, for a user who does not know the convention,
could be a surprise. Should be raising an exception (in order to inform
the user the transformation of the name __a have been
On 08.10.2013 08:33, Sam Giraffe wrote:
#this is a single line
string = '192.168.122.3 - - [29/Sep/2013:03:52:33 -0700] "GET / HTTP/1.0"
302 276 "-" "check_http/v1.4.16 (nagios-plugins 1.4.16)"'
#trying to break up the pattern match for easy to read code
pattern = re.compile(r'(?P\d{1,3}\.\d{1,3
On 8/10/2013 04:20, markot...@gmail.com wrote:
> I cant just subclassing doesent work.
I can't parse that "sentence."
> It seem the init method of the source class also calls out another
class. And the problem is, i can subclass the other class to with the required
function but the end result i
On 10/8/2013 6:13 AM, Marco Buttu wrote:
In the following case:
>>> class Foo:
... _Foo__a = 100
... __a = 33
...
>>> Foo._Foo__a
33
I think this behavior, for a user who does not know the convention,
could be a surprise.
No one qualified to use such names would do such a thing , so
On 10/08/2013 12:36 PM, Terry Reedy wrote:
On 10/8/2013 6:13 AM, Marco Buttu wrote:
In the following case:
>>> class Foo:
... _Foo__a = 100
... __a = 33
...
>>> Foo._Foo__a
33
I think this behavior, for a user who does not know the convention,
could be a surprise.
No one qualified
On 10/8/13 6:13 AM, Marco Buttu wrote:
In the following case:
>>> class Foo:
... _Foo__a = 100
... __a = 33
...
>>> Foo._Foo__a
33
I think this behavior, for a user who does not know the convention,
could be a surprise. Should be raising an exception (in order to
inform the user the t
On Tue, Oct 8, 2013 at 4:04 AM, Νίκος Αλεξόπουλος wrote:
> I use this code to retrive or set a cookie to the visitor's browser if
> present and identify him bu it.
>
> All work well except the situation where the user visits my webpage by
> clicking a backlink on another wbpage.
>
> Then for some
On 10/08/2013 01:07 PM, Ned Batchelder wrote:
On 10/8/13 6:13 AM, Marco Buttu wrote:
>>> class Foo:
... _Foo__a = 100
... __a = 33
...
>>> Foo._Foo__a
33
...
You also get a "problem" if you do this:
>>> class Foo:
... a = 100
... a = 33
...
>>> Foo.a
I want to do some postprocessing on messages from a particular mailbox.
So I use getmail which will fetch the messages and feed them to stdin
of my program.
As I don't know what encoding these messages will be in, I thought it
would be prudent to read stdin as binary data.
Using python 3.3 on a
In article ,
Chris Angelico wrote:
> On Tue, Oct 8, 2013 at 5:48 PM, wrote:
> > And if we were actually trying then that filename should just be "/w".
> > Would get rid of another 19 chars.
>
> I'm working this on the assumption that the dictionary file already
> exists (that's where it is o
On Tue, Oct 8, 2013 at 1:20 PM, Steven D'Aprano wrote:
> On Tue, 08 Oct 2013 10:46:50 +0530, Ravi Sahni wrote:
>
>> On Tue, Oct 8, 2013 at 8:47 AM, rusi wrote:
>>> I can only say how ironic it sounds to someone who is familiar with the
>>> history of our field: Turing was not a computer scientist
On 2013-10-08, Sam Giraffe wrote:
>
> Hi,
>
> I am trying to split up the re pattern for Apache log file format and seem
> to be having some trouble in getting Python to understand multi-line
> pattern:
>
> #!/usr/bin/python
>
> import re
>
> #this is a single line
> string = '192.168.122.3 - - [2
On Tue, Oct 8, 2013 at 11:14 AM, rusi wrote:
> To explain at length will be too long and OT (off-topic) for this list.
> I'll just give you a link and you tell me what you make of it:
> http://sloan.stanford.edu/mousesite/Secondary/Whorfframe2.html
I am trying to read link. Very new idea: Buildi
On Tue, 08 Oct 2013 18:16:01 +0530, Ravi Sahni wrote:
>> So in that sense, computers are Turing Machines. Anything a physical
>> computing device can compute, a Turing Machine could too. The converse
>> is not true though: a Turing Machine with infinite tape can compute
>> things where a real phys
On Tue, 08 Oct 2013 12:13:48 +0200, Marco Buttu wrote:
> In the following case:
>
> >>> class Foo:
> ... _Foo__a = 100
> ... __a = 33
> ...
> >>> Foo._Foo__a
> 33
>
> I think this behavior, for a user who does not know the convention,
> could be a surprise.
Yes, you are correct. It s
On Tuesday, October 8, 2013 6:31:21 PM UTC+5:30, Ravi Sahni wrote:
> On Tue, Oct 8, 2013 at 11:14 AM, rusi wrote:
> > To explain at length will be too long and OT (off-topic) for this list.
> > I'll just give you a link and you tell me what you make of it:
> > http://sloan.stanford.edu/mousesite/S
I think this is a bug in Python's UTF-8 handling, but I'm not sure.
If I've read the Unicode FAQs correctly, you cannot encode *lone*
surrogate code points into UTF-8:
http://www.unicode.org/faq/utf_bom.html#utf8-5
Sure enough, using Python 3.3:
py> surr = '\udc80'
py> surr.encode('utf-8')
Tra
On 2013-10-08, Mark Lawrence wrote:
> On 08/10/2013 06:34, Chandru Rajendran wrote:
>> Hi all,
>>
>> Please give me an idea about Multiprocessing and Multithreading.
>>
>> Thanks & Regards,
>>
>> Chandru
>>
>
> I'll assume that you're a newbie so I'll keep it simple.
> Multiprocessing is about mo
Parent class is at the link.
--
https://mail.python.org/mailman/listinfo/python-list
First helpful advice i have gotten from this forum
--
https://mail.python.org/mailman/listinfo/python-list
Στις 8/10/2013 2:08 μμ, ο/η Ian Kelly έγραψε:
On Tue, Oct 8, 2013 at 4:04 AM, Νίκος Αλεξόπουλος wrote:
I use this code to retrive or set a cookie to the visitor's browser if
present and identify him bu it.
All work well except the situation where the user visits my webpage by
clicking a backli
On 08/10/13 14:11, Steven D'Aprano wrote:
On Tue, 08 Oct 2013 18:16:01 +0530, Ravi Sahni wrote:
Presently Sir, I wish to ask single question: What you mean "wave our
hands"??
It is an idiom very common in Australia. (It may not be well known in the
rest of the English-speaking world.) It mea
I have to define a function add(c1, c2), where c1 and c2 are capital letters;
the return value should be the sum (obtained by converting the letters to
numbers, adding mod 26, then converting back to a capital letter).
All I have so far is:
def add(c1, c2):
ord(c1) - ord('a') + 1
ord(c
On Tue, 08 Oct 2013 07:15:46 -0700, markotaht wrote:
> First helpful advice i have gotten from this forum
If you insist on dropping cryptic comments with bad spelling, incoherent
sentences, and a complete lack of any context, it might be the last
advice you get too.
Please help us to help you.
On 08.10.2013 14:20, Antoon Pardon wrote:
As I don't know what encoding these messages will be in, I thought it
would be prudent to read stdin as binary data.
Using python 3.3 on a debian box I have the following code.
#!/usr/bin/python3
import sys
from email import message_from_file
sys.stdi
Στις 8/10/2013 2:08 μμ, ο/η Ian Kelly έγραψε:
This question is really about HTTP, not Python, so you'd have better
luck asking elsewhere. The most likely possibility is that the domain
doesn't match. For example, the cookie is set for the domain
www.foo.com, and the other webpage is linking to
On 08/10/13 15:28, kjaku...@gmail.com wrote:
I have to define a function add(c1, c2), where c1 and c2 are capital letters;
the return value should be the sum (obtained by converting the letters to
numbers, adding mod 26, then converting back to a capital letter).
Can you give some expected out
I don't think you are allowed to use the word dumbass to describe anyone or
anything buddy.
On Tuesday, October 1, 2013 9:42:31 AM UTC-4, Ferrous Cranus wrote:
> Στις 1/10/2013 4:27 μμ, ο/η Chris “Kwpolska” Warrick έγραψε:
>
> > On Tue, Oct 1, 2013 at 3:15 PM, Νίκος wrote:
>
> >> Στις 1/10/2
On Tuesday, October 8, 2013 10:47:39 AM UTC-4, Robert Day wrote:
> On 08/10/13 15:28, kjaku...@gmail.com wrote:
>
> Can you give some expected outputs? For example, add('A', 'B') should
>
> presumably return 'C', and add('M', 'B') should presumably return 'O',
>
> but what about add('A', 'A')
>From what I gather he was viewing files uploaded to the ftp folder and found
>this warning.html file contained within... So my take on it is, someone just
>uploaded it and this guy is freaking out making a buffoon out of himself.
--
https://mail.python.org/mailman/listinfo/python-list
teisipäev, 8. oktoober 2013 17:26.33 UTC+3 kirjutas Steven D'Aprano:
> On Tue, 08 Oct 2013 07:15:46 -0700, markotaht wrote:
>
>
>
> > First helpful advice i have gotten from this forum
>
>
>
> If you insist on dropping cryptic comments with bad spelling, incoherent
>
> sentences, and a comp
I rembembered a bit too late, are there any good tutorials for Pillow?
ImageTk.PhotoImage() keeps giving me error that there isnt such a method.
--
https://mail.python.org/mailman/listinfo/python-list
You wrote this:
def add(c1, c2):
ord(c1) - ord('a') + 1
ord(c2) - ord('a') + 1
First of all, this looks like homework. People will help you with
concepts here, but most frown on just providing answers. With that in
mind look at this:
>>> ord('A')
65
>>> ord('a')
97
>>>
In your assignm
On 2013-10-08, Steven D'Aprano wrote:
> py> c = '\N{LINEAR B SYLLABLE B038 E}'
> py> surr_pair = c.encode('utf-16be')
> py> print(surr_pair)
> b'\xd8\x00\xdc\x01'
>
> and then use those same values as the code points, I ought to be able to
> encode to UTF-8, as if it were the same \N{LINEAR B SYL
Steven D'Aprano writes:
> I think this is a bug in Python's UTF-8 handling, but I'm not sure.
[snip]
> py> s = '\ud800\udc01'
> py> s.encode('utf-8')
> Traceback (most recent call last):
> File "", line 1, in
> UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in
> position 0:
Op 08-10-13 16:24, Andreas Perstinger schreef:
On 08.10.2013 14:20, Antoon Pardon wrote:
As I don't know what encoding these messages will be in, I thought it
would be prudent to read stdin as binary data.
Using python 3.3 on a debian box I have the following code.
#!/usr/bin/python3
import s
On Tue, Oct 8, 2013, at 10:28, kjaku...@gmail.com wrote:
> I have to define a function add(c1, c2), where c1 and c2 are capital
> letters; the return value should be the sum (obtained by converting the
> letters to numbers, adding mod 26, then converting back to a capital
> letter).
>
> All I hav
On Tue, 08 Oct 2013 08:33:48 -0400, Roy Smith wrote:
> In article ,
> Chris Angelico wrote:
>
>> On Tue, Oct 8, 2013 at 5:48 PM, wrote:
>> > And if we were actually trying then that filename should just be
>> > "/w".
>> > Would get rid of another 19 chars.
>>
>> I'm working this on the assum
On Tuesday, October 8, 2013 11:36:51 AM UTC-4, rand...@fastmail.us wrote:
>
>
>
> Your description says capital letters, but 'a' is a lowercase letter.
>
>
>
> Does "mod 26" means A is 1, or is it 0? i.e., is A+A = B or is it A?
>
>
>
> What should your function do if the letter isn't a ca
On Tue, Oct 8, 2013, at 2:45, sprucebond...@gmail.com wrote:
> On Monday, October 7, 2013 8:17:21 PM UTC-10, Chris Angelico wrote:
> > print(*__import__("random").sample(open("/usr/share/dict/words").read().split("\n"),4))
> > # 87
>
> import random as r
> print(*r.sample(open("/usr/share/dict/wo
On Mon, 07 Oct 2013 23:33:31 -0700, Sam Giraffe wrote:
> I am trying to split up the re pattern for Apache log file format and
> seem to be having some trouble in getting Python to understand
> multi-line pattern:
Aiui apache log format uses space as delimiter, encapsulates strings in
'"' charac
On 2013-10-08, Neil Cerutti wrote:
> In any case, "\ud800\udc01" isn't a valid unicode string. In a
> perfect world it would automatically get converted to
> '\u00010001' without intervention.
This last paragraph is erroneous. I must have had a typo in my
testing.
--
Neil Cerutti
--
https://ma
On Tue, Oct 8, 2013, at 11:44, kjaku...@gmail.com wrote:
> def add(c1, c2):
> ans = ''
This only makes sense if your answer is going to be multiple characters.
> for i in c1 + c2:
This line concatenates the strings together.
> ans += chrord(i)-65))%26) + 65)
The way you are
> Aiui apache log format uses space as delimiter, encapsulates strings in
> '"' characters, and uses '-' as an empty field.
Specifying the field delimiter as a space, you might be able to use
the csv module to read these. I haven't done any Apache log file work
since long before the csv module was
On Tue, 08 Oct 2013 13:04:34 +0300, Νίκος Αλεξόπουλος wrote:
> I use this code to retrive or set a cookie to the visitor's browser if
> present and identify him bu it.
You are aware that using cookies to track a user who doesn't want to be
tracked won't work, because he'll just tell his browser
On 08/10/2013 15:28, kjaku...@gmail.com wrote:
I have to define a function add(c1, c2), where c1 and c2 are capital letters;
the return value should be the sum (obtained by converting the letters to
numbers, adding mod 26, then converting back to a capital letter).
I'd say the requirement is
Στις 8/10/2013 6:55 μμ, ο/η Denis McMahon έγραψε:
On Tue, 08 Oct 2013 13:04:34 +0300, Νίκος Αλεξόπουλος wrote:
I use this code to retrive or set a cookie to the visitor's browser if
present and identify him bu it.
You are aware that using cookies to track a user who doesn't want to be
tracked
On 2013-10-08 15:36, Denis McMahon wrote:
> On Tue, 08 Oct 2013 08:33:48 -0400, Roy Smith wrote:
> > In the old days, it used to be /usr/dict/words. Port Python to
> > v6, and save another 6 characters :-)
>
> Doesn't matter where it is, a link to it exists at "/w" now ;)
You prodigal...wasting
On 2013-10-08 17:17, Chris Angelico wrote:
> Who's up for some fun? Implement an XKCD-936-compliant password
> generator in Python 3, in less code than this:
>
> print(*__import__("random").sample(open("/usr/share/dict/words").read().split("\n"),4))
>
> Second challenge: Use it for generating all
On 10/8/13 7:15 AM, Marco Buttu wrote:
Also, as Terry mentions, no one has ever assigned the two names you
show,
Sincerely, I can not now if someone has assigned (or will assegne) in
such way...
If you explain more about what you are building, and where this crops up
as a problem, we can
On 08/10/2013 16:23, Pete Forman wrote:
Steven D'Aprano writes:
I think this is a bug in Python's UTF-8 handling, but I'm not sure.
[snip]
py> s = '\ud800\udc01'
py> s.encode('utf-8')
Traceback (most recent call last):
File "", line 1, in
UnicodeEncodeError: 'utf-8' codec can't encode cha
On 08.10.2013 17:25, Antoon Pardon wrote:
Op 08-10-13 16:24, Andreas Perstinger schreef:
Looking at the docs, I've found there is also "message_from_binary_file"
which works for me with your code.
http://docs.python.org/3/library/email.parser.html#email.message_from_binary_file
I can't try t
Is there any better way to identif a previous visitor? i tried cookies
which failed for me for the reason i opened this thread and host like
follows:
# try to locate the visitor
cur.execute('''SELECT * FROM visitors WHERE counterID = %s and host =
%s''', (cID, host) )
On 10/08/2013 09:07 AM, Tim Chase wrote:
On 2013-10-08 15:36, Denis McMahon wrote:
On Tue, 08 Oct 2013 08:33:48 -0400, Roy Smith wrote:
In the old days, it used to be /usr/dict/words. Port Python to
v6, and save another 6 characters :-)
Doesn't matter where it is, a link to it exists at "/w"
>> I don't have an infinite stack to implement
>> lambda calculus, but...
>
> And then
>
>> But this is not a useful formalism. Any particular Program implements
>> a DFA, even as it runs on a TM. The issue of whether than TM is
>> finite or not can be dismissed because a simple calculation can
>
On Tue, Oct 8, 2013 at 1:30 PM, Νίκος Αλεξόπουλος wrote:
> Is there any better way to identif a previous visitor? i tried cookies which
> failed for me for the reason i opened this thread and host like follows:
>
> # try to locate the visitor
> cur.execute('''SELECT
On 10/07/2013 11:17 PM, Chris Angelico wrote:
Who's up for some fun? Implement an XKCD-936-compliant password
generator in Python 3, in less code than this:
print(*__import__("random").sample(open("/usr/share/dict/words").read().split("\n"),4))
Second challenge: Use it for generating all your p
>>> sys.version
'3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)]'
>>> '\ud800'.encode('utf-8')
Traceback (most recent call last):
File "", line 1, in
UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in position
0:
surrogates not allowed
On Tue, Oct 8, 2013 at 12:04 PM, Νίκος Αλεξόπουλος
wrote:
> Στις 8/10/2013 6:55 μμ, ο/η Denis McMahon έγραψε:
>
>> On Tue, 08 Oct 2013 13:04:34 +0300, Νίκος Αλεξόπουλος wrote:
>>
>>> I use this code to retrive or set a cookie to the visitor's browser if
>>> present and identify him bu it.
>>
>>
Br
On Tue, 08 Oct 2013 19:04:37 +0300, Νίκος Αλεξόπουλος wrote:
> Can you help me with this particuler problem please?
Unfortunately I can't, because I am unable to reproduce the problem you
describe.
When I load my test page in the browser, then replace it with something
else by entering an addr
On Tuesday, October 8, 2013 5:47:56 AM UTC-10, rand...@fastmail.us wrote:
> Importing random as r doesn't actually save anything, since " as r" is
> the same five characters you saved from the one use of it.
I realize, it just looks nicer than the original __import__, and since it
doesn't add any
On Wed, Oct 9, 2013 at 7:27 AM, wrote:
> On Tuesday, October 8, 2013 5:47:56 AM UTC-10, rand...@fastmail.us wrote:
>> Importing random as r doesn't actually save anything, since " as r" is
>> the same five characters you saved from the one use of it.
>
> I realize, it just looks nicer than the or
markot...@gmail.com writes:
> Well english isnt my native language, and there are things i just dont
> know how to explain in any language.
I sympathise with attempting to explain things in a foreign language.
Sorry that you have that difficulty here.
But the rest of Steven's advice is sound: yo
On 8/10/2013 10:28, kjaku...@gmail.com wrote:
> I have to define a function add(c1, c2), where c1 and c2 are capital letters;
> the return value should be the sum (obtained by converting the letters to
> numbers, adding mod 26, then converting back to a capital letter).
>
> All I have so far is
On Wed, Oct 9, 2013 at 12:11 AM, Steven D'Aprano
wrote:
> On Tue, 08 Oct 2013 18:16:01 +0530, Ravi Sahni wrote:
>
>>> So in that sense, computers are Turing Machines. Anything a physical
>>> computing device can compute, a Turing Machine could too. The converse
>>> is not true though: a Turing Mac
On 10/8/2013 9:52 AM, Steven D'Aprano wrote:
I think this is a bug in Python's UTF-8 handling, but I'm not sure.
If I've read the Unicode FAQs correctly, you cannot encode *lone*
surrogate code points into UTF-8:
http://www.unicode.org/faq/utf_bom.html#utf8-5
Sure enough, using Python 3.3:
py
On 10/8/2013 5:47 PM, Terry Reedy wrote:
On 10/8/2013 9:52 AM, Steven D'Aprano wrote:
But reading the previous entry in the FAQs:
http://www.unicode.org/faq/utf_bom.html#utf8-4
I interpret this as meaning that I should be able to encode valid pairs
of surrogates.
It says you should be able
On Tue, 08 Oct 2013 18:00:58 +0100, MRAB wrote:
> The only time you should get a surrogate pair in a Unicode string is in
> a narrow build, which doesn't exist in Python 3.3 and later.
Incorrect.
py> sys.version
'3.3.0rc3 (default, Sep 27 2012, 18:44:58) \n[GCC 4.1.2 20080704 (Red Hat
4.1.2-52)
On 08/10/13 07:17, Chris Angelico wrote:
Who's up for some fun? Implement an XKCD-936-compliant password
generator in Python 3, in less code than this:
print(*__import__("random").sample(open("/usr/share/dict/words").read().split("\n"),4))
print("imploring epsilon decamp graveyard's")
# Chose
On Tue, 08 Oct 2013 15:14:33 +, Neil Cerutti wrote:
> In any case, "\ud800\udc01" isn't a valid unicode string.
I don't think this is correct. Can you show me where the standard says
that Unicode strings[1] may not contain surrogates? I think that is a
critical point, and the FAQ conflates
On 08Oct2013 10:59, Skip Montanaro wrote:
| > Aiui apache log format uses space as delimiter, encapsulates strings in
| > '"' characters, and uses '-' as an empty field.
|
| Specifying the field delimiter as a space, you might be able to use
| the csv module to read these. I haven't done any Apac
Στις 8/10/2013 10:29 μμ, ο/η Denis McMahon έγραψε:
On Tue, 08 Oct 2013 19:04:37 +0300, Νίκος Αλεξόπουλος wrote:
Can you help me with this particuler problem please?
Unfortunately I can't, because I am unable to reproduce the problem you
describe.
When I load my test page in the browser, then
On Oct 8, 2013 2:26 PM, "Steven D'Aprano" <
steve+comp.lang.pyt...@pearwood.info> wrote:
>
> On Tue, 08 Oct 2013 12:13:48 +0200, Marco Buttu wrote:
>
> > Another question is: where is the place in which this transformation
> > occurs? Is it at the parser level, before the dictionary attribute is
>
On Tue, 08 Oct 2013 15:05:26 +0100, wrote:
Parent class is at the link.
Please quote some context when you reply. What link?
Then again, I'm not about to click on some random link someone posts to a
newsgroup. Apart from being one of the classic ways to get a virus onto
my computer, it
1 - 100 of 119 matches
Mail list logo