Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Νίκος Γκρεεκ
Τη Κυριακή, 23 Σεπτεμβρίου 2012 8:38:38 π.μ. UTC+3, ο χρήστης Chris Angelico 
έγραψε:
> On Sun, Sep 23, 2012 at 3:18 PM, Dwight Hutto  wrote:
> 
> > On Sun, Sep 23, 2012 at 12:56 AM, Chris Angelico  wrote:
> 
> >> Steven's point is not that we, human beings (or parahuman beings, as
> 
> >> the case may be), do not know how to run code in Joomla; I've worked
> 
> >> with it, and know something about it, and my day job involves some PHP
> 
> >> programming, so there's a reasonable chance that I could help him.
> 
> >
> 
> > Then a referral, is what he needs, and what you need is to tell others
> 
> > you're a cross languaged programmer.
> 
> 
> 
> Okay. I hereby inform you all that I am polyglot. I know many
> 
> languages. But really, who here _isn't_? Is there anyone on this list
> 
> who has absolutely no skills outside of Python? I rather doubt it.
> 
> 
> 
> >> (If I cared to. I don't have very much sympathy for security holes in old
> 
> >> versions of big frameworks.)
> 
> >
> 
> > SYmpathy, how about empathy, to show your designs can have bugs, which
> 
> > is why they have version.
> 
> >
> 
> > Then refer him to the joomla security hole mailing list
> 
> 
> 
> How about: Google is your friend? I'm sure that a Joomla security hole
> 
> mailing list can easily be found at the opposite end of a web search.
> 
> 
> 
> > We're the borg. We have google to help, or another mailing list with data.
> 
> 
> 
> He has Google to help, and he can access other mailing lists. Anyone
> 
> who wants to admin a web site ought to be able to find appropriate
> 
> places to ask questions. There's a reasonable level of courtesy and
> 
> assistance offered, but eventually, it's time to just say "This is off
> 
> topic" and not try to assist.
> 
> 
> 
> ChrisA

I shouldn't have asked about Joomla here, or even about Python embedding within 
Joomla cms. I was under the impression that the latter was relevant to ask here 
but it seems it isnt.

My bad, let's just close this thread so i don't waste anyone's time.
-- 
http://mail.python.org/mailman/listinfo/python-list


Right tool for the job (was: Exact integer-valued floats)

2012-09-22 Thread Ben Finney
Tim Roberts  writes:

> Apologize in advance for top-posting.  My Xoom makes bottom-posting
> awkward.

Surely the better solution, then, is to use a tool which does allow you
to compose a message properly – and abstain from posting until you get
to such a tool.

-- 
 \ “Those are my principles. If you don't like them I have |
  `\others.” —Groucho Marx |
_o__)  |
Ben Finney

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Chris Angelico
On Sun, Sep 23, 2012 at 3:18 PM, Dwight Hutto  wrote:
> On Sun, Sep 23, 2012 at 12:56 AM, Chris Angelico  wrote:
>> Steven's point is not that we, human beings (or parahuman beings, as
>> the case may be), do not know how to run code in Joomla; I've worked
>> with it, and know something about it, and my day job involves some PHP
>> programming, so there's a reasonable chance that I could help him.
>
> Then a referral, is what he needs, and what you need is to tell others
> you're a cross languaged programmer.

Okay. I hereby inform you all that I am polyglot. I know many
languages. But really, who here _isn't_? Is there anyone on this list
who has absolutely no skills outside of Python? I rather doubt it.

>> (If I cared to. I don't have very much sympathy for security holes in old
>> versions of big frameworks.)
>
> SYmpathy, how about empathy, to show your designs can have bugs, which
> is why they have version.
>
> Then refer him to the joomla security hole mailing list

How about: Google is your friend? I'm sure that a Joomla security hole
mailing list can easily be found at the opposite end of a web search.

> We're the borg. We have google to help, or another mailing list with data.

He has Google to help, and he can access other mailing lists. Anyone
who wants to admin a web site ought to be able to find appropriate
places to ask questions. There's a reasonable level of courtesy and
assistance offered, but eventually, it's time to just say "This is off
topic" and not try to assist.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Dwight Hutto
> It would be nice if out python scripts can be used along with Joomla CMS, 
> Drupal or even Wordpress.

As long as the server side prerequisites has been met, then the code
should execute as long as it is allowed in the plugins.


-- 
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Exact integer-valued floats

2012-09-22 Thread Tim Roberts
True.  Seymour wanted all of the integer instructions to be combinatorial 
logic, rather than iterative.  Fortunately, since the floating point binary 
point was to the right, it was trivial to pack integers to float, do a floating 
computation, then unpack back to integer.

Apologize in advance for top-posting.  My Xoom makes bottom-posting awkward.
--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

Dave Angel  wrote:


On 09/22/2012 05:05 PM, Tim Roberts wrote:
> Dennis Lee Bieber  wrote:
>> On 22 Sep 2012 01:36:59 GMT, Steven D'Aprano wrote:
>>> For non IEEE 754 floating point systems, there is no telling how bad the
>>> implementation could be :(
>>  Let's see what can be found...
>>
>>  IBM 360: Same as Sigma-6 (no surprise; hearsay is the Sigma was
>> designed by renegade IBM folk; even down to using EBCDIC internally --
>> but with a much different interrupt system [224 individual interrupt
>> vectors as I recall, vs the IBM's 7 vectors and polling to find what
>> device]).
> The Control Data 6000/Cyber series had sign bit and 11-bit exponent, with
> either a 48-bit mantissa or a 96-bit mantissa, packed into one or two
> 60-bit words.  Values were not automatically normalized, so there was no
> assumed 1 bit, as in IEEE-754.

And it's been a long time (about 39 years), but as I recall the CDC 6400
(at least) had no integer multiply or divide.  You had to convert to
float first.  The other oddity about the CDC series is it's the last
machine I've encountered that used ones-complement for ints, with two
values for zero.


--

DaveA

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Νίκος Γκρεεκ
Τη Κυριακή, 23 Σεπτεμβρίου 2012 7:48:40 π.μ. UTC+3, ο χρήστης David Hutto 
έγραψε:

> No, joomla is a CMS framework of several languages. You're right, this
> 
> is a Joomla question, but even python could be added into joomla as an
> 
> API>

Thank you for pointing this out, looks very interesting, i already asked in 
forum.joomla.gr and i will post back if this is doable or not which as you 
claim it must be.

It would be nice if out python scripts can be used along with Joomla CMS, 
Drupal or even Wordpress.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Dwight Hutto
On Sun, Sep 23, 2012 at 12:56 AM, Chris Angelico  wrote:
> On Sun, Sep 23, 2012 at 2:48 PM, Dwight Hutto  wrote:
>> On Sun, Sep 23, 2012 at 12:06 AM, Steven D'Aprano
>>  wrote:
>>> On Sat, 22 Sep 2012 19:52:00 -0700, Νίκος Γκρεεκ wrote:
>>>
 Out of curiocity how would i used my python counter source code along
 with Joomla?
>>>
>>>
>>> This is not a Joomla forum. We do not know how to run code in Joomla.
>>
>> If they know Joomla(PHP, CSS, HTML, JAVASCRIPT, templates), then they
>> should know something about python, unlike Steven  D'Aprano, who only
>> knows Python, and in other posts, not that well to be a self
>> proclaimed expert.
>
> Steven's point is not that we, human beings (or parahuman beings, as
> the case may be), do not know how to run code in Joomla; I've worked
> with it, and know something about it, and my day job involves some PHP
> programming, so there's a reasonable chance that I could help him.

Then a referral, is what he needs, and what you need is to tell others
you're a cross languaged programmer.

(If
> I cared to. I don't have very much sympathy for security holes in old

SYmpathy, how about empathy, to show your designs can have bugs, which
is why they have version.

> versions of big frameworks.)

Then refer him to the joomla security hole mailing list

Or extend your skills, help him, then refer him


>
> But this is not the forum for it. We, the collective intelligence of
> python-list and comp.lang.python, are not experts on PHP, Joomla, etc,

We're the borg. We have google to help, or another mailing list with data.

> etc, etc. The fact that, in theory, you could make Joomla use Python
> is insignificant. I could write a Python script that fetches content
> from a Joomla web site, but that doesn't make Joomla questions
> appropriate here.
>
It does if the page he's using uses Python execution of code.



-- 
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Chris Angelico
On Sun, Sep 23, 2012 at 2:48 PM, Dwight Hutto  wrote:
> On Sun, Sep 23, 2012 at 12:06 AM, Steven D'Aprano
>  wrote:
>> On Sat, 22 Sep 2012 19:52:00 -0700, Νίκος Γκρεεκ wrote:
>>
>>> Out of curiocity how would i used my python counter source code along
>>> with Joomla?
>>
>>
>> This is not a Joomla forum. We do not know how to run code in Joomla.
>
> If they know Joomla(PHP, CSS, HTML, JAVASCRIPT, templates), then they
> should know something about python, unlike Steven  D'Aprano, who only
> knows Python, and in other posts, not that well to be a self
> proclaimed expert.

Steven's point is not that we, human beings (or parahuman beings, as
the case may be), do not know how to run code in Joomla; I've worked
with it, and know something about it, and my day job involves some PHP
programming, so there's a reasonable chance that I could help him. (If
I cared to. I don't have very much sympathy for security holes in old
versions of big frameworks.)

But this is not the forum for it. We, the collective intelligence of
python-list and comp.lang.python, are not experts on PHP, Joomla, etc,
etc, etc. The fact that, in theory, you could make Joomla use Python
is insignificant. I could write a Python script that fetches content
from a Joomla web site, but that doesn't make Joomla questions
appropriate here.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Dwight Hutto
On Sun, Sep 23, 2012 at 12:06 AM, Steven D'Aprano
 wrote:
> On Sat, 22 Sep 2012 19:52:00 -0700, Νίκος Γκρεεκ wrote:
>
>> Out of curiocity how would i used my python counter source code along
>> with Joomla?
>
>
> This is not a Joomla forum. We do not know how to run code in Joomla.

PHP, CSS, HTML, JAVASCRIPT, templates, that is if you study CMS, and
look at other languages.


> Regardless of whether the code is Python, or Perl, or Lisp, or Lua, or
> any of thousands of different languages, your question is about Joomla.

No, joomla is a CMS framework of several languages. You're right, this
is a Joomla question, but even python could be added into joomla as an
API>


> Please ask it on a Joomla forum.
> D'Aprano
> And when you are there, don't ask them to fix your Python bugs.

If they know Joomla(PHP, CSS, HTML, JAVASCRIPT, templates), then they
should know something about python, unlike Steven  D'Aprano, who only
knows Python, and in other posts, not that well to be a self
proclaimed expert.


-- 
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Functional way to compare things inside a list

2012-09-22 Thread Ramchandra Apte
On Saturday, 22 September 2012 12:50:08 UTC+5:30, Andrew Berg  wrote:
> On 2012.09.22 02:08, Jamie Paul Griffin wrote:
> 
> > I find this intriguing, I had no idea bots existed to post to mailing
> 
> > lists in this way. What's the point of them?
> 
> 
> 
> To amuse their owners is my guess.
> 
> -- 
> 
> CPython 3.3.0rc2 | Windows NT 6.1.7601.17835

The bot could be used for automatic replies for duplicate posts (common 
questions are quite often repeated)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Steven D'Aprano
On Sat, 22 Sep 2012 19:52:00 -0700, Νίκος Γκρεεκ wrote:

> Out of curiocity how would i used my python counter source code along
> with Joomla?


This is not a Joomla forum. We do not know how to run code in Joomla. 
Regardless of whether the code is Python, or Perl, or Lisp, or Lua, or 
any of thousands of different languages, your question is about Joomla. 
Please ask it on a Joomla forum.

And when you are there, don't ask them to fix your Python bugs.


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: portable way of locating an executable (like which)

2012-09-22 Thread Ramchandra Apte
On Friday, 21 September 2012 02:37:01 UTC+5:30, gelonida  wrote:
> I'd like to implement the equivalent functionality of the unix command
> 
> /usr/bin/which
> 
> 
> 
> The function should work under Linux and under windows.
> 
> 
> 
> Did anybody already implement such a function.
> 
> If not, is there a portable way of splitting the environment variable PATH?
> 
> 
> 
> Thanks for any sugestions

shutil.which does this in Python 3.3: 
http://docs.python.org/dev/library/shutil.html#shutil.which
You can copy the code to support older Python versions.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A little morning puzzle

2012-09-22 Thread Dwight Hutto
On Thu, Sep 20, 2012 at 12:28 PM, Tobiah  wrote:
>
>>> Here is my solution:
>
>
>>> ** Incredibly convoluted and maximally less concise solution
>>> than other offerings. **
>
>
>>> Might be better ones though.
>>
>>
>> Unlikely.
>
>
> Zing!
>

Why don't you all look at the code(python and C), and tell me how much
code it took to write the functions the other's examples made use of
to complete the task.

Just because you can use a function, and make it look easier, doesn't
mean the function you used had less code than mine, so if you look at
the whole of what you used to make it simpler, mine was on point.

-- 
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to limit CPU usage in Python

2012-09-22 Thread Dwight Hutto
Now also, just thinking theoretically with the knowledge I have,
you could underclock(as opposed to overclocking, which is what gamers
do), but have never seen that option in BIOS.

And maybe there is an option in your OS, google search term 'limiting
processes activity cpu usage':

https://www.google.com/search?client=ubuntu&channel=fs&q=limiting+processes+activity+cpu+usage&ie=utf-8&oe=utf-8

This seemed good for what you want from a brief overview:

http://www.cyberciti.biz/faq/cpu-usage-limiter-for-linux/


Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: unit test strategy

2012-09-22 Thread Aaron Brady
On Sunday, September 16, 2012 3:01:11 PM UTC-5, Steven D'Aprano wrote:
> On Sun, 16 Sep 2012 11:38:15 -0700, Aaron Brady wrote:
> > Here is an example of some repetitive code.
> > 
> > for view_meth in [ dict.items, dict.keys, dict.values ]:
> > dict0= dict( ( k, None ) for k in range( 10 ) ) 
> >   iter0= iter( view_meth( dict0 ) )
> > dict.__setitem__( dict0, 0, 1 )
> > next( iter0 )
> > dict.__setitem__( dict0, 10, 1 )
> > self.assertRaises( IterationError, next, iter0 )
> [...]
> 
> First off, if you have any wish for this to be accepted into the standard 
> library, I suggest you stick to PEP 8.

The code in the zip file on the other thread does conform to PEP 8.
 
> Secondly, this is test code. A bit of repetition is not to be concerned 
> about, clarity is far more important than "Don't Repeat Yourself". The 
> aim isn't to write the fastest, or most compact code, but to have good 
> test coverage with tests which are *obviously* correct (rather than test 
> code which has no obvious bugs, which is very different). If a test 
> fails, you should be able to identify quickly what failed without running 
> a debugger to identify what part of the code failed.
> 
> Thirdly, why are you writing dict.__setitem__( dict0, 0, 1 ) instead of 
> dict0[0] = 1 ?
> 
> 
> [...]
> > Specifically my questions are, is the code condensed beyond legibility? 
> 
> Yes.
> 
> 
> > Should 'chain' execute the test directly, or act as a metaprogram and
> > output the test code into a 2nd file, or both?
> 
> None of the above.
> 
> 
> > Should 'chain' create
> > the iterators in a dictionary, or in the function local variables
> > directly with 'exec'?
> 
> Heavens to Murgatroyd, you can't be serious.
> 
> 
> Here's my attempt at this. Note the features:
> 
> - meaningful names (if a bit long, but that's a hazard of tests)
> - distinct methods for each distinct test case
> - comments explaining what the test code does
> - use of subclassing
> 
> 
> # Untested
> class TestDictIteratorModificationDetection(unittest.TestCase):
[snip]
> def testIteratorFailsAfterSet(self):
> self.iterator_fails_after_modification(dict.__setitem__, 1, 1)
> 
> def testIteratorFailsAfterDel(self):
> self.iterator_fails_after_modification(dict.__delitem__, 1)
> 
> def testIteratorFailsAfterUpdate(self):
> self.iterator_fails_after_modification(dict.update, {5: 1})
> 
> def testIteratorFailsAfterPop(self):
> self.iterator_fails_after_modification(dict.pop, 4)
[snip]
> 
> I think I've got all the methods which can mutate a dictionary. If I 
> missed any, it's easy enough to add a new test method to the class.
[snip]

Well Mr. D'Aprano, I have some serious disagreements with the script you posted.

You did test all the mutating methods; there are 7; but I don't think it's 
enough.  You omitted the test case which revealed the bug originally or other 
pairs of operations; you didn't test on empty sets; you didn't test on "null" 
modifications; you didn't test on multiple iterators in any form; and you 
didn't test for memory leaks which is important with a dynamic structure.  A 
thorough test suite should contain tens if not hundreds of tests for this 
application.

Your script was very easy to understand.  However in the volume I'm advocating, 
something more concise would easier to understand, and D-R-Y becomes applicable 
again.  In a more concise form, the reader could browse what tests are 
executed, find a certain test or determine if it's omitted.

The "best of both" solution is a metaprogram, which is extremely brief, but 
does not run tests, and outputs a full test catalog instead, which is then 
itself scrutinized and run as the real test.  The test script would 
consequently be two files big, and be run in a specific order.  Not all tests 
can be condensed in a metaprogram; the script would contain large sections of 
literal code or it would appear in yet a 3rd file.

> Thirdly, why are you writing dict.__setitem__( dict0, 0, 1 ) instead of 
> dict0[0] = 1 ?

'__setitem__' can be passed to secondary functions whereas square brackets 
cannot.  The 2nd file, the output of the metaprogram, could contain either or 
both.  We could pass 'operator.setitem' as an alternative.

I realize I'm introducing yet a 3rd foreign concept with the patch.  If not 
enough readers approve of it I will have to abandon it, which would be a shame.

OTOH, I appreciate the fact you used my "for view in (dict.items, dict.keys, 
dict.values):" idea.  Also, what is your argument that an unstarted iterator 
should be exempt from invalidation when the set/dict is modified?  It is not 
obvious it should or shouldn't, similar to the behavior of modifying dict 
values but not keys, and I would side against the exemption.  (Perhaps we 
should raise that issue on the other thread.)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to limit CPU usage in Python

2012-09-22 Thread Dwight Hutto
rites:
>> Is it possible for me to put a limit in the amount of processor usage
>> (% CPU) that my current python script is using? Is there any module
>> useful for this task?
>
> One way is check your cpu usage once in a while, compare with elapsed
> time, and if your % usage is above what you want, sleep for a suitable
> interval before proceeding.
>

The script in constant runtime, unless it's in relation to other
processes, could be put on a % based sleep constant variable.

If the script is constantly running the same processes, and the OP
wants to limit it statistically, then at a critical portion in the
script sleep for a constant, or maybe, dynamic variable.

The only other is to create an app, disassemble it, and then refine
the asm instructions being used at the assembly level, but I'm just
scratching the surface of those enhancements.



-- 
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Chris Angelico
On Sun, Sep 23, 2012 at 12:52 PM, Νίκος Γκρεεκ  wrote:
> Τη Σάββατο, 22 Σεπτεμβρίου 2012 9:18:02 μ.μ. UTC+3, ο χρήστης Chris Angelico 
> έγραψε:
>> On Sun, Sep 23, 2012 at 4:13 AM, Νίκος Γκρεεκ  wrote:
>>
>> > Is there a way to somehow embed(or utilize) python code, for example my 
>> > python counter code script you have seen last week inside my 
>> > Joomla/WordPress cms sites?
>>
>> You probably could. But I reiterate, you're going about things all
>> backwards. Keep things way WAY simpler and just do some basic parsing
>> of your web logs after the event. Life is so much easier that way.
>>
>
> Out of curiocity how would i used my python counter source code along with 
> Joomla?

Easy. Look for what common sense would recommend, then turn 180
degrees. Let me know when you get there and we'll send the rest of the
directions.

-- paraphrasing what a stupid American tourist was told about
directions in Australia

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Νίκος Γκρεεκ
Τη Σάββατο, 22 Σεπτεμβρίου 2012 9:18:02 μ.μ. UTC+3, ο χρήστης Chris Angelico 
έγραψε:
> On Sun, Sep 23, 2012 at 4:13 AM, Νίκος Γκρεεκ  wrote:
> 
> > Is there a way to somehow embed(or utilize) python code, for example my 
> > python counter code script you have seen last week inside my 
> > Joomla/WordPress cms sites?
> 
> 
> 
> You probably could. But I reiterate, you're going about things all
> 
> backwards. Keep things way WAY simpler and just do some basic parsing
> 
> of your web logs after the event. Life is so much easier that way.
> 
> 
> 
> ChrisA

Out of curiocity how would i used my python counter source code along with 
Joomla?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: technologies synergistic with Python

2012-09-22 Thread Ethan Furman

Walter Hurry wrote:

On Sat, 22 Sep 2012 10:58:38 -0700, Emile van Sebille wrote:


On 9/21/2012 2:59 PM Ethan Furman said...

...if my dream job is one that consists mostly of Python, and might
allow telecommuting?

Hi Ethan,

I have an open position in my two man office I've tried to fill a couple
times without success that is predominately python and would allow for
telecommuting.  I'm looking for a third member of the team that will
focus on back end development integrating various systems through to an
open source python platform.

Where are you located?  I'm on the SF Peninsula.

Emile


PMFJI. If he's going to telecommute, why does it matter where he is 
located?


I would think the biggest reason is compatible time-zones.  After that, 
how costly face-to-face meetings would be.


~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list


Re: technologies synergistic with Python

2012-09-22 Thread Walter Hurry
On Sat, 22 Sep 2012 10:58:38 -0700, Emile van Sebille wrote:

> On 9/21/2012 2:59 PM Ethan Furman said...
>> ...if my dream job is one that consists mostly of Python, and might
>> allow telecommuting?
> 
> Hi Ethan,
> 
> I have an open position in my two man office I've tried to fill a couple
> times without success that is predominately python and would allow for
> telecommuting.  I'm looking for a third member of the team that will
> focus on back end development integrating various systems through to an
> open source python platform.
> 
> Where are you located?  I'm on the SF Peninsula.
> 
> Emile

PMFJI. If he's going to telecommute, why does it matter where he is 
located?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Print Function

2012-09-22 Thread Walter Hurry
On Sat, 22 Sep 2012 01:26:43 +, Steven D'Aprano wrote:

> On Fri, 21 Sep 2012 13:20:09 -0700, gengyangcai wrote:
> 
>> I am currently using Python 3.2.3 . WHen I use the print function by
>> typing print "Game Over" , it mentions  " SyntaxError : invalid syntax
>> ".  Any ideas on what the problem is and how to resolve it  ?
> 
> No, none what so ever. Perhaps you are the first person in the world to
> have come across this error. If you ever solve it, please write up the
> solution and put it on a blog or a website somewhere so that if it ever
> happens again, googling for "python print SyntaxError" will return a
> useful result.
> 
> Tongue-firmly-in-cheek-ly y'rs,

I think OP rather gave the game away with the subject line.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to limit CPU usage in Python

2012-09-22 Thread Paul Rubin
Rolando Cañer Roblejo  writes:
> Is it possible for me to put a limit in the amount of processor usage
> (% CPU) that my current python script is using? Is there any module
> useful for this task? 

One way is check your cpu usage once in a while, compare with elapsed
time, and if your % usage is above what you want, sleep for a suitable
interval before proceeding.

Tim Roberts: reasons to want to do this might involve a shared host
where excessive cpu usage affects other users; or a computer with
limited power consumption, where prolonged high cpu activity causes
thermal or other problems.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Exact integer-valued floats

2012-09-22 Thread Dave Angel
On 09/22/2012 05:05 PM, Tim Roberts wrote:
> Dennis Lee Bieber  wrote:
>> On 22 Sep 2012 01:36:59 GMT, Steven D'Aprano wrote:
>>> For non IEEE 754 floating point systems, there is no telling how bad the 
>>> implementation could be :(
>>  Let's see what can be found...
>>
>>  IBM 360: Same as Sigma-6 (no surprise; hearsay is the Sigma was
>> designed by renegade IBM folk; even down to using EBCDIC internally --
>> but with a much different interrupt system [224 individual interrupt
>> vectors as I recall, vs the IBM's 7 vectors and polling to find what
>> device]).
> The Control Data 6000/Cyber series had sign bit and 11-bit exponent, with
> either a 48-bit mantissa or a 96-bit mantissa, packed into one or two
> 60-bit words.  Values were not automatically normalized, so there was no
> assumed 1 bit, as in IEEE-754.

And it's been a long time (about 39 years), but as I recall the CDC 6400
(at least) had no integer multiply or divide.  You had to convert to
float first.  The other oddity about the CDC series is it's the last
machine I've encountered that used ones-complement for ints, with two
values for zero.


-- 

DaveA

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 3.3 and .pyo files

2012-09-22 Thread Terry Reedy

On 9/22/2012 9:21 AM, Steven D'Aprano wrote:

On Fri, 21 Sep 2012 22:46:08 -0400, Terry Reedy wrote:


On 9/21/2012 5:10 AM, Marco wrote:

I was trying to import a pyo module in Python 3.3, but Python does not
find it:


You appear to be trying to *run*, not *import* a .pyo module.


Marco is using the standard mechanism for finding, importing, and running
a module. I don't believe his use of -m should be a problem. It works in
3.2, and it works with .pyc files in 3.3, I see nothing to suggest it
shouldn't work with .pyo files in 3.3.



$ echo "print(__file__)" > foo.py
$ python3.3 -O -m foo


Since foo.py is in the current directory, I am not sure why you use '-m
foo' instead of 'foo.py'. -m is for running a module somewhere on
sys.path.


Yes, and the current directory is on sys.path.

I would be astonished if python -m could not find a module that happened
to be in the current directory.


[...]

Also, the
-O is sort of redundant, or perhaps interfering, since its usual effect
to to say 'get and put, from and to the cache, .pyo instead of .pyc'.


No it is not redundant. You link specifically to an bug tracker issue
below where is is clearly decided that if you want to run a .pyo file you
*must* use the -O switch. (I approve of this decision.)



/usr/local/bin/python3.3: No module named foo

How come? Thanks in advance, Marco


You might read some of http://bugs.python.org/issue12982

in particular, from http://bugs.python.org/issue12982#msg162814


Whose words are these following?



Python interpreters exist to run Python code. The existence,
persistence, and other details of compilation caches are
version-dependent implementation details. Being able to execute from
such caches without source present is also an implementation detail, and
for CPython, it gets secondary support at best. (This is a compromise
between full support and no support.)"


I'm not sure if these are your words, or if you are quoting some random
commenter on the pydev list, or one of the lead developers who might
actually know what he is talking about.


My words summarizing the discussion on pydev which included at least a 
few lead developers. My initial post was probably 6/12/2012



--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


Re: Redirecting STDOUT to a Python Variable

2012-09-22 Thread ross . marsden
To capture the traceback, so to put it in a log, I use this

import traceback

def get_traceback(): # obtain and return the traceback
exc_type, exc_value, exc_traceback = sys.exc_info()
return ''.join(traceback.format_exception(exc_type, exc_value, 
exc_traceback)) 


Suppose I have a script run by the scheduler, this captures the traceback form 
any problems and emails them.



if __name__ == '__main__':
try: 
Runs_unattended()
except:
send_mail(send_from = yourEmailAddress,
  send_to = [ yourEmailAddress ], subject = 'Runs_unattended',
  text = '%s' % get_traceback(),
  files = [], server=yourLocalSMTP)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Exact integer-valued floats

2012-09-22 Thread Tim Roberts
Dennis Lee Bieber  wrote:
>
>On 22 Sep 2012 01:36:59 GMT, Steven D'Aprano wrote:
>> 
>> For non IEEE 754 floating point systems, there is no telling how bad the 
>> implementation could be :(
>
>   Let's see what can be found...
>
>   IBM 360: Same as Sigma-6 (no surprise; hearsay is the Sigma was
>designed by renegade IBM folk; even down to using EBCDIC internally --
>but with a much different interrupt system [224 individual interrupt
>vectors as I recall, vs the IBM's 7 vectors and polling to find what
>device]).

The Control Data 6000/Cyber series had sign bit and 11-bit exponent, with
either a 48-bit mantissa or a 96-bit mantissa, packed into one or two
60-bit words.  Values were not automatically normalized, so there was no
assumed 1 bit, as in IEEE-754.
-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to limit CPU usage in Python

2012-09-22 Thread Tim Roberts
Rolando Cañer Roblejo  wrote:
>
>Is it possible for me to put a limit in the amount of processor usage (% 
>CPU) that my current python script is using?

Why?  That's an odd request.  It's natural to want to reduce your priority
if you want other processes handled first, but an idle CPU is a wasted
resource.  You want it to be busy all of the time.

>Some people recommend to use nice and cpulimit unix 
>tools, but those are external to python and I prefer a python solution. 

Scheduling and CPU priority are, by their very nature, operating system
concepts.  You will not find generic mechanisms wrapping them.
-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list


request for another code review

2012-09-22 Thread Littlefield, Tyler

Hello all:
I've gotten a bit farther into my python mud, and wanted to request 
another code review for style and the like. Mainly I'm concerned about 
player.py, world.py and components and other ways to handle what I'm 
trying to do.
I didn't run pychecker just yet, so there are probably a ton of syntax 
errors; my problem was that world was importing room, and room imported 
world for functionality and that made things a mess.
Ideas and suggestions for code cleanup and cleaner ways to do things 
would be appreciated.

git clone https://code.google.com/p/pymud/
Thanks,

--
Take care,
Ty
http://tds-solutions.net
The aspen project: a barebones light-weight mud engine:
http://code.google.com/p/aspenmud
He that will not reason is a bigot; he that cannot reason is a fool; he that 
dares not reason is a slave.

--
http://mail.python.org/mailman/listinfo/python-list


Re: how to do draw pattern with python?

2012-09-22 Thread Hans Mulder
On 21/09/12 19:32:20, Ian Kelly wrote:
> On Fri, Sep 21, 2012 at 10:50 AM, Ismael Farfán  wrote:
>> 2012/9/21 Peter Otten <__pete...@web.de>:
>>> echo.hp...@gmail.com wrote:
>>>
>>> print "\x1b[2J\x1b[0;0H" # optional
>>
>> Nice code : )
>>
>> Could you dissect that weird string for us?
>>
>> It isn't returning the cursor to (0,0), it's just like executing
>> clear(1), and looks like those line coloring scape sequences for bash.
> 
> They're called "ANSI escape codes". :-)
> 
> CSI 2J clears the screen.
> CSI 0;0H means "move the cursor to row 0, column 0".  However, I don't
> think that's valid ANSI, as the coordinates are 1-based.  Probably it
> should have been "\x1b[2J\x1b[1;1H".

Yes, the coordinates are 1-base, so it should have been
"\x1b[2J\x1b[1;1H".  Or, since 1;1 is the default, "\x1b[2J\x1b[H".

On my machine, clear(1) uses "\x1b[H\x1b[2J".

Using clear(1) appears to be the most portable way to do it:

import os, time

data = """\
xx
.x..x.
..xx..
..xx..
.x..x.
xx

""".splitlines()

data = [line * 12 for line in data] # optional

try:
while True:
os.system("clear") # optional
for i, line in enumerate(data):
print line
data[i] = line[1:] + line[:1]
time.sleep(.1)
except KeyboardInterrupt:
pass



Hope this helps,

-- HansM
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Chris Angelico
On Sun, Sep 23, 2012 at 4:13 AM, Νίκος Γκρεεκ  wrote:
> Is there a way to somehow embed(or utilize) python code, for example my 
> python counter code script you have seen last week inside my Joomla/WordPress 
> cms sites?

You probably could. But I reiterate, you're going about things all
backwards. Keep things way WAY simpler and just do some basic parsing
of your web logs after the event. Life is so much easier that way.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Νίκος Γκρεεκ
Τη Σάββατο, 22 Σεπτεμβρίου 2012 5:57:41 μ.μ. UTC+3, ο χρήστης Chris Angelico 
έγραψε:
> On Sun, Sep 23, 2012 at 12:44 AM, Νίκος Γκρεεκ  wrote:
> 
> > But how am i supposed to fix this vulnerability if i don't know which one 
> > is it?
> 
> >
> 
> > My guess is they used joomlas template to insert arbitrary code but thats 
> > just a guess.
> 
> 
> 
> The answer to that is a thing called "research", and you'll usually
> 
> find a lot of it at the other end of a web search. Also, you may want
> 
> to look into what it means to be a web site administrator. It doesn't
> 
> simply involve throwing down some code that someone else wrote and
> 
> expecting it to work.
> 
> 
> 
> If you want a web site without having to manage it yourself, consider
> 
> a blog instead - someone else hosts it and worries about security, and
> 
> you just post your content to it. It's a far FAR easier option, as
> 
> long as what you want can be shoehorned into someone else's layout
> 
> design.
> 
> 
> 
> Neither of these options involves any Python coding, so if you want
> 
> further assistance with them, I recommend looking for a forum
> 
> dedicated to the technology you use.
> 
> 
> 
> ChrisA

Okey i'll ask this to the officila joomla forum, one last thing though.

Is there a way to somehow embed(or utilize) python code, for example my python 
counter code script you have seen last week inside my Joomla/WordPress cms 
sites?

For example:

http://superhost.gr/ is my main website utilizing python counter script.

http://superhost.gr/html/?show=log is my own way(i prefer it over awstats - 
don't ask why) for viewing my visitors.

in my other sites which are CMS sites, like

http://varsa.gr
and
http://thessalonik.wordpress.com/

is there a possible way to embed(if thats the term) my python counter script 
there too?

so i can keep track of visitors info for each page i have there?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: technologies synergistic with Python

2012-09-22 Thread Emile van Sebille

On 9/21/2012 2:59 PM Ethan Furman said...

...if my dream job is one that
consists mostly of Python, and might allow telecommuting?


Hi Ethan,

I have an open position in my two man office I've tried to fill a couple 
times without success that is predominately python and would allow for 
telecommuting.  I'm looking for a third member of the team that will 
focus on back end development integrating various systems through to an 
open source python platform.


Where are you located?  I'm on the SF Peninsula.

Emile




--
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for an IPC solution

2012-09-22 Thread Adam Tauno Williams
On Fri, 2012-08-31 at 21:04 +0200, Laszlo Nagy wrote: 
> I have seen a stand alone cross platform IPC server before that could 
> serve "channels", and send/receive messages using these channels. But I 
> don't remember its name and now I cannot find it. Can somebody please help?

I strongly recommend RabbitMQ - http://www.rabbitmq.com/

Just having a real and robust message broker is fabulous.  It is
tempting at first to want to avoid 'external' components; but
development on top of a fully-featured message bus is extremely
addictive.  Working with Rabbit & AMQ is very pleasant and every time i
have a uh-oh-i-need-to-deal-with... moment I discover that
aha-rabbit-can-deal-with-that and back-to-my-application.









signature.asc
Description: This is a digitally signed message part
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Ben Finney
Νίκος Γκρεεκ  writes:

> Τη Σάββατο, 22 Σεπτεμβρίου 2012 4:09:37 μ.μ. UTC+3, ο χρήστης Steven D'Aprano 
> έγραψε:
> > Why are we discussing this? It has nothing to do with Python and is
> > completely off-topic for this list.
>
> But how am i supposed to fix this vulnerability if i don't know which
> one is it?

This is not the forum to discuss it.

-- 
 \ “It is the fundamental duty of the citizen to resist and to |
  `\  restrain the violence of the state.” —Noam Chomsky, 1971 |
_o__)  |
Ben Finney

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Chris Angelico
On Sun, Sep 23, 2012 at 12:44 AM, Νίκος Γκρεεκ  wrote:
> But how am i supposed to fix this vulnerability if i don't know which one is 
> it?
>
> My guess is they used joomlas template to insert arbitrary code but thats 
> just a guess.

The answer to that is a thing called "research", and you'll usually
find a lot of it at the other end of a web search. Also, you may want
to look into what it means to be a web site administrator. It doesn't
simply involve throwing down some code that someone else wrote and
expecting it to work.

If you want a web site without having to manage it yourself, consider
a blog instead - someone else hosts it and worries about security, and
you just post your content to it. It's a far FAR easier option, as
long as what you want can be shoehorned into someone else's layout
design.

Neither of these options involves any Python coding, so if you want
further assistance with them, I recommend looking for a forum
dedicated to the technology you use.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Νίκος Γκρεεκ
Τη Σάββατο, 22 Σεπτεμβρίου 2012 4:09:37 μ.μ. UTC+3, ο χρήστης Steven D'Aprano 
έγραψε:
> On Sat, 22 Sep 2012 11:13:43 +0100, Kev Dwyer wrote:
> 
> 
> 
> > This is only speculation, as I don't know exactly how your web page has
> 
> > been "hacked", but if your page somehow exposes a database connection,
> 
> > and the hack involves changing the contents of the database then you
> 
> > should read up on SQL injection attacks and how to prevent them.
> 
> 
> 
> This is joomla, that is, PHP. There are a bazillion ways to hack PHP. By 
> 
> the OP's own account, his website has been hacked twice before and he's 
> 
> done nothing to fix the vulnerability, just restored from backup. He'll 
> 
> be hacked again, and again, and again.
> 
> 
> 
> Why are we discussing this? It has nothing to do with Python and is 
> 
> completely off-topic for this list.
> 
> 
> 
> 
> 
> -- 
> 
> Steven

But how am i supposed to fix this vulnerability if i don't know which one is it?

My guess is they used joomlas template to insert arbitrary code but thats just 
a guess.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Blue Screen Python

2012-09-22 Thread Chris Angelico
On Sat, Sep 22, 2012 at 11:07 PM, Steven D'Aprano
 wrote:
> As per their partnership agreement, IBM took over development of OS/2
> version 2 while Microsoft worked on developing version 3. OS/2 2.0 was
> significantly improved over the 1.x series.
>
> Then Microsoft reneged on the agreement to release OS/2 version 3, and
> instead re-badged it as Windows NT. One might say there was a little bit
> of bad blood over this, especially as IBM had good reason to think that
> Microsoft had been spending IBM's money on NT.

And ever since then, Microsoft's been doing its best to kill OS/2 off.
By the look of the database server sitting next to me, and the clients
scattered throughout the building, it seems they have yet to
succeed...

OS/2 and Linux interoperate quite happily, too. Standards FTW.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 3.3 and .pyo files

2012-09-22 Thread Ramchandra Apte
On Saturday, 22 September 2012 18:51:01 UTC+5:30, Steven D'Aprano  wrote:
> On Fri, 21 Sep 2012 22:46:08 -0400, Terry Reedy wrote:
> 
> 
> 
> > On 9/21/2012 5:10 AM, Marco wrote:
> 
> >> I was trying to import a pyo module in Python 3.3, but Python does not
> 
> >> find it:
> 
> > 
> 
> > You appear to be trying to *run*, not *import* a .pyo module.
> 
> 
> 
> Marco is using the standard mechanism for finding, importing, and running 
> 
> a module. I don't believe his use of -m should be a problem. It works in 
> 
> 3.2, and it works with .pyc files in 3.3, I see nothing to suggest it 
> 
> shouldn't work with .pyo files in 3.3.
> 
> 
> 
> 
> 
> >> $ echo "print(__file__)" > foo.py
> 
> >> $ python3.3 -O -m foo
> 
> > 
> 
> > Since foo.py is in the current directory, I am not sure why you use '-m
> 
> > foo' instead of 'foo.py'. -m is for running a module somewhere on
> 
> > sys.path.
> 
> 
> 
> Yes, and the current directory is on sys.path.
> 
> 
> 
> I would be astonished if python -m could not find a module that happened 
> 
> to be in the current directory.
> 
> 
> 
> 
> 
> [...]
> 
> > Also, the
> 
> > -O is sort of redundant, or perhaps interfering, since its usual effect
> 
> > to to say 'get and put, from and to the cache, .pyo instead of .pyc'.
> 
> 
> 
> No it is not redundant. You link specifically to an bug tracker issue 
> 
> below where is is clearly decided that if you want to run a .pyo file you 
> 
> *must* use the -O switch. (I approve of this decision.)
> 
> 
> 
> 
> 
> >> /usr/local/bin/python3.3: No module named foo
> 
> >>
> 
> >> How come? Thanks in advance, Marco
> 
> > 
> 
> > You might read some of http://bugs.python.org/issue12982
> 
> > 
> 
> > in particular, from http://bugs.python.org/issue12982#msg162814
> 
> 
> 
> Whose words are these following?
> 
> 
> 
> 
> 
> > Python interpreters exist to run Python code. The existence,
> 
> > persistence, and other details of compilation caches are
> 
> > version-dependent implementation details. Being able to execute from
> 
> > such caches without source present is also an implementation detail, and
> 
> > for CPython, it gets secondary support at best. (This is a compromise
> 
> > between full support and no support.)"
> 
> 
> 
> I'm not sure if these are your words, or if you are quoting some random 
> 
> commenter on the pydev list, or one of the lead developers who might 
> 
> actually know what he is talking about.
It is Terry J. Reedy's words - see end of 
http://bugs.python.org/issue12982#msg162814 
 
 
> As I recall, some time in the recent past Guido came down *hard* against 
> 
> the suggestion that support for running sourceless files (.pyc and .pyo) 
> 
> should be dropped. Even if I'm misremembering, it is the case that the 
> 
> Python 3.3 will find and run a .pyc file, but not a .pyo file. There's a 
> 
> new candidate release of 3.3 due out over the next couple of days. If it 
> 
> shows the same behaviour, it should be reported as a bug.
> 
> 
> 
> 
> 
> 
> 
> -- 
> 
> Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Alister
On Sat, 22 Sep 2012 13:09:36 +, Steven D'Aprano wrote:

> On Sat, 22 Sep 2012 11:13:43 +0100, Kev Dwyer wrote:
> 
>> This is only speculation, as I don't know exactly how your web page has
>> been "hacked", but if your page somehow exposes a database connection,
>> and the hack involves changing the contents of the database then you
>> should read up on SQL injection attacks and how to prevent them.
> 
> This is joomla, that is, PHP. There are a bazillion ways to hack PHP. By
> the OP's own account, his website has been hacked twice before and he's
> done nothing to fix the vulnerability, just restored from backup. He'll
> be hacked again, and again, and again.
> 
> Why are we discussing this? It has nothing to do with Python and is
> completely off-topic for this list.

the case may be off topic, but the principles and advise being given is 
well worth taking note of regardless of language.



-- 
Kent's Heuristic:
Look for it first where you'd most like to find it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 3.3 and .pyo files

2012-09-22 Thread Steven D'Aprano
On Fri, 21 Sep 2012 22:46:08 -0400, Terry Reedy wrote:

> On 9/21/2012 5:10 AM, Marco wrote:
>> I was trying to import a pyo module in Python 3.3, but Python does not
>> find it:
> 
> You appear to be trying to *run*, not *import* a .pyo module.

Marco is using the standard mechanism for finding, importing, and running 
a module. I don't believe his use of -m should be a problem. It works in 
3.2, and it works with .pyc files in 3.3, I see nothing to suggest it 
shouldn't work with .pyo files in 3.3.


>> $ echo "print(__file__)" > foo.py
>> $ python3.3 -O -m foo
> 
> Since foo.py is in the current directory, I am not sure why you use '-m
> foo' instead of 'foo.py'. -m is for running a module somewhere on
> sys.path.

Yes, and the current directory is on sys.path.

I would be astonished if python -m could not find a module that happened 
to be in the current directory.


[...]
> Also, the
> -O is sort of redundant, or perhaps interfering, since its usual effect
> to to say 'get and put, from and to the cache, .pyo instead of .pyc'.

No it is not redundant. You link specifically to an bug tracker issue 
below where is is clearly decided that if you want to run a .pyo file you 
*must* use the -O switch. (I approve of this decision.)


>> /usr/local/bin/python3.3: No module named foo
>>
>> How come? Thanks in advance, Marco
> 
> You might read some of http://bugs.python.org/issue12982
> 
> in particular, from http://bugs.python.org/issue12982#msg162814

Whose words are these following?


> Python interpreters exist to run Python code. The existence,
> persistence, and other details of compilation caches are
> version-dependent implementation details. Being able to execute from
> such caches without source present is also an implementation detail, and
> for CPython, it gets secondary support at best. (This is a compromise
> between full support and no support.)"

I'm not sure if these are your words, or if you are quoting some random 
commenter on the pydev list, or one of the lead developers who might 
actually know what he is talking about.

As I recall, some time in the recent past Guido came down *hard* against 
the suggestion that support for running sourceless files (.pyc and .pyo) 
should be dropped. Even if I'm misremembering, it is the case that the 
Python 3.3 will find and run a .pyc file, but not a .pyo file. There's a 
new candidate release of 3.3 due out over the next couple of days. If it 
shows the same behaviour, it should be reported as a bug.



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Steven D'Aprano
On Sat, 22 Sep 2012 11:13:43 +0100, Kev Dwyer wrote:

> This is only speculation, as I don't know exactly how your web page has
> been "hacked", but if your page somehow exposes a database connection,
> and the hack involves changing the contents of the database then you
> should read up on SQL injection attacks and how to prevent them.

This is joomla, that is, PHP. There are a bazillion ways to hack PHP. By 
the OP's own account, his website has been hacked twice before and he's 
done nothing to fix the vulnerability, just restored from backup. He'll 
be hacked again, and again, and again.

Why are we discussing this? It has nothing to do with Python and is 
completely off-topic for this list.


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Blue Screen Python

2012-09-22 Thread Steven D'Aprano
On Sat, 22 Sep 2012 07:44:24 -0400, Dave Angel wrote:

[...]
> Your wording seems to imply that you still think NT was built on some
> earlier MS product.  It was written from scratch by a team recruited
> mostly from outside MS, including the leader, a guy who was I think
> experienced in VMS development.

I believe you are thinking of Dave Cutler, who wasn't just experienced in 
VMS development, he invented VMS. He also helped design the VAX, hated 
Unix with a passion, and killed off the RSTS operating system. He's now 
working on the Xbox.

Windows NT was one of the reasons the IBM and Microsoft fell out. IBM and 
Microsoft partnered to build a new generation operating system, OS/2. 
Microsoft blew through a whole lot of IBM's money, produced something 
that they called version 1 but was more like version 0.1 (it only did 
text applications and had no GUI). They did eventually bring out a 1.1 
version with a GUI, a year later.

As per their partnership agreement, IBM took over development of OS/2 
version 2 while Microsoft worked on developing version 3. OS/2 2.0 was 
significantly improved over the 1.x series.

Then Microsoft reneged on the agreement to release OS/2 version 3, and 
instead re-badged it as Windows NT. One might say there was a little bit 
of bad blood over this, especially as IBM had good reason to think that 
Microsoft had been spending IBM's money on NT.


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Blue Screen Python

2012-09-22 Thread Mark Lawrence

On 22/09/2012 12:44, Dave Angel wrote:



Your wording seems to imply that you still think NT was built on some
earlier MS product.  It was written from scratch by a team recruited
mostly from outside MS, including the leader, a guy who was I think
experienced in VMS development.  The names escape me right now.  But
there were a couple of books, by Helen someone, I think, which helped us
outsiders understand some of the philosophies of the development.



IIRC many of the people involved had VMS experience.  Apparantly M$ 
decided they needed a team who knew something about designing and 
implementing operating systems :)


--
Cheers.

Mark Lawrence.

--
http://mail.python.org/mailman/listinfo/python-list


Re: Blue Screen Python

2012-09-22 Thread 88888 Dihedral
Dave Angel於 2012年9月22日星期六UTC+8下午7時44分54秒寫道:
> On 09/22/2012 06:53 AM, Alister wrote:
> 
> > On Fri, 21 Sep 2012 18:47:57 -0400, Dave Angel wrote:
> 
> >
> 
> >> 
> 
> >>
> 
> >> That's not true at all.  You'd re thinking of Windows 3, Windows 95, 98,
> 
> >> and ME, which were hacked on top of MSDOS.  But Windows NT3.5, 4, 2000,
> 
> >> XP, Vista and Windows 7 have an entirely different bloodline.
> 
> >>
> 
> >> NT 3.51 was actually very robust, but in 4.0 to gain better performance,
> 
> >> they apparently did some compromising in the video driver's isolation.
> 
> >> And who knows what's happened since then.
> 
> > Although NT upwards has tried to introduce
> 
> 
> 
> Your wording seems to imply that you still think NT was built on some
> 
> earlier MS product.  It was written from scratch by a team recruited
> 
> mostly from outside MS, including the leader, a guy who was I think
> 
> experienced in VMS development.  The names escape me right now.  But
> 
> there were a couple of books, by Helen someone, I think, which helped us
> 
> outsiders understand some of the philosophies of the development.
> 
> 
> 
> >  user-space requirements the 
> 
> > need to maintain backwards compatibility has compromised these efforts.
> 
> > it is not helped by the end user's (just look at what happened to Vista's 
> 
> > attempt to make users authorise any changes to the system)
> 
> >
> 
> >
> 
> I don't see any connection between memory address space user models and
> 
> user security models.
> 
> 
> 
> -- 
> 
> 
> 
> DaveA

I tested MS NT in 1998-2002. I was pleased by the results to run real
multi-tasking processes at that time. I ran some linux machines 
at that time, too.

Anyway the heap walker problems in all the unix and linux systems
were very obvious in those years. 

My conclusion at that time was people from DEC were really good in the OS.
 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to apply the user's HTML environment in a Python programme?

2012-09-22 Thread Thomas Jollans
On 09/21/2012 02:57 PM, BobAalsma wrote:
> I'd like to write a programme that will be offered as a web service (Django), 
> in which the user will point to a specific URL and the programme will be used 
> to read the text of that URL.
> 
> This text can be behind a username/password, but for several reasons, I don't 
> want to know those. 
> 
> So I would like to set up a situation where the user logs in (if/when 
> appropriate), points out the URL to my programme and my programme would then 
> be able to read that particular text.
> 
> I'm aware this may sound fishy. It should not be: I want the user to be fully 
> aware and in control of this process.
> 
> Any thoughts on how to approach this?

What services are you planning to interface with? Many services (twitter
being a notable pioneer) have systems for external (web) applications to
log in without being given a user's username & password.

I think it's possible to load a page in an iframe and access it using
JavaScript/DOM from the parent page. This is probably what you'll want
to do.

You say you don't know the first thing about JavaScript. Well, my
friend, if you're developing for the web, learn JavaScript, or,
depending on your situation, hire a front end developer who knows
JavaScript. You can only do so much on the web without using JavaScript.
I recently discovered this guide to learning JS; it sounds reasonable:
http://javascriptissexy.com/how-to-learn-javascript-properly/

http://pyjs.org/ may be worth a look too.


-- Thomas

PS: Most of your messages appear to be both To: and Cc: this list.
Please stop sending each message twice, it's rather distracting.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Blue Screen Python

2012-09-22 Thread Dave Angel
On 09/22/2012 06:53 AM, Alister wrote:
> On Fri, 21 Sep 2012 18:47:57 -0400, Dave Angel wrote:
>
>> 
>>
>> That's not true at all.  You'd re thinking of Windows 3, Windows 95, 98,
>> and ME, which were hacked on top of MSDOS.  But Windows NT3.5, 4, 2000,
>> XP, Vista and Windows 7 have an entirely different bloodline.
>>
>> NT 3.51 was actually very robust, but in 4.0 to gain better performance,
>> they apparently did some compromising in the video driver's isolation.
>> And who knows what's happened since then.
> Although NT upwards has tried to introduce

Your wording seems to imply that you still think NT was built on some
earlier MS product.  It was written from scratch by a team recruited
mostly from outside MS, including the leader, a guy who was I think
experienced in VMS development.  The names escape me right now.  But
there were a couple of books, by Helen someone, I think, which helped us
outsiders understand some of the philosophies of the development.

>  user-space requirements the 
> need to maintain backwards compatibility has compromised these efforts.
> it is not helped by the end user's (just look at what happened to Vista's 
> attempt to make users authorise any changes to the system)
>
>
I don't see any connection between memory address space user models and
user security models.

-- 

DaveA

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to apply the user's HTML environment in a Python programme?

2012-09-22 Thread BobAalsma
Op vrijdag 21 september 2012 22:10:04 UTC+2 schreef Dennis Lee Bieber het 
volgende:
> On Fri, 21 Sep 2012 09:36:08 -0400, Jerry Hill
> 
> declaimed the following in gmane.comp.python.general:
> 
> 
> 
> > On Fri, Sep 21, 2012 at 9:31 AM, BobAalsma wrote:
> 
> > > Thanks, Joel, yes, but as far as I'm aware these would all require the 
> > > Python programme to have the user's username and password (or 
> > > "credentials"), which I wanted to avoid.
> 
> > 
> 
> > No matter what you do, your web service is going to have to
> 
> > authenticate with the remote web site.  The details of that
> 
> > authentication are going to vary with each remote web site you want to
> 
> > connect to.
> 
> 
> 
>   Hmmm, convoluted but presuming the "login" third party site uses
> 
> cookies... Would it be possible to use Javascript on the client "copy"
> 
> the HTML from the third-party and then transmit it to the application
> 
> rather than having the application trying to do a direct fetch given
> 
> just the URL?
> 
> 
> 
>   This should keep the authentication local to the client machine.
> 
> 
> 
> 
> 
> -- 
> 
>   Wulfraed Dennis Lee Bieber AF6VN
> 
> wlfr...@comHTTP://wlfraed.home.netcom.com/

Wulfraed, yes, as with David's proposal: this sounds good, but I wouldn't know 
the first thing about Javascript... 
I'm also concerned that both solutions would seem to imply distributing 
software (or "software") to the clients systems.
Hmm.

Bob
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to apply the user's HTML environment in a Python programme?

2012-09-22 Thread BobAalsma
Op vrijdag 21 september 2012 17:28:02 UTC+2 schreef David Smith het volgende:
> On 2012-09-21 08:57, BobAalsma wrote:
> 
> > This text can be behind a username/password, but for several reasons, I 
> > don't want to know those.
> 
> >
> 
> > So I would like to set up a situation where the user logs in (if/when 
> > appropriate), points out the URL to my programme and my programme would 
> > then be able to read that particular text.
> 
> I do this from a bat file that I will later translate to Python.
> 
> I tell my work wiki which file I want. I use chrome, so for every new 
> 
> session I'm asked for my credentials. However, that is all transparent 
> 
> to my bat file.
> 
> 
> 
> For that matter, when I download a new build from part of another bat 
> 
> file, I use Firefox and never see the credential exchange.
> 
> 
> 
> I wouldn't expect any different behavior using Python.

Umm, David, sorry, you've lost me but I think this could be a good solution - 
at least the division in client side/server side sounds like what I'm looking 
for. Could you please elaborate?

Bob
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Alister
On Sat, 22 Sep 2012 18:07:32 +1000, Chris Angelico wrote:

> On Sat, Sep 22, 2012 at 5:13 PM, Νίκος Γκρεεκ 
> wrote:
>> The web host company pulled a previous backup and now its all good.
>>
>> My apologies for the annoyance i have coused you all i wanted was some
>> insight so to make sure this wont happen again( it already happened 2
>> times by now).
> 
> Just read those two sentences together, and figure out whether it really
> is "all good". What's happened twice can happen again.
> 
> ChrisA

Indeed I would take this site down immediately until you can work out the 
insecurity in your application.

without knowing too much I would suggest checking the following~:

Rule 1) Use a strong password for the framework administration.

Rule 2) Validate all inputs

Rule 3) Do not give your application any more access privileges to you 
data bas that absolutely necessary.

Rule 4)Ensure any data files containing passwords (hashed or otherwise) 
are stored outside the web-route.

Rule 5) Validate ALL Inputs

Rule 6) There is no rule 6

Rule 7) use prepared statements for database queries, do not construct 
them on the fly from user input ( Google SQL injection)

Rule 8) VALIDATE ALL INPUTS!

(Acknowledgement to 'The Bruces')


-- 
My life is a patio of fun!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reading a file in IDLE 3 on Mac-Lion

2012-09-22 Thread Hans Mulder
On 22/09/12 09:30:57, Franck Ditter wrote:
> In article <505ccdc5$0$6919$e4fe5...@news2.news.xs4all.nl>,
>  Hans Mulder  wrote:
> 
>> On 21/09/12 16:29:55, Franck Ditter wrote:
>>> I create a text file utf-8 encoded in Python 3 with IDLE (Mac Lion).
>>> It runs fine and creates the disk file, visible with
>>> TextWrangler or another.
>>> But I can't open it with IDLE (its name is greyed).
>>> IDLE is supposed to read utf-8 files, no ?
>>> This works on Windows-7.
>>
>> There's a little pop-menu below the list of files.
>>
>> It allows you to choose which kind of files you want to open.
>> By default, it is set to "Python files", which greys out all
>> files, except those with a '.py' or '.pyw' extension.
>> Setting it to "Text files" should help, or else try "All files".
>>
>> Hope this helps
>>
>> -- HansM
> 
> Alas this pop-up menu is for Windows only, I don't
> find it on MacOS-X.

It's there on my MacOS X 10.6.5 system.

If your 10.7 system doesn't show it, that's definitely a bug.

> My files are xxx.dat files and not visible,
> even text only (numeric data).

As a work-around, you could name the your file xxx.pyw.

On Windows, there's a functional difference between .py
and .pyw.  On a Mac, there's no functional difference and
Idle is willing to open both types of files, so you could
use .py for code and .pyw for data.

> This can be filed as something to do !

If you're feeling adventurous, you could try solving it
yourself.  Idle is written in pure Python; that makes
this sort of thing a lot easier than if it were in C.

And bug reports with a patch are far more likely to be
picked up by the dev team.

Hope this helps,

-- HansM


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Blue Screen Python

2012-09-22 Thread Alister
On Fri, 21 Sep 2012 18:47:57 -0400, Dave Angel wrote:

> On 09/21/2012 12:01 PM, Alister wrote:
>> On Fri, 21 Sep 2012 15:14:53 +, Grant Edwards wrote:
>>
>>> On 2012-09-21, mikcec82  wrote:
 Hallo to all,

 I'm using Python 2.7.3 with Windows 7 @ 64 bit and an Intel Core i3
 -2350M CPU @2.30GHz 2.3GHz.

 Sometimes, when I'm programming in Python on my screen compare this
>>> Python is a user-space application.  User-space applications can't
>>> cause blue-screens unless they manage to trigger a bug in hardware, OS
>>> kernel,
>>> or device driver.
> 
> True.  Too bad there are so many of those bugs.
> 
>> But Windows does not have any true concept of user-space (although it
>> does make an almost convincing pretence) it has been hacked up from an
>> operating system that's original security model was "Lock the door when
>> you leave the office"
>>
>>
> That's not true at all.  You're thinking of Windows 3, Windows 95, 98,
> and ME, which were hacked on top of MSDOS.  But Windows NT3.5, 4, 2000,
> XP, Vista and Windows 7 have an entirely different bloodline.
> 
> NT 3.51 was actually very robust, but in 4.0 to gain better performance,
> they apparently did some compromising in the video driver's isolation.
> And who knows what's happened since then.

Although NT upwards has tried to introduce user-space requirements the 
need to maintain backwards compatibility has compromised these efforts.
it is not helped by the end user's (just look at what happened to Vista's 
attempt to make users authorise any changes to the system)



-- 
VMS, n.:
The world's foremost multi-user adventure game.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Exact integer-valued floats

2012-09-22 Thread Nobody
On Fri, 21 Sep 2012 15:23:41 -0700, Paul Rubin wrote:

> Steven D'Aprano  writes:
>> Have I got this right? Is there a way to work out the gap between one
>> float and the next?
> 
> Yes, 53-bit mantissa as people have mentioned.  That tells you what ints
> can be exactly represented.  But, arithmetic in some situations can have a
> 1-ulp error.  So I wonder if it's possible that if n is large enough, you
> might have something like n+1==n even if the integers n and n+1 have
> distinct floating point representations.

Not for IEEE-754. Or for any sane implementation, for that matter. OTOH,
you can potentially get n != n due to the use of extended precision for
intermediate results.

For IEEE-754, addition, subtraction, multiplication, division, remainder
and square root are "exact" in the sense that the result is as if the
arithmetic had been performed with an infinite number of bits then rounded
afterwards. For round-to-nearest, the result will be the closest
representable value to the exact value.

Transcendental functions suffer from the "table-maker's dilemma", and the
result will be one of the two closest representable values to the exact
value, but not necessarily *the* closest.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Kev Dwyer
Νίκος Γκρεεκ wrote:

> Τη Σάββατο, 22 Σεπτεμβρίου 2012 10:26:05 π.μ. UTC+3, ο χρήστης Peter Otten
> έγραψε:
>> Νίκος Γκρεεκ wrote:
>> 
>> 
>> 
>> > One webpage of mine, http://www.varsa.gr/ has been *hacked* 15 mins
>> > ago.
>> 
>> 
>> 
>> > Please visit my web page varsa.gr and view the source code and maybe
>> > you
>> 
>> > can tell me what has happened.
>> 
>> 
>> 
>> Do you use a password that was exposed in the other thread,
>> 
>> 
>> 
>> http://mail.python.org/pipermail/python-list/2012-September/630779.html
>> 
>> 
>> 
>> ?
> No, that was for another web page of mine utilizing python mysql
> connection, this was joomla only website which remind me to also ask if i
> can embed somwhow python code to joomla cms.


This is only speculation, as I don't know exactly how your web page has been 
"hacked", but if your page somehow exposes a database connection, and the 
hack involves changing the contents of the database then you should read up 
on SQL injection attacks and how to prevent them. 

Cheers,

Kev

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Dwight Hutto
On Fri, Sep 21, 2012 at 2:45 PM, Νίκος Γκρεεκ  wrote:
> Hello,
>
> One webpage of mine, http://www.varsa.gr/ has been *hacked* 15 mins ago.
>
The others are right, this is a joomla question, unless you're
allowing execution of code by members and they utilize python.

My questions:
Only one? From my experience of joomla, you can allow your posters to
execute code within their postings by utilizing certain plugins.

It seems odd that only one page was hacked, or that they let you know,
and didn't try db access.

But it seems you're site had a hosting backup, but make sure to
subscribe to the joomla update and security list, plus change the
passwords.

> I logged into CPanel but the joomla files seem ok.

Did you have a backup of the file structure, and a zipped db backup,
then check for new security flaws/change passwords/etc?

> but when i view page code with chrome i get the source code, i dont knwo of 
> which file thaty contains javascript inside.
>
> Please visit my web page varsa.gr and view the source code and maybe you can 
> tell me what has happened.
>
> I would be gratefull for any help you provide me.
>
> I know this is not a python question but you guyshave high knowledge of web 
> sites programming and i though you wouldnt mind helping me out.

Yeah, programming, but joomla is html, php, css, and javascript, but I
don't remember much python there.


Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Chris Angelico
On Sat, Sep 22, 2012 at 5:13 PM, Νίκος Γκρεεκ  wrote:
> The web host company pulled a previous backup and now its all good.
>
> My apologies for the annoyance i have coused you all i wanted was some 
> insight so to make sure this wont happen again( it already happened 2 times 
> by now).

Just read those two sentences together, and figure out whether it
really is "all good". What's happened twice can happen again.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Νίκος Γκρεεκ
Τη Σάββατο, 22 Σεπτεμβρίου 2012 10:26:05 π.μ. UTC+3, ο χρήστης Peter Otten 
έγραψε:
> Νίκος Γκρεεκ wrote:
> 
> 
> 
> > One webpage of mine, http://www.varsa.gr/ has been *hacked* 15 mins ago.
> 
> 
> 
> > Please visit my web page varsa.gr and view the source code and maybe you
> 
> > can tell me what has happened.
> 
> 
> 
> Do you use a password that was exposed in the other thread,
> 
> 
> 
> http://mail.python.org/pipermail/python-list/2012-September/630779.html
> 
> 
> 
> ?
No, that was for another web page of mine utilizing python mysql connection, 
this was joomla only website which remind me to also ask if i can embed somwhow 
python code to joomla cms.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reading a file in IDLE 3 on Mac-Lion

2012-09-22 Thread Franck Ditter
In article <505ccdc5$0$6919$e4fe5...@news2.news.xs4all.nl>,
 Hans Mulder  wrote:

> On 21/09/12 16:29:55, Franck Ditter wrote:
> > I create a text file utf-8 encoded in Python 3 with IDLE (Mac Lion).
> > It runs fine and creates the disk file, visible with
> > TextWrangler or another.
> > But I can't open it with IDLE (its name is greyed).
> > IDLE is supposed to read utf-8 files, no ?
> > This works on Windows-7.
> 
> There's a little pop-menu below the list of files.
> 
> It allows you to choose which kind of files you want to open.
> By default, it is set to "Python files", which greys out all
> files, except those with a '.py' or '.pyw' extension.
> Setting it to "Text files" should help, or else try "All files".
> 
> Hope this helps
> 
> -- HansM

Alas this pop-up menu is for Windows only, I don't
find it on MacOS-X. My files are xxx.dat files and not visible,
even text only (numeric data).
This can be filed as something to do !
Thanks,

franck
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Print Function

2012-09-22 Thread Mark Lawrence

On 22/09/2012 02:26, Steven D'Aprano wrote:

On Fri, 21 Sep 2012 13:20:09 -0700, gengyangcai wrote:


I am currently using Python 3.2.3 . WHen I use the print function by
typing print "Game Over" , it mentions  " SyntaxError : invalid syntax
".  Any ideas on what the problem is and how to resolve it  ?


No, none what so ever. Perhaps you are the first person in the world to
have come across this error. If you ever solve it, please write up the
solution and put it on a blog or a website somewhere so that if it ever
happens again, googling for "python print SyntaxError" will return a
useful result.

Tongue-firmly-in-cheek-ly y'rs,




+ one trillion

--
Cheers.

Mark Lawrence.

--
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Peter Otten
Νίκος Γκρεεκ wrote:

> One webpage of mine, http://www.varsa.gr/ has been *hacked* 15 mins ago.

> Please visit my web page varsa.gr and view the source code and maybe you
> can tell me what has happened.

Do you use a password that was exposed in the other thread,

http://mail.python.org/pipermail/python-list/2012-September/630779.html

?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Functional way to compare things inside a list

2012-09-22 Thread Andrew Berg
On 2012.09.22 02:08, Jamie Paul Griffin wrote:
> I find this intriguing, I had no idea bots existed to post to mailing
> lists in this way. What's the point of them?

To amuse their owners is my guess.
-- 
CPython 3.3.0rc2 | Windows NT 6.1.7601.17835
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: One of my joomla webpages has been hacked. Please help.

2012-09-22 Thread Νίκος Γκρεεκ
Τη Σάββατο, 22 Σεπτεμβρίου 2012 4:42:35 π.μ. UTC+3, ο χρήστης Steven D'Aprano 
έγραψε:
> On Fri, 21 Sep 2012 11:45:14 -0700, Νίκος Γκρεεκ wrote:
> 
> 
> 
> > One webpage of mine, [url redacted] has been *hacked* 15 mins ago.
> 
> [...]
> 
> > I would be gratefull for any help you provide me.
> 
> 
> 
> Yeah yeah, sure. Is this an attempt to get people to visit your web site 
> 
> so it can do a drive-by install of malware?
> 
> 
> 
>  
> 
> > I know this is not a python question 
> 
> 
> 
> But you asked anyway. Why don't you ask your car mechanic to fix your 
> 
> plumbing, or go to the doctor to ask advice on how to cook pizza?

I was not into my intention to infect you with drive-by malware, it just my web 
site got defaced and i wanted info on how they did it.

The web host company pulled a previous backup and now its all good.

My apologies for the annoyance i have coused you all i wanted was some insight 
so to make sure this wont happen again( it already happened 2 times by now).
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Functional way to compare things inside a list

2012-09-22 Thread Jamie Paul Griffin
[ Ian Kelly wrote on Sat 22.Sep'12 at  0:22:43 -0600 ]

> On Fri, Sep 21, 2012 at 7:25 PM, Steven D'Aprano
>  wrote:
> > On Fri, 21 Sep 2012 14:49:55 -0600, Ian Kelly wrote:
> >
> >> On Fri, Sep 21, 2012 at 1:54 PM, 8 Dihedral
> >>  wrote:
> >>> I don't think functional aspects are only marked as lazy programming.
> >>
> >> He wrote "lazy evaluation", not "lazy programming".  Two entirely
> >> different things.
> >
> >
> > For the record, the consensus here is that 8 Dihedral is probably a
> > bot. It appears to be a pretty good bot, I haven't spotted it making any
> > egregious or obvious grammatical mistakes, but the semantics of its posts
> > don't seem quite human.
> 
> I'm aware of that, although sometimes the posts seem coherent enough
> that I think maybe it's not.  Especially the ones where it posts
> almost-working code snippets, complete with obvious typos.
> 
> Then it posts a complete non sequitur like the reply to my reply in
> this thread, and the illusion is shattered.

I find this intriguing, I had no idea bots existed to post to mailing
lists in this way. What's the point of them?
-- 
http://mail.python.org/mailman/listinfo/python-list