Python's Plugins for NetBeans 16

2023-04-04 Thread Carlos Fulqueris
Dear Python Support,

I'm looking for "Python Plugins for NetBeans 16". I already installed
Python 3.11.2 for Windows 11 and I can't find such plugins to create python
projects.

I would appreciate it if you tell me where to download these plugins or if
there is any other issue that I should do differently.

Thank you very much in advance.
Best to all.

Carlos Fulqueris
+54 911 2251 9302
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: FTP without username and password

2022-12-07 Thread Carlos Bermúdez

El 6/12/2022 a las 9:32 p. m., Dennis Lee Bieber escribió:

On Tue, 6 Dec 2022 20:42:42 +0100, ^Bart 
declaimed the following:



I tried the written Python code but it needs to insert a username and
password so it's a different service than TFTP but maybe there's also a
code to do it in Python! ;)



It's a whole different protocol. TFTP is simplified to the point it
will fit on embedded devices which don't need security (the assumption
being that one has the embedded device physically present, FTP assumes
distributed networks).

https://wiki.python.org/moin/tftp




TFTP is used usually to manage updates and boot workstations without 
bootable disks using a NIC with a preloaded ROM.

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


SSL/TLS certificate verification suddenly broken, Python 3 on Windows 10

2021-02-16 Thread Carlos Andrews
Hi All,

I ran into an error I, so far, cannot explain regarding Python's general
ability to communicate via SSL/TLS.

I'm using Python a lot to communicate with web servers and APIs, which
worked just fine until yesterday (or somewhen late last week).

I first noticed yesterday, when a requests-based call to a local web server
with a self-signed certificate failed. No worries, I thought, passing the
"verify=False" parameter to the request fixed the issue.

Later on I used the same call to a public web server with a valid,
CA-signed certificate and got the same error:
SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed: unable to get local issuer certificate
(_ssl.c:1123)'))

That caused me to stop and try simple calls like
import requests
resp = requests.request('GET', 'https://www.nytimes.com/')
to fail alike. And I surely would not turn off certificate verification to
public websites.

First assuming a network connection problem I tried curl, openssl or a web
browser, all worked fine. Only Python fails.

I checked the installed certificate bundle, all correct and even upgraded
it to the latest version. No effect. I replaced it with the one curl is
using and that curl managed to verify the cert with. No effect.

By that time I was using a Python 3.7.9 installation on Windows 10 that ran
fine for months (and also before upgrading to 3.7.9).

I tried upgrading certifi and requests to the latest versions, which also
caused the same SSLError, so I downloaded the wheel packages and forced a
local upgrade - to no help.

After that I deleted the whole Python installation directory and replaced
it with a backup copy of a known-working version from a month ago. The
error kept appearing.

I then uninstalled Python completely, rebooted and installed Python 3.9.1,
downloaded from python.org.

The first to commands to issue were:
C:\Users\Carlos>python -V
Python 3.9.1

C:\Users\Carlos>pip list
PackageVersion
-- ---
pip20.2.3
setuptools 49.2.1
Could not fetch URL https://pypi.org/simple/pip/: There was a problem
confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org',
port=443): Max retries exceeded with url: /simple/pip/ (Caused by
SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed: unable to get local issuer certificate
(_ssl.c:1123)'))) - skipping

So there went my theory of the requests module... It already happens with
the Python base installation (urllib3?). Obviously a freshly installed
Python with no modifications and no other modules installed fails to verify
each and every certificate.

I can rule out network errors as other machines using the same Internet
breakout work just fine with the same code. And it happens using a web
proxy and using no web proxy at all.

Aunty Google always tells me to set "verify=False" but that can't be the
solution for *this* problem. Unfortunately I have no idea where to look
next - not with a fresh installation failing.

Does anybody have a useful pointer for me? TIA!

Regards,
Carlos
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: subprocess check_output

2016-01-02 Thread Carlos Barera
Turns out it wasn't running against the server I thought it was.
Apologies for the spam.

-carlos

On Wed, Dec 30, 2015 at 11:02 PM Cameron Simpson  wrote:

> On 30Dec2015 21:14, Carlos Barera  wrote:
> >Trying to run a specific command (ibstat)  installed in /usr/sbin on an
> >Ubuntu 15.04 machine, using subprocess.check_output and getting "/bin/sh:
> >/usr/sbin/ibstat: No such file or directory"
> >
> >I tried the following:
> >- running the command providing full path
> >- running with executable=bash
> >- running with (['/bin/bash', '-c' , "/usr/sbin/ibstat"])
> >
> >Nothing worked ...
>
> The first check is to run the command from a shell. Does it work? Does
> "which
> ibstat" confirm that the command exist at that path? Is it even installed?
>
> If it does, you should be able to run it directly without using a shell:
>
>   subprocess.call(['/usr/sbin/ibstat'], ...)
>
> or just plain ['ibstat']. Also remember that using "sh -c blah" or "bash -c
> blah" is subject to all the same security issues that subprocess'
> "shell=True"
> parameter is, and that it should be avoided without special reason.
>
> Finally, remember to drop the common Linux fetish with "bash". Just use
> "sh";
> on many systems it _is_ bash, but it will provide portable use. The bash is
> just a partiular Bourne style shell, not installed everywhere, and rarely
> of
> any special benefit for scripts over the system /bin/sh (which _every_ UNIX
> system has).
>
> If none of this solves your problem, please reply including the failing
> code
> and a transcript of the failure output.
>
> Thanks,
> Cameron Simpson 
>
-- 
https://mail.python.org/mailman/listinfo/python-list


subprocess check_output

2015-12-30 Thread Carlos Barera
Hi,

Trying to run a specific command (ibstat)  installed in /usr/sbin on an
Ubuntu 15.04 machine, using subprocess.check_output and getting "/bin/sh:
/usr/sbin/ibstat: No such file or directory"

I tried the following:
- running the command providing full path
- running with executable=bash
- running with (['/bin/bash', '-c' , "/usr/sbin/ibstat"])

Nothing worked ...

Any idea?

-carlos
-- 
https://mail.python.org/mailman/listinfo/python-list


My last message(...)

2014-06-11 Thread Carlos Anselmo Dias

Hi ...

So I'm not receiving more emails from Python mailing list or 
posting/sending more messages ...


I'm keeping your emails that I received to contact all of you when it 
will be time to step forward ...


If you want you can send me your cv or one small text to 
j...@premium-sponsor.com ... You can use my email too ...


If what I wrote is not enough(describing the projects,etc), to be honest 
I wouldn't write anything else besides that ...


I'm not really interested in what you did, I'm interested in what you're 
capable of doing and what you're capable of doing is integrated in one 
team of Python programmers to organize, manage, develop, implement 
everything related with ...


My messages are with the subject 'python team(...)' + 'First time I 
looked at Python was(...)'


(...)

Best regards,
Carlos
--
https://mail.python.org/mailman/listinfo/python-list


Re: First time I looked at Python was(...)

2014-06-11 Thread Carlos Anselmo Dias


On 06/11/2014 05:42 AM, Michael Torrie wrote:

On 06/10/2014 03:15 PM, Carlos Anselmo Dias wrote:

Hi...

I don't understand the 'problem' of several people ...

I created one post because I've several projects, I'm looking for one
team of experienced experts in Python to work in my projects ... asap
... I provided one script(I'm not one expert in Python) to help people
think and described the projects(briefly) ...

Your e-mails are so difficult to parse and understand that your message
was lost in the noise.  In fact this is the first post of yours that I
can even partly understand.  Your unconventional and incorrect sentence
structure makes it very hard to understand you.  I doubt most people
reading your e-mails can even tell what you want and why you are writing.


People start calling me troll,etc-> Are this people not insane? And I
don't understand their paranoia ...

After you post a dozen undecipherable posts (literally I cannot
understand them), and keep posting undecipherable, strange sentence
fragments, surely it's understandable why people are frustrated and
annoyed.  You excuse yourself by saying English isn't your first
language.  Well, we say, please correct your sentence structure, speak
simply and clearly, don't get upset, and you'll get people responding to
you positively.


Those who call me troll ... look at the mirror and criticize what I
wrote if you're capable of ... with sense and reasoning ... not like
someone absurd who is not capable of and tries to demonstrate that is
the greatest ... these people should get real ...

I'd criticize what you wrote if I could understand it.  I for one still
do not know what these "projects" of yours are, or what kind of help you
desire.  If you need to hire programming assistance, just say so.  State
your terms of hire.  There are freelancers on this list.  If you're
looking for free help, you might get some of that, especially if the
projects themselves will be open source.


The www,etc is full of ridiculous people with ridiculous ideas/projects 
...considering themselves the greatest,etc and are nothing but a bunch 
of absurd ... ones worst than the others ... "SHIT to be more precise!"


Copy/paste of 2 emails I sent (...)


---1st---

Hi ...

Good morning ...

What a confusion/headache(...)

I'm waiting for traffic of search engines in one subsection of one main 
section to step forward with the organization of what I described 
briefly I'd write ...



Like I explained there are 500 millions of thumbs to import and 20 
million of thumbs every month in that sub-section ...


I don't need assistance, I'll need one team of programmers to work ...

I'm not writing more posts/emails.

(...)

Best regards,
Carlos

---2nd 

If I was thinking that people were capable of understanding what's about 
... exceeding the barrier of databases, billions of files indexed,etc 
... look at that like client apis ... with logs, advertisement, etc 
integrated ... in main-sections with sub-sections ... with control of 
cache, web-services, etc ... I tried to resume it briefly and it's about 
what I described here ...


I want that people (can) think about it ... like I wrote ... when the 
sub-section of one main section starts receiving traffic from search 
engines ... it will be possible to think in other main sections, 
organize everything,etc ...


(...)

Best regards,
Carlos
--
https://mail.python.org/mailman/listinfo/python-list


Re: First time I looked at Python was(...)

2014-06-11 Thread Carlos Anselmo Dias


On 06/11/2014 09:34 AM, alister wrote:

On Tue, 10 Jun 2014 22:15:29 +0100, Carlos Anselmo Dias wrote:


Hi...

I don't understand the 'problem' of several people ...

I created one post because I've several projects, I'm looking for one
team of experienced experts in Python to work in my projects ... asap
... I provided one script(I'm not one expert in Python) to help people
think and described the projects(briefly) ...

Congratulations
This is the first time in this whole thread that you have stated you are
asking for programmers to assist with a project.

Thank you  this is the missing piece of information that we have become
fed-up been asking for.

This is not a recruiting forum so you would be better of asking elsewhere.
when you do please help yourself by not only stating that you are trying
to recruit programmer but also give some indication on the scope of the
project







Hi ...

Good morning ...

What a confusion/headache(...)

I'm waiting for traffic of search engines in one subsection of one main 
section to step forward with the organization of what I described 
briefly I'd write ...



Like I explained there are 500 millions of thumbs to import and 20 
million of thumbs every month in that sub-section ...


I don't need assistance, I'll need one team of programmers to work ...

I'm not writing more posts/emails.

(...)

Best regards,
Carlos
--
https://mail.python.org/mailman/listinfo/python-list


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias


On 06/10/2014 10:32 PM, Mark H Harris wrote:

On 6/10/14 3:41 PM, leo kirotawa wrote:


Guys I'm from Brazil too, and I'm ashamed for this troll.


Don't feed the troll bot.

OTOH, it might be fun to feed it some weird subject|predicate phrases 
to see what it does with them.


Bots eat bananas because bouncing on berries becomes beenie baby bologna!

;-)



If I was thinking that people were capable of understanding what's about 
... exceeding the barrier of databases, billions of files indexed,etc 
... look at that like client apis ... with logs, advertisement, etc 
integrated ... in main-sections with sub-sections ... with control of 
cache, web-services, etc ... I tried to resume it briefly and it's about 
what I described here ...


I want that people (can) think about it ... like I wrote ... when the 
sub-section of one main section starts receiving traffic from search 
engines ... it will be possible to think in other main sections, 
organize everything,etc ...


(...)

Best regards,
Carlos
--
https://mail.python.org/mailman/listinfo/python-list


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias

Hi...

I don't understand the 'problem' of several people ...

I created one post because I've several projects, I'm looking for one 
team of experienced experts in Python to work in my projects ... asap 
... I provided one script(I'm not one expert in Python) to help people 
think and described the projects(briefly) ...


People start calling me troll,etc-> Are this people not insane? And I 
don't understand their paranoia ...


Those who call me troll ... look at the mirror and criticize what I 
wrote if you're capable of ... with sense and reasoning ... not like 
someone absurd who is not capable of and tries to demonstrate that is 
the greatest ... these people should get real ...


Regards,
Carlos



On 06/10/2014 09:53 PM, Larry Martell wrote:

On Tue, Jun 10, 2014 at 4:51 PM, Mark Lawrence  wrote:

On 10/06/2014 21:41, leo kirotawa wrote:

Gzz,

Guys I'm from Brazil too, and I'm ashamed for this troll. And sorry by
his terrible taste in music.
Wondering now about moderation , have we one?


No, otherwise the resident unicode expert would have been booted long ago.

gmail tagged this message with:

Be careful with this message. It contains content that's typically
used to steal personal information.


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


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias

Troll is you ...

Get real ...

On 06/10/2014 09:41 PM, leo kirotawa wrote:

Gzz,

Guys I'm from Brazil too, and I'm ashamed for this troll. And sorry by
his terrible taste in music.
Wondering now about moderation , have we one?

[]'s

On Tue, Jun 10, 2014 at 5:07 PM, Carlos Anselmo Dias
 wrote:


Terry Jan Reedy ...

https://www.youtube.com/watch?v=HbGHq2aUXDU (yhis one is portuguese ...

I'm someone who did very probably more webpages than you in your entire life
...

Do you exist?





On 06/10/2014 08:57 PM, Terry Reedy wrote:

On 6/10/2014 1:19 PM, Carlos Anselmo Dias wrote:

Let me finish with this ...

https://www.youtube.com/watch?


Yes, do finish with that. People, please quit responding to 'carlos' from
premium-sponsor.com (which apparently exists but has no web page).


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





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


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias

The end-> for replies like this one ...

As far as I'm concerned and I'm not ... we'll talk about what I wrote 
when it will be time too ...


There we'll see who has the possibility of participating ... and I'm not 
excluding people ... and certainly not those who answered like this ...


I can't wait to see your capacity to determine if your brains make sense 
or not ...


As far as I'm concerned ... and when you read what I wrote ... I'm 
certainly less worried than you ...



Best regards,
Carlos


On 06/10/2014 09:07 PM, Carlos Anselmo Dias wrote:



Terry Jan Reedy ...

https://www.youtube.com/watch?v=HbGHq2aUXDU (yhis one is portuguese ...

I'm someone who did very probably more webpages than you in your 
entire life ...


Do you exist?




On 06/10/2014 08:57 PM, Terry Reedy wrote:

On 6/10/2014 1:19 PM, Carlos Anselmo Dias wrote:

Let me finish with this ...

https://www.youtube.com/watch?


Yes, do finish with that. People, please quit responding to 'carlos' 
from premium-sponsor.com (which apparently exists but has no web page).






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


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias



Terry Jan Reedy ...

https://www.youtube.com/watch?v=HbGHq2aUXDU (yhis one is portuguese ...

I'm someone who did very probably more webpages than you in your entire 
life ...


Do you exist?




On 06/10/2014 08:57 PM, Terry Reedy wrote:

On 6/10/2014 1:19 PM, Carlos Anselmo Dias wrote:

Let me finish with this ...

https://www.youtube.com/watch?


Yes, do finish with that. People, please quit responding to 'carlos' 
from premium-sponsor.com (which apparently exists but has no web page).




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


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias

Let me finish with this ...

https://www.youtube.com/watch?v=M79e5ji-53w

I'm waiting for traffic of search engines to start organizing what must 
be organized ...


I've already one main section more or less organized ... and that main 
section will allow to develop the other sections ...


One of the first things we'll be thinking about it's the structure of 
the main sections, development of ...towards the concept of client apis ...


In one of the main sections(the one I'm describing) ... one sub section 
has something like 500 millions of thumbs to be processed/imported ... 
with 20 millions of new thumbs every month ... 1 million of records are 
+- 20 million of thumbs ...


(...)

Best regards,
Carlos


On 06/10/2014 04:34 PM, Carlos Anselmo Dias wrote:


On 06/10/2014 03:57 PM, Søren wrote:



Hi ...

That's great and you're one person with enough /Intelligence/ to 
participate in the projects I described you.
You can think about the solution, logs , how the information is 
organized,etc.

"You're certainly one of the persons!"

I'm not writing more ...







I have been on this mail group for a relatively short time and I'm 
chocked to see the amount of needless posts in general. Is it too 
much to ask for some mail-group discipline?


Carlos and some others, please phrase your questions or requests 
concisely and clearly. Making a post that initiates a flood of 
questions and discussions is clearly inefficient, specially if it is 
beside the core essence of a Python language group and probably 
besides the poster's own goal too. It wastes a lot peoples time and 
it devalues the usefulness of the mail group.


There was some entertainment in it though, but for that purpose I 
seek other sources.






Hi Soren ...

I'm looking for people very experienced in the Python Programming 
Language to develop/implement the projects I described briefly and not 
knowing Python, I followed my own logic and even providing one script 
to help people understand and somehow think about it (...)


I don't have the intention to disturb ...

Best Regards,
Carlos





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


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias


On 06/10/2014 03:57 PM, Søren wrote:



Hi ...

That's great and you're one person with enough /Intelligence/ to 
participate in the projects I described you.
You can think about the solution, logs , how the information is 
organized,etc.

"You're certainly one of the persons!"

I'm not writing more ...







I have been on this mail group for a relatively short time and I'm 
chocked to see the amount of needless posts in general. Is it too much 
to ask for some mail-group discipline?


Carlos and some others, please phrase your questions or requests 
concisely and clearly. Making a post that initiates a flood of 
questions and discussions is clearly inefficient, specially if it is 
beside the core essence of a Python language group and probably 
besides the poster's own goal too. It wastes a lot peoples time and it 
devalues the usefulness of the mail group.


There was some entertainment in it though, but for that purpose I seek 
other sources.






Hi Soren ...

I'm looking for people very experienced in the Python Programming 
Language to develop/implement the projects I described briefly and not 
knowing Python, I followed my own logic and even providing one script to 
help people understand and somehow think about it (...)


I don't have the intention to disturb ...

Best Regards,
Carlos



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


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias


On 06/10/2014 02:38 PM, Rustom Mody wrote:

On Tuesday, June 10, 2014 6:55:27 PM UTC+5:30, Carlos Anselmo Dias wrote:



https://www.youtube.com/watch?v=N1EwYpfUFQU (...)


http://huntingtonleadership.com/blog/entry/communication-is-a-two-way-street.html



Making part of the team ...

https://www.youtube.com/watch?v=oFJIenHfjK0

Are people capable(...) with the will to drive one ferrari/porsche/etc?

Regards,
Carlos
--
https://mail.python.org/mailman/listinfo/python-list


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias


On 06/10/2014 03:39 PM, Mark H Harris wrote:

On 6/9/14 3:54 PM, Carlos Anselmo Dias wrote:

Hi ...

I'm finishing my messages with this ...

The first time I looked into Python was +- 10 years ago ... and in the
last 10 years I did not spent more than 30 minutes looking at ... but I
like it ... it's easy to read ... even if I'm not familiar with the
syntax of ...

When you look at the script I provided you in my first post ... if
you're capable of thinking about it ... yoy can see countless
terabytes/petabytes of information indexed .. it doesn't matter what
you're daling with ...it might be millions of databases or billions of
files ...

I spent the last two days thinking about what I want to implement(...)
... looking at your posts ... thinking in the wideness and in the
particularity of the detail ...

I really consider that Python is one good option(probably the best) ...
the programmers need less lines of code to achieve what must be achieved
... and this is one great advantage ...

If you read what I wrote in my first post ->'Python team(...)' and if
somehow you're capable of visualize that integrated with logs ,etc ...
advertisement included, manipulation of the search string in the client
apis, etc ... you're very probably very capable of ...

(...)

Best regards,
Carlos


This is the funniest troll I have see in a while... and a bot to boot!

~cool



Mark , I'd write that the answers to my topic were not the funniest 
troll I've seen and what a bot to boot!


Being Portuguese, I'm sharing with you Brazilian music!

https://www.youtube.com/watch?v=ibrZvsRyyQI

Regards,
Carlos
--
https://mail.python.org/mailman/listinfo/python-list


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias


On 06/10/2014 04:09 PM, Shiyao Ma wrote:
I wonder if it's opensourced. I am kinda interested in its 
implementation. On the whole, the performance is rather good.



2014-06-10 22:39 GMT+08:00 Mark H Harris <mailto:harrismh...@gmail.com>>:


On 6/9/14 3:54 PM, Carlos Anselmo Dias wrote:

Hi ...

I'm finishing my messages with this ...

The first time I looked into Python was +- 10 years ago ...
and in the
last 10 years I did not spent more than 30 minutes looking at
... but I
like it ... it's easy to read ... even if I'm not familiar
with the
syntax of ...

When you look at the script I provided you in my first post ... if
you're capable of thinking about it ... yoy can see countless
terabytes/petabytes of information indexed .. it doesn't
matter what
you're daling with ...it might be millions of databases or
billions of
files ...

I spent the last two days thinking about what I want to
implement(...)
... looking at your posts ... thinking in the wideness and in the
particularity of the detail ...

I really consider that Python is one good option(probably the
best) ...
the programmers need less lines of code to achieve what must
be achieved
... and this is one great advantage ...

If you read what I wrote in my first post ->'Python team(...)'
and if
somehow you're capable of visualize that integrated with logs
,etc ...
advertisement included, manipulation of the search string in
the client
apis, etc ... you're very probably very capable of ...

(...)

Best regards,
Carlos


This is the funniest troll I have see in a while... and a bot to boot!

~cool

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





--

http://introo.me?


If you're asking me if you can use the script I did ... sure, you can 
use it, do whatever you want with it, change it,etc ... it was only one 
example to exceed the freeze of 'Big Data ,etc (...)' ... you can look 
at it and think about n millions of databases, n billions of files,etc 
... and can be easily converted in any language ...





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


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias


On 06/10/2014 03:24 PM, Rustom Mody wrote:

On Tuesday, June 10, 2014 7:48:05 PM UTC+5:30, Carlos Anselmo Dias wrote:

On 06/10/2014 03:07 PM, Ned Batchelder wrote:

On 6/10/14 9:59 AM, Carlos Anselmo Dias wrote:

On 06/10/2014 02:47 PM, Grant Edwards wrote:

On 2014-06-10, Carlos Anselmo Dias  wrote:

English is not my maternal language ...

And stringing together a bunch of phrases with elipses without every
completing a sentence is the way things are done in your native
language?
I doubt it.

Hi ...
Those are my phrases ... somehow describe the projects(briefly) ... I
even provided you/people(...) one script to help exceed 'the freeze' of
thinking about n millions of tables or billions of files(for example)
... I even explained the context ...
If that's not enough ... for those capable I guess it's enough to start
the necessary will to do it ...
If you want me to place phrases without elipses and completing one
sentence, 'I'm not there' ...
When you talk naturally about things(and that kind of things) sentences
and elipses are natural , are one consequence of your thoughts ... you
just adapt your thoughts to people capable of understading, those who
are not capable, you avoid the issues ...
(...)
Best regards,
Carlos

Carlos, you've been told by a number of people that we don't know what
you are talking about.  Dots don't convey any meaning.  Write
complete, clear sentences that explain what you want.
I don't know what you are trying to accomplish here.  I can tell you
what you are accomplishing: you're convincing a number of people that
you can't put your thoughts into coherent order.

Hi...
OK, therefore if my will to resume briefly can't accomplish your
capacity to understand we have one problem of communication ...
If your capacity to understand is one consequence of ellipses or
sentences not completed you'll have the possibility to understand better
if you've the will to do it ...

You misunderstand...
...ALl ... we understand... are... the...
...
...
ellipses

For the rest...
...
...

Its just garbage


Don't panic or don't loose too much time thinking about what I wrote ...
think about it in your head

Dont fear on our account



... if you have the will to ...

Unfortunately there you have failed.
You have not evoked in anyone a wish to be enthusiastic about what you
are enthusiastic...
... ... ...
Because...
... ... ... ... ...
You... refuse...

To communicate


Hi ...

That's great and you're one person with enough /Intelligence/ to 
participate in the projects I described you.
You can think about the solution, logs , how the information is 
organized,etc.

"You're certainly one of the persons!"

I'm not writing more ...

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


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias


On 06/10/2014 03:07 PM, Ned Batchelder wrote:

On 6/10/14 9:59 AM, Carlos Anselmo Dias wrote:


On 06/10/2014 02:47 PM, Grant Edwards wrote:

On 2014-06-10, Carlos Anselmo Dias  wrote:


English is not my maternal language ...

And stringing together a bunch of phrases with elipses without every
completing a sentence is the way things are done in your native
language?

I doubt it.



Hi ...

Those are my phrases ... somehow describe the projects(briefly) ... I
even provided you/people(...) one script to help exceed 'the freeze' of
thinking about n millions of tables or billions of files(for example)
... I even explained the context ...

If that's not enough ... for those capable I guess it's enough to start
the necessary will to do it ...

If you want me to place phrases without elipses and completing one
sentence, 'I'm not there' ...

When you talk naturally about things(and that kind of things) sentences
and elipses are natural , are one consequence of your thoughts ... you
just adapt your thoughts to people capable of understading, those who
are not capable, you avoid the issues ...

(...)

Best regards,
Carlos



Carlos, you've been told by a number of people that we don't know what 
you are talking about.  Dots don't convey any meaning.  Write 
complete, clear sentences that explain what you want.


I don't know what you are trying to accomplish here.  I can tell you 
what you are accomplishing: you're convincing a number of people that 
you can't put your thoughts into coherent order.



Hi...

OK, therefore if my will to resume briefly can't accomplish your 
capacity to understand we have one problem of communication ...


If your capacity to understand is one consequence of ellipses or 
sentences not completed you'll have the possibility to understand better 
if you've the will to do it ...


Don't panic or don't loose too much time thinking about what I wrote ... 
think about it in your head ... if you have the will to ...


Best Regards,
Carlos
--
https://mail.python.org/mailman/listinfo/python-list


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias


On 06/10/2014 02:47 PM, Grant Edwards wrote:

On 2014-06-10, Carlos Anselmo Dias  wrote:


English is not my maternal language ...

And stringing together a bunch of phrases with elipses without every
completing a sentence is the way things are done in your native
language?

I doubt it.



Hi ...

Those are my phrases ... somehow describe the projects(briefly) ... I 
even provided you/people(...) one script to help exceed 'the freeze' of 
thinking about n millions of tables or billions of files(for example) 
... I even explained the context ...


If that's not enough ... for those capable I guess it's enough to start 
the necessary will to do it ...


If you want me to place phrases without elipses and completing one 
sentence, 'I'm not there' ...


When you talk naturally about things(and that kind of things) sentences 
and elipses are natural , are one consequence of your thoughts ... you 
just adapt your thoughts to people capable of understading, those who 
are not capable, you avoid the issues ...


(...)

Best regards,
Carlos

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


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias


On 06/10/2014 02:16 PM, alister wrote:

On Tue, 10 Jun 2014 14:09:52 +0100, Carlos Anselmo Dias wrote:

Hi ...

English is not my maternal language ... I wrote what I consider the
most appropriated taking in consideration that the summary of the
description might be enough to help people think about it ...
If those were the main issues of the project(s) ... we would talk
about that naturally ...

Not understanding that(that way) to think about it naturally ... it
won't be easy ...

I don't pretend to disturb you/people ...

(...)

Do you understand portuguese, french or spanish beyong the english you
don'y understand?

https://www.youtube.com/watch?v=N1EwYpfUFQU (...)

Best regards,
Carlos

The English I can work with there is just no context for me to know
what you are actually asking




Hi ...

Context ... try to consider all the social networds, ecommerce
websites,etc ... and each defined client api ... using vouchers,
solutions of advertisement, etc ...

(...)

Best regards,
Carlos

Context ... you have not provided any.

I can only assume you are a bott & you have failed the truing test with
this one






Hi ...

Meaning of context->the circumstances that form the setting for an 
event, statement, or idea, and in terms of which it can be fully 
understood and assessed.


()

https://www.youtube.com/watch?v=N1EwYpfUFQU (...)

Regards,
Carlos


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


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias


On 06/10/2014 01:47 PM, alister wrote:

On Tue, 10 Jun 2014 13:39:50 +0100, Carlos Anselmo Dias wrote:


On 06/10/2014 01:10 PM, Ben Finney wrote:

Carlos Anselmo Dias  writes:


Following my post Copy/paste of python team(...) + script
attachment(...)

I find those screeds very difficult to read. One significant
improvement would be to write sentences *as* sentences, without
trailing them away with an ellipsis.

Then it would be clearer what your individual thoughts are, instead of
the undifferentiated mush that it currently seems to be from your
messages so far.


Hi ...

English is not my maternal language ... I wrote what I consider the most
appropriated taking in consideration that the summary of the description
might be enough to help people think about it ...
If those were the main issues of the project(s) ... we would talk about
that naturally ...

Not understanding that(that way) to think about it naturally ... it
won't be easy ...

I don't pretend to disturb you/people ...

(...)

Do you understand portuguese, french or spanish beyong the english you
don'y understand?

https://www.youtube.com/watch?v=N1EwYpfUFQU (...)

Best regards,
Carlos

The English I can work with
there is just no context for me to know what you are actually asking




Hi ...

Context ... try to consider all the social networds, ecommerce 
websites,etc ... and each defined client api ... using vouchers, 
solutions of advertisement, etc ...


(...)

Best regards,
Carlos
--
https://mail.python.org/mailman/listinfo/python-list


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias


On 06/10/2014 01:10 PM, Ben Finney wrote:

Carlos Anselmo Dias  writes:


Following my post Copy/paste of python team(...) + script attachment(...)

I find those screeds very difficult to read. One significant improvement
would be to write sentences *as* sentences, without trailing them away
with an ellipsis.

Then it would be clearer what your individual thoughts are, instead of
the undifferentiated mush that it currently seems to be from your
messages so far.


Hi ...

English is not my maternal language ... I wrote what I consider the most 
appropriated taking in consideration that the summary of the description 
might be enough to help people think about it ...
If those were the main issues of the project(s) ... we would talk about 
that naturally ...


Not understanding that(that way) to think about it naturally ... it 
won't be easy ...


I don't pretend to disturb you/people ...

(...)

Do you understand portuguese, french or spanish beyong the english you 
don'y understand?


https://www.youtube.com/watch?v=N1EwYpfUFQU (...)

Best regards,
Carlos


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


Re: First time I looked at Python was(...)

2014-06-10 Thread Carlos Anselmo Dias

On 06/10/2014 11:14 AM, alister wrote:

On Mon, 09 Jun 2014 21:54:25 +0100, Carlos Anselmo Dias wrote:


Hi ...

I'm finishing my messages with this ...

The first time I looked into Python was +- 10 years ago ... and in the
last 10 years I did not spent more than 30 minutes looking at ... but I
like it ... it's easy to read ... even if I'm not familiar with the
syntax of ...

When you look at the script I provided you in my first post ... if
you're capable of thinking about it ... yoy can see countless
terabytes/petabytes of information indexed .. it doesn't matter what
you're daling with ...it might be millions of databases or billions of
files ...

I spent the last two days thinking about what I want to implement(...)
... looking at your posts ... thinking in the wideness and in the
particularity of the detail ...

I really consider that Python is one good option(probably the best) ...
the programmers need less lines of code to achieve what must be achieved
... and this is one great advantage ...

If you read what I wrote in my first post ->'Python team(...)' and if
somehow you're capable of visualize that integrated with logs ,etc ...
advertisement included, manipulation of the search string in the client
apis, etc ... you're very probably very capable of ...

(...)

Best regards,
Carlos

I'm sorry
What does all this relate to?






Following my post Copy/paste of python team(...) + script attachment(...)

Hi ...

Here I'm seeking for my team of developers/programmers in Python ... I'd 
like to ask you to provide me contacts of people interested ...


I'm sending you one script attachment(...) ...

I'll manage them naturally  knowing that the detail is wide ... 
programming languages, Databases, Shell Script, Linux, etc ... and the 
complexity is present ... main sections, sub sections, client apis, etc ...


(...)

If this was poetry (...) Big Data, web services, cache's management with 
perfection and remote subtlety, Hashed Systems, Client Apis, Web 
Analytics, Complex Logs, Management(Manipulation) of the search string, 
etc ... you'd be one poet(...)
"A poet's work can be literal, meaning that his work is derived from a 
specific event, or metaphorical, meaning that his work can take on many 
meanings and forms. Poets have existed since antiquity, in nearly all 
languages, and have produced works that vary greatly in different 
cultures and time periods."


*Final customer/consumer/client(...)*
Projects technically different I'd write even in the particularity but 
naturally similar in the concept of how the information should be 
organized towards the concept of client api ,etc ... identification of 
(including the user) in different contexts ... ecommerce ,etc ... with 
focus in the proximity when available ...


*Registered Clients/Bookings/Vouchers of Discount/etc (...)*
Each client api(...) has the possibility of managing the 
bookings/vouchers of discount I'd write ... even each registered client 
is allowed to use the vouchers of discount taking in consideration the 
limits(technical, localization/geographics,etc) or no limits of 
it's(voucher of discount) usage ...
And here appears the concept of white-label I'd write ... and this will 
allow to track efficiently and towards analytical methods all the 
business models derived from each client api defined ...
The concept is wide, the examples are countless ... even the 
possibilities ... but the technical complexity remains ... we'll try to 
make it simple ...


*Segmented Replication Networks -> SRN (...)*
The SRN(Segmented Replication Network) ... basically are trustable 
machines that are placed in the client(cloud environment,etc) ... that 
will allow to update the masters networks(...) ... and to trigger the 
execution(exponentially) of processes (through the SRN) of all the 
necessary updates of the particularity of management of the 
circumstances ...
This might look complicated or somehow difficult to understand, etc ... 
well ... it's my summarized explanation ...


*Management(manipulation) of the search string(...)*
Basically it's the solution that provides the best answer taking in 
consideration what people/enterprises are seeking (...) ... integrated 
in the concept of client api(...) ... with one scope/range of 
multi-device ... etc ...
Assuming that each client api has the possibility to choose what fits 
better in it's business(...) and the final costumer/consumer has always 
the final decision taking in consideration the available possibilities ...

Trying to summarize(...)

*Setting the focus(...)*
We'll set our focus in the 'Personalized Location with(/)in Mobility' 
... integration in all the maps worldwide ... and the 
problematic/management of 'circumstances' with perfection(...) ... etc 
... example: someone driving by car,etc looking fo

First time I looked at Python was(...)

2014-06-09 Thread Carlos Anselmo Dias

Hi ...

I'm finishing my messages with this ...

The first time I looked into Python was +- 10 years ago ... and in the 
last 10 years I did not spent more than 30 minutes looking at ... but I 
like it ... it's easy to read ... even if I'm not familiar with the 
syntax of ...


When you look at the script I provided you in my first post ... if 
you're capable of thinking about it ... yoy can see countless 
terabytes/petabytes of information indexed .. it doesn't matter what 
you're daling with ...it might be millions of databases or billions of 
files ...


I spent the last two days thinking about what I want to implement(...) 
... looking at your posts ... thinking in the wideness and in the 
particularity of the detail ...


I really consider that Python is one good option(probably the best) ... 
the programmers need less lines of code to achieve what must be achieved 
... and this is one great advantage ...


If you read what I wrote in my first post ->'Python team(...)' and if 
somehow you're capable of visualize that integrated with logs ,etc ... 
advertisement included, manipulation of the search string in the client 
apis, etc ... you're very probably very capable of ...


(...)

Best regards,
Carlos



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


Re: embedding ipython kernel in a thread

2014-06-09 Thread Carlos Anselmo Dias


On 06/09/2014 04:07 PM, Carlos Anselmo Dias wrote:


On 06/09/2014 03:55 PM, Gelonida N wrote:

Not sure what you are trying to tell me with attached PHP code.



Hi ...

Nothing important I'd write for what you're seeking ...

I'm not one Python expert ... just reading fast what you wrote ... 
it's certainly one interesting issue if you can control that looking 
at n machines (...) ... depending on the scope and 'return back' to 
execute what should be executed I'd write ...


Instead of looking to one single machine look at n machines(...)

Regards,
Carlos


Let me add this to finish ...

If you think about your example and you consider that it could be used 
for example in one sort of cache management with remote subtlety ... or 
whatever ...


If the system was hashed(...) ... and you need to delete 
dependencies(...) ... if the dependencies were in different machines 
considering that one dependency can be as simple as one 
serialized/compressed file with information ...


Than without thinking too much what you're doing could be used to do 
something like that ... and exponentially ... you'd control n machines 
... and all the dependencies ...


I don't know if you understand me ... english is not my maternal 
language ...


I'm not adding more comments to this issue ...

Best regards,
Carlos

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


Re: embedding ipython kernel in a thread

2014-06-09 Thread Carlos Anselmo Dias


On 06/09/2014 03:55 PM, Gelonida N wrote:

Not sure what you are trying to tell me with attached PHP code.



Hi ...

Nothing important I'd write for what you're seeking ...

I'm not one Python expert ... just reading fast what you wrote ... it's 
certainly one interesting issue if you can control that looking at n 
machines (...) ... depending on the scope and 'return back' to execute 
what should be executed I'd write ...


Instead of looking to one single machine look at n machines(...)

Regards,
Carlos
--
https://mail.python.org/mailman/listinfo/python-list


Re: embedding ipython kernel in a thread

2014-06-09 Thread Carlos Anselmo Dias


On 06/09/2014 01:59 PM, Gelonida N wrote:

Hi,

I'd like to embed an ipython kernel in an appliction, such, that I can 
use


ipython console --existing kernel-.json lateron to connect to it 
and to look at some values



Due to various reason I don not want to start it in the main thread.

If you look at following example you will see, that I can start an 
ipython kernel and

connect to it as long as I start it in the main thread.

as soon as I start the kernel in another thread my ipython client 
prints  the first few lines and a welcome text, but

no prompt is shown.

Does anybody know a way o how to start IPython outside of the main 
thread?



Below code trying to show a working setup with ipython kernel in the 
main thread and failing if ipython kernel is started from another thread


#!/usr/bin/env python
import os, time, threading
from IPython import embed_kernel

cnt  = { 'value' : 0 }
def run_ip_kernel():
embed_kernel(local_ns={ 'cnt': cnt})

def example_thread():
while True:
cnt['value'] += 1
print(cnt['value'])
time.sleep(5)

main_thread = run_ip_kernel
other_thread = example_thread

# if I uncomment the next two lines, then I can no more
# execute my interactive IPython shell
#main_thread = example_thread
#other_thread = run_ip_kernel

print("now you can try to connect to this shell with:")
print("ipython console --existing kernel-%d.json" % os.getpid())
threading.Thread(target=other_thread).start()
main_thread()




Whatever you're trying to do(...) ... if you look at the script I 
provide you in attach and if you can think how usefull it would be to 
control exponencially what you need ... that's certainly one best 
approach ...


https://www.youtube.com/watch?v=p7CaiWxKYBo

Regards,
Carlos
$id_flux["idsponsor"]=2;
//  $flux_treat=array(397,382,769,770);
//$flux_treat=array(397,382);
$flux_treat=array(521,6876);
$textemailmessage="";
include("../../conf.inc.php");



if(is_array($flux_treat)){
foreach($flux_treat as $kfluxtotreat => $vfluxtotreat){
//echo $kfluxtreatsubtype."";

if(!empty($array_language_flux_default[$vfluxtotreat])){

$id_language_default=$array_language_flux_default[$vfluxtotreat];
}

$info_page_records=explode("|",$array_number_records_per_page_start_flux[$vfluxtotreat]);
 
if(is_array($id_flux["detail"][$vfluxtotreat])){

foreach($id_flux["detail"][$vfluxtotreat]["Sponsor"]["url"]["information"]["xml"]
 as $kfluxtreatsubtype=>$vfluxtreatsubtype){
//control if execution is allowed by 
kfluxtreatsubtype and add exit
echo $kfluxtreatsubtype."";

if(check_lock_control_($kfluxtreatsubtype,"start")=="ok"){


$_ids_types_xml_cache_=$_ids_types_xml_[$kfluxtreatsubtype];

$_time_of_cache_flux_subtype=$_ids_types_xml_time_cache_[$kfluxtreatsubtype];
//echo "time of cache 
".$_time_of_cache_flux_subtype."";

if($kfluxtreatsubtype 
=="xml-movies"){


$number_records_or_end_position=$info_page_records[0];
$counterfilter=0;

foreach($id_flux["detail"][$vfluxtotreat]["languages"] as $klg => $vlg){

foreach($ids_cats_sponsor[$vfluxtotreat] as $kcat => $vcat){
 
$cat_convereted_cache=$vcat;
 
$pagenumb=$limitepaginas=$info_page_records[1];



while ($pagenumb<=$limitepaginas){


$replacements=array($id_flux["idsponsorfk"],$id_flux["loginsponsor"],$id_flux["passwordsponsor"],$kcat,"{idcatsonsponsor}",$pagenumb,$vlg,$nu

Re: OT: This Swift thing

2014-06-08 Thread Carlos Anselmo Dias


On 06/08/2014 06:14 PM, Gene Heskett wrote:

On Sunday 08 June 2014 12:09:41 Roy Smith did opine
And Gene did reply:

In article ,

  Gene Heskett  wrote:

You may want to reconsider that statement after the first fan failure
in your mini.  We've had quite a few Mac's in the tv station, as
video servers, graphics composers, etc.  The airflow for cooling in
them is controlled by baffles to get the maximum air flow past the
hot spots, but a fan failure usually cooks the whole thing.  And at
that time, Macs warranty did not cover collateral damage from a fan
failure. Cooked cpu? Too bad, so sad.

The CPU (or maybe I'm thinking of the video card?) in the Dell has some
huge heat sink, a bunch of funky ductwork, and a dedicated fan.  I
suspect if that fan were to fail, the chip it's cooling would fry
itself pretty quickly too.

Probably.  I have lost several nvidia video cards over the years from fan
failures.  My phenom in this box has a 75C shutdown that has not been
tested.  Best fan & sink assembly I could buy at the time.  And I have
gotten into the habit of replacing the 45 cent fans on the video card with
bigger, ball bearing fans at the first hint of a squall.  A lot of this
stuff has more engineering time in assuring it will die 2 weeks out of
warranty, than in giving top performance.  And that goes double for stuff
wearing an Antec label.  I'm on the 4th psu in this box, its a $12.65 in
10 packs 350 watter, Chinese of course, running 4 terrabyte drives and a
USB tree that looks like a weeping willow plus the original 2.1Mhz Phenom.
165 watts IIRC.  I run gkrellm and watch its voltages.  Now about 3 years
old, the 5 volt line is still 5.08 volts.  Whats not to like?  The 2
Antecs I was dumb enough to try, had 5 volt lines down to 4.75 volts and
doing random resets at the end of the 1 year warranty.  Thats not an
excusable failure in my book.

Cheers, Gene Heskett

Reading this reminds me the hypothetical dilemma of (...)

If one solution based in n dependencies(client apis) would need to 
optimize it's system(in dependencies too) to face the massive hits of 
search engines in the indexation of n millions of pages with tracking 
integrated at several levels(...) ... how would it be solved? ... It 
would turn at n volts(...) and it would need to decrease the voltage(...)


This is somehow integrated in what I wrote in the post with the subject 
'python team(...)'


To put this working and optimized is really fascinating (...)

Regards,
Carlos



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


Python Team(...)

2014-06-08 Thread Carlos Anselmo Dias
the user defined in 
one website of ecommerce with one voucher of discount for example ...


*I finished(...)*
I did not mention:
-> Membership (let's say that the complexity of is what makes it 
interesting)
-> Crossed accounts of registered users(it's one technical requirement 
in the majority of the cases and we'll find one solid technical solution)

-> etc ... and I consider these issues present ...
I had here one basic example of what is Big Data ... and I'm gonna write 
it again .. Big Data can be as simple as determine what people 
bought(with filters, daily routine,holidays,etc) and with that 
information process what's more suitable to sell them ... the focus in n 
millions of people to determine the particularity of each person/group 
of people/enterprise(s)/etc ... and this can lead to solutions of 
advertisement(...) the SA of consulting will work in this issue too ... 
and I see advertisement as another SA ... and we'll develop our solution 
of advertisement somehow integrated/shared,etc(...) ... it was not what 
I had written but was +- this ... beyond of what people are seeking ...

Best regards,
Carlos
$id_flux["idsponsor"]=2;
//  $flux_treat=array(397,382,769,770);
//$flux_treat=array(397,382);
$flux_treat=array(521,6876);
$textemailmessage="";
include("../../conf.inc.php");



if(is_array($flux_treat)){
foreach($flux_treat as $kfluxtotreat => $vfluxtotreat){
//echo $kfluxtreatsubtype."";

if(!empty($array_language_flux_default[$vfluxtotreat])){

$id_language_default=$array_language_flux_default[$vfluxtotreat];
}

$info_page_records=explode("|",$array_number_records_per_page_start_flux[$vfluxtotreat]);
 
if(is_array($id_flux["detail"][$vfluxtotreat])){

foreach($id_flux["detail"][$vfluxtotreat]["Sponsor"]["url"]["information"]["xml"]
 as $kfluxtreatsubtype=>$vfluxtreatsubtype){
//control if execution is allowed by 
kfluxtreatsubtype and add exit
echo $kfluxtreatsubtype."";

if(check_lock_control_($kfluxtreatsubtype,"start")=="ok"){


$_ids_types_xml_cache_=$_ids_types_xml_[$kfluxtreatsubtype];

$_time_of_cache_flux_subtype=$_ids_types_xml_time_cache_[$kfluxtreatsubtype];
//echo "time of cache 
".$_time_of_cache_flux_subtype."";

if($kfluxtreatsubtype 
=="xml-movies"){


$number_records_or_end_position=$info_page_records[0];
$counterfilter=0;

foreach($id_flux["detail"][$vfluxtotreat]["languages"] as $klg => $vlg){

foreach($ids_cats_sponsor[$vfluxtotreat] as $kcat => $vcat){
 
$cat_convereted_cache=$vcat;
 
$pagenumb=$limitepaginas=$info_page_records[1];



while ($pagenumb<=$limitepaginas){


$replacements=array($id_flux["idsponsorfk"],$id_flux["loginsponsor"],$id_flux["passwordsponsor"],$kcat,"{idcatsonsponsor}",$pagenumb,$vlg,$number_records_or_end_position,"{filter}",$_SERVER['REMOTE_ADDR'],$id_flux["keysponsor"],"{tracker}","{iditemdetail}","{idsubitemdetail}","{subtracker}");
   

$urlstringtreat =str_replace($patterns, $replacements, 
$vfluxtreatsubtype);

$page_number_cache=$pagenumb;   

echo "".$urlstringtreat."";
   

Looking for Django/Python programmer in Jakarta

2014-01-08 Thread carlos
For working in a startup environment.
Immediate incorporation.
Please send your CV to tal...@zocko.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Error connecting to MySQL from Python

2013-10-12 Thread Carlos Ortiz
On Saturday, October 12, 2013 12:13:05 PM UTC-5, MRAB wrote:
> On 12/10/2013 17:09, carlos.o...@gmail.com wrote:
> 
> > Hello guys I am currently working in a python project at my school. First I 
> > want to make clear that I'm not a python programmer (I was just called to 
> > put out the flames in this project because no one else would and I was 
> > brave enough to say yes).
> 
> >
> 
> > I have the following problem here. I have to write a method that connects 
> > to an existing localhost MySQL database (I'm using connector version 
> > 1.0.12) and then does pretty basic stuff. The parameters are sent by a 
> > GTK-written GUI (I didn't write that interface). So I wrote my method like 
> > this:
> 
> >
> 
> > --PYTHON  
> > CODE
> 
> >def compMySQL(self, user, database, password, db_level, table_level, 
> > column_level):
> 
> >  sql_page_textview = self.mainTree.get_widget('sql_text_view')
> 
> >  sql_page_textview.modify_font(pango.FontDescription("courier 10"))
> 
> >  sql_page_buffer = sql_page_textview.get_buffer()
> 
> >
> 
> >  #Gonna try connecting to DB
> 
> >  try:
> 
> >print("Calling conn with U:{0} P:{1} 
> > DB:{2}".format(user,password,database))
> 
> >cnxOMC = mysql.connector.connect(user, password,'localhost',database)
> 
> >  except:
> 
> >print "Error: Database connection failed. User name or Database name 
> > may be wrong"
> 
> >return
> 
> >
> 
> >  #More code ...
> 
> > END OF PYTHON 
> > CODE-
> 
> >
> 
> >
> 
> > But when I run my code I get this:
> 
> >
> 
> > -CONSOLE 
> > OUTPUT
> 
> > Calling conn with U:root P:PK17LP12r DB:TESTERS
> 
> > Error: Database connection failed. User name or Database name may be wrong
> 
> > ---END OF COLSOLE 
> > OUTPUT---
> 
> >
> 
> > And I don't know why, since the arguments sent are the same arguments that 
> > get printed (telling me that the GUI the other guy coded works fine) and 
> > they are valid login parameters. If I hardcode the login parameters 
> > directly insetad of using the GUI everything goes ok and the functions 
> > executes properly; the following code executes nice and smooth:
> 
> >
> 
> > --PYTHON  
> > CODE-
> 
> > def compMySQL(self, user, database, password, db_level, table_level, 
> > column_level):
> 
> >  sql_page_textview = self.mainTree.get_widget('sql_text_view')
> 
> >  sql_page_textview.modify_font(pango.FontDescription("courier 10"))
> 
> >  sql_page_buffer = sql_page_textview.get_buffer()
> 
> >
> 
> >  #Gonna try hardcoding
> 
> >  try:
> 
> >#print("Calling conn with U:{0} P:{1} 
> > DB:{2}".format(user,password,database))
> 
> >cnxOMC = mysql.connector.connect(user="root", 
> > password='PK17LP12r',host='localhost',database='TESTERS')
> 
> >print 'No prob with conn'
> 
> >  except:
> 
> >print "Error: Database connection failed. User name or Database name 
> > may be wrong"
> 
> >return
> 
> >
> 
> >  #more code ...
> 
> > END OF PYTHON 
> > CODE--
> 
> >
> 
> > Console output:
> 
> >
> 
> > CONSOLE 
> > OUTPUT--
> 
> > No prob with conn
> 
> > END OF CONSOLE 
> > OUTPUT---
> 
> >
> 
> >
> 
> > Any ideas guys? This one is killing me.  I'm just learning Python but I 
> > imagine the problem to be something very easy for a seasoned python 
> > developer so any help would be strongly appreciated.
> 
> >
> 
> In the first example you're using positional arguments, whereas in the 
> 
> second example you're using keyword arguments. Are you sure that the 
> 
> positional arguments are in the correct order?
> 
> 
> 
> Try using keyword arguments in the first argument:
> 
> 
> 
>  cnxOMC = mysql.connector.connect(user=user, password=password, 
> 
> host='localhost', database=database)
> 
> 
> 
> It might also help if you print the repr of the arguments; that way 
> 
> you'll be able to see the difference between, say, 0 and "0".
> 
> 
> 
> On another point, using a 'bare' except ("except:") is virtually always 
> 
> a *bad* idea. It'll catch _all_ exceptions, including NameError, which 
> 
> could indicate a bug in your code. Catch only what you need to, only 
> 
> what you're expecting and can handle.

Thanks, I really don't know the difference between positional and keyboard 
arguments so I think I must do some python reading. I'm not really a python 
programmer (I'm a C, assembly, Java and C# programmer). Anyway the code is now 
working.

Thanks a lot to both of you.
Regards.
-- 
https://mail.python

Re: Error connecting to MySQL from Python

2013-10-12 Thread Carlos Ortiz
On Saturday, October 12, 2013 11:46:49 AM UTC-5, Jussi Piitulainen wrote:
> carlos.o...@gmail.com writes:
> 
> 
> 
> > So I wrote my method like this:
> 
> ...
> 
> >   cnxOMC = mysql.connector.connect(user,
> 
> >password,
> 
> >'localhost',
> 
> >database)
> 
> ...
> 
> > the following code executes nice and smooth:
> 
> ...
> 
> >   cnxOMC = mysql.connector.connect(user="root",
> 
> >password='PK17LP12r',
> 
> >host='localhost',
> 
> >database='TESTERS')
> 
> 
> 
> You pass the hardcoded parameters as keyword arguments, unlike in the
> 
> version that doesn't work. Maybe that is the difference. Try this:
> 
> 
> 
>cnxOMC = mysql.connector.connect(user=user,
> 
> password=password,
> 
> host='localhost',
> 
> database=database)
> 
> 
> 
> It only looks funny. In "user=user" the first "user" is a parameter
> 
> name, the other is the variable in your code.
> 
> 
> 
> Try help(mysql.connector.connect) at the interactive prompt, or
> 
> otherwise check the documentation.

Thanks a lot man, it worked flawlessly.
-- 
https://mail.python.org/mailman/listinfo/python-list


Error connecting to MySQL from Python

2013-10-12 Thread carlos . ortiz . asm
Hello guys I am currently working in a python project at my school. First I 
want to make clear that I'm not a python programmer (I was just called to put 
out the flames in this project because no one else would and I was brave enough 
to say yes).

I have the following problem here. I have to write a method that connects to an 
existing localhost MySQL database (I'm using connector version 1.0.12) and then 
does pretty basic stuff. The parameters are sent by a GTK-written GUI (I didn't 
write that interface). So I wrote my method like this:

--PYTHON  CODE
  def compMySQL(self, user, database, password, db_level, table_level, 
column_level):
sql_page_textview = self.mainTree.get_widget('sql_text_view')
sql_page_textview.modify_font(pango.FontDescription("courier 10"))
sql_page_buffer = sql_page_textview.get_buffer()

#Gonna try connecting to DB
try:
  print("Calling conn with U:{0} P:{1} 
DB:{2}".format(user,password,database))
  cnxOMC = mysql.connector.connect(user, password,'localhost',database)
except:
  print "Error: Database connection failed. User name or Database name may 
be wrong"
  return

#More code ...
END OF PYTHON CODE-


But when I run my code I get this:

-CONSOLE OUTPUT
Calling conn with U:root P:PK17LP12r DB:TESTERS
Error: Database connection failed. User name or Database name may be wrong
---END OF COLSOLE OUTPUT---

And I don't know why, since the arguments sent are the same arguments that get 
printed (telling me that the GUI the other guy coded works fine) and they are 
valid login parameters. If I hardcode the login parameters directly insetad of 
using the GUI everything goes ok and the functions executes properly; the 
following code executes nice and smooth:

--PYTHON  CODE-
def compMySQL(self, user, database, password, db_level, table_level, 
column_level):
sql_page_textview = self.mainTree.get_widget('sql_text_view')
sql_page_textview.modify_font(pango.FontDescription("courier 10"))
sql_page_buffer = sql_page_textview.get_buffer()

#Gonna try hardcoding
try:
  #print("Calling conn with U:{0} P:{1} 
DB:{2}".format(user,password,database))
  cnxOMC = mysql.connector.connect(user="root", 
password='PK17LP12r',host='localhost',database='TESTERS')
  print 'No prob with conn'
except:
  print "Error: Database connection failed. User name or Database name may 
be wrong"
  return

#more code ...
END OF PYTHON CODE--

Console output:

CONSOLE OUTPUT--
No prob with conn
END OF CONSOLE OUTPUT---


Any ideas guys? This one is killing me.  I'm just learning Python but I imagine 
the problem to be something very easy for a seasoned python developer so any 
help would be strongly appreciated.

Thanks in advance.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Print statement not printing as it suppose to

2013-09-20 Thread Emiliano Carlos de Moraes Firmino
Remove both brackets in last line, You are creating a tuple in last
statement not making a function call.


2013/9/20 Sam 

> hi everybody i am just starting to learn python, i was writing a simple
> i/o program but my print statement is acting weird. here is my code i want
> to know why it prints this way. thank you
>
>
> car=int(input("Lamborghini tune-up:"))
>
> rent=int(input('\nManhatan apartment: '))
>
> gifts=int(input('\nRandom Gifts: '))
>
> total=car+rent+gifts
>
> print("\nThe total amount required is ", total )
>
>
> OUTPUT
>
> Lamborghini tune-up:1000
>
> Manhatan apartment: 2300
>
> Random Gifts: 234
> ('\nThe total amount required is ', 3534)
>
>
>
> ===> the problem is obviously on the last print statement that is supposed
> to print the outut
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Emiliano Carlos de Moraes Firmino
Desenvolvedor | PMT | INdT
Universitário | Engenharia da Computação | UEA
emiliano.firm...@gmail.com | (92) 9196-3922
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-12 Thread Carlos Nepomuceno
' Server: ApacheBooster/1.6'  isn't a signature of httpd. I think you are 
really running something different.

> From: nob...@nowhere.com
> Subject: Re: Changing filenames from Greeklish => Greek (subprocess complain)
> Date: Tue, 4 Jun 2013 14:01:48 +0100
> To: python-list@python.org
> 
> On Tue, 04 Jun 2013 00:58:42 -0700, Νικόλαος Κούρας wrote:
> 
> > Τη Τρίτη, 4 Ιουνίου 2013 10:39:08 π.μ. UTC+3, ο
> > χρήστης Nobody έγραψε:
> > 
> >> Chrome didn't choose ISO-8859-1, the server did; the HTTP response says:
> >>   Content-Type: text/html;charset=ISO-8859-1
> > 
> > From where do you see this
> 
> $ wget -S -O - http://superhost.gr/data/apps/
> --2013-06-04 14:00:10--  http://superhost.gr/data/apps/
> Resolving superhost.gr... 82.211.30.133
> Connecting to superhost.gr|82.211.30.133|:80... connected.
> HTTP request sent, awaiting response... 
>   HTTP/1.1 200 OK
>   Server: ApacheBooster/1.6
>   Date: Tue, 04 Jun 2013 13:00:19 GMT
>   Content-Type: text/html;charset=ISO-8859-1
>   Transfer-Encoding: chunked
>   Connection: keep-alive
>   Vary: Accept-Encoding
>   X-Cacheable: YES
>   X-Varnish: 2000177813
>   Via: 1.1 varnish
>   age: 0
>   X-Cache: MISS
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Short-circuit Logic

2013-06-12 Thread Carlos Nepomuceno

> From: oscar.j.benja...@gmail.com
> Date: Thu, 30 May 2013 23:57:28 +0100
> Subject: Re: Short-circuit Logic
> To: carlosnepomuc...@outlook.com
> CC: python-list@python.org
>
> On 30 May 2013 22:03, Carlos Nepomuceno  wrote:
>>> Here's another way, mathematically equivalent (although not necessarily
>>> equivalent using floating point computations!) which avoids the divide-by-
>>> zero problem:
>>>
>>> abs(a - b) < epsilon*a
>>
>> That's wrong! If abs(a) < abs(a-b)/epsilon you will break the commutative 
>> law.
>
> There is no commutative law for relative tolerance floating point
> comparisons. If you want to compare with a relative tolerance then you
> you should choose carefully what your tolerance is to be relative to
> (and how big your relative tolerance should be).

Off course there is! It might not suite your specific needs though.

I'll just quote Knuth because it's pretty damn good:

"A. An axiomatic approach. Although the associative law is not valid, the 
commutative law

u (+) v == v (+) u (2)

does hold, and this law can be a valuable conceptual asset in programming and 
in the analysis of programs. This example suggests that we should look for
important laws that are satified by (+), (-), (*), and (/); it is not 
unreasonable to say that floating point routines should be designed to preserve 
as many of the ordinary mathematical laws as possible. If more axioms are 
valid, it becomes easier to write good programs, and programs also become more 
portable from
machine to machine."
TAOCP, Vol .2, p. 214


> In some applications it's obvious which of a or b you should use to
> scale the tolerance but in others it is not or you should compare with
> something more complex. For an example where it is obvious, when
> testing numerical code I might write something like:
>
> eps = 1e-7
> true_answer = 123.4567879
> estimate = myfunc(5)
> assert abs(estimate - true_answer) < eps * abs(true_answer)
>
>
> Oscar   
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Python #ifdef

2013-06-12 Thread Carlos Nepomuceno

> Date: Mon, 3 Jun 2013 12:05:49 +1000
> Subject: Re: Python #ifdef
> From: ros...@gmail.com
> To: python-list@python.org
[...]
> Ah. I actually wasn't aware of m4's use with sendmail. I first met it
> as the aforementioned PHP preprocessor, simply by Googling for
> something along the lines of "generic preprocessor". First hit solved
> my problems.
>
> ChrisA

Why didn't you use something like EZT[1]?

[1] https://code.google.com/p/ezt/
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-12 Thread Carlos Nepomuceno

> To: python-list@python.org
> From: breamore...@yahoo.co.uk
> Subject: Re: Changing filenames from Greeklish => Greek (subprocess complain)
> Date: Sun, 2 Jun 2013 15:51:31 +0100
[...]
> "Steve is going for the pink ball - and for those of you who are
> watching in black and white, the pink is next to the green." Snooker
> commentator 'Whispering' Ted Lowe.
>
> Mark Lawrence
>
> --
> http://mail.python.org/mailman/listinfo/python-list

le+666l   
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Total Beginner - Extracting Data from a Database Online (Screenshot)

2013-06-12 Thread Carlos Nepomuceno

> Date: Tue, 28 May 2013 07:40:07 +0100 
> Subject: RE: Total Beginner - Extracting Data from a Database Online  
> (Screenshot) 
> From: pconn...@gmail.com 
[...]
> > 
> > c11 = [tables[0][r][10] for r in range(len(tables[0]))] 
>  
> Or rather: 
>  
> c11 = [row[10] for row in tables[0]] 
>  
> In most cases, range(len(x)) is a sign that you're doing it wrong :)

Indeed! Much better that way! \o  
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: How to: Setuptools

2013-06-12 Thread Carlos Nepomuceno

> Date: Mon, 27 May 2013 21:26:21 -0700
> Subject: Re: How to: Setuptools
> From: rustompm...@gmail.com
> To: python-list@python.org
>
> On May 28, 9:09 am, Carlos Nepomuceno 
> wrote:
>> 
>>
>>> Date: Mon, 27 May 2013 20:54:53 -0700
>>> Subject: Re: How to: Setuptools
>>> From: rustompm...@gmail.com
>> [...]
>>
>>> Oooff! Talk of using sledgehammers to crack nuts...
>>
>>> All that is needed is to visithttp://peak.telecommunity.com/dist/ez_setup.py
>>> with the browser and to save the file!!
>>
>> Can you show me how to do that from a batch file? Please...
>
> What in the OP's question translates into a need for a batch-file?
>
> And you are proposing that he downloads curl just to write that batch-
> file?!?!
>
> How come that proposal is not subject to the same requirement, viz. I
> dont see in your recipe any:
> "Here-is-a-batchfile-to-download-curl-without-curl?"
> --
> http://mail.python.org/mailman/listinfo/python-list

So, you don't know how to download from a batch file?   
  
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Encodign issue in Python 3.3.1 (once again)

2013-06-12 Thread Carlos Nepomuceno

> Date: Tue, 28 May 2013 08:18:06 +1000
> Subject: Re: Encodign issue in Python 3.3.1 (once again)
> From: ros...@gmail.com
> To: python-list@python.org
[...]
>
> This is something that's utterly trivial, yet a window to your mind.
> It's like boarding an airliner and finding coffee stains on the
> flip-down trays - the plane flies just fine with those stains, yet the
> impression they give is that the crew don't care about engine
> maintenance either.
>
> ChrisA


Stain Is Too Damn High!!! lol

That's my party man!!! :) 
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Cutting a deck of cards

2013-06-12 Thread Carlos Nepomuceno

> To: python-list@python.org
> From: breamore...@yahoo.co.uk
[...]
> See this
> http://docs.python.org/3/whatsnew/3.3.html#pep-397-python-launcher-for-windows
>
> --
> If you're using GoogleCrap™ please read this
> http://wiki.python.org/moin/GoogleGroupsPython.
>
> Mark Lawrence

Piece of cake! So, is there any risk of breaking anything if I install a new 
package after having both Puthon 2 and 3 installed?

How do I choose which one will run the package? Will the package handle the 
settings accordingly or will I need to setup manually?  
  
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Cutting a deck of cards

2013-06-12 Thread Carlos Nepomuceno

> From: usenetm...@solar-empire.de
> Subject: Re: Cutting a deck of cards
> Date: Sun, 26 May 2013 22:13:55 +0200
> To: python-list@python.org
>
> Carlos Nepomuceno  wrote:
>> 
>>> From: usenetm...@solar-empire.de
>> [...]
>>> Not in Python3.x
>>>>>> decks = 6
>>>>>> list(range(13 * 4 * decks)) == range(13 * 4 * decks)
>>> False
>>
>> What does "list(range(13 * 4 * decks))" returns in Python 3?
>
> A list of course. But Py3 range is very similar to Py2 xrange, it
> returns a range object.
>
> Adiaŭ
> Marc

What list? '[[0,1,2,...]]' or '[0,1,2,...]'? If it's the later then it's no 
different than what range() returns in Python 2.7.5!
  
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Python Magazine

2013-06-12 Thread Carlos Nepomuceno

> Date: Sun, 26 May 2013 15:17:11 +1000
> Subject: Re: Python Magazine
> From: ros...@gmail.com
[...]
>> Blocking a whole network (/65) is totally undesirable and may even become 
>> illegal.
>
> Blocking a /64 is exactly the same as blocking a /32 with NAT behind
> it. And how could it be illegal? I provide service to those I choose
> to provide to.

I'm not a lawyer, so what I say about the IP blocking legal matter is just an 
opinion. I'm not responsible for any damages it may cause to anyone!!! lol

It just looks like those damn software disclaimers, doesn't it? ;)

Depending on the jurisdiction things maybe very different.

I've been told that in California it is really illegal to block IP addresses 
without a court order. Any Californians available to confirm that?

"The sender of information over the Internet is the "owner" of both the 
information and the IP address attached to the information. The practice of IP 
address blocking "records" the IP address and "destroys" the information in the 
message "without the intent or permission of the owner of the information," and 
"usurp[s] the normal operation of the . . computer network." Software designed 
to record IP addresses and use them to block messages is thus a "computer 
contaminant" according to the above definition. "

Source: 
http://im-from-missouri.blogspot.com.br/2007/05/ip-address-blocking-is-illegal-in.html


Also check California Penal Code Section 502, "Unauthorized Access To 
Computers, Computer Systems and Computer Data":
http://www.leginfo.ca.gov/cgi-bin/displaycode?section=pen&group=1-01000&file=484-502.9


The problem is serious and there are many cases, such as:
http://www.theregister.co.uk/2011/10/13/dutch_isp_accuses_spamhaus/


>> Currently it may not only happen at the target of the DDoS attack, but be 
>> spread all over the internet where block lists are enforced.
>>
>> I don't expect that to happen and if it happens I'm surely in favor of 
>> protection against this type of 'solution' because it will block not only 
>> malicious clients but potentially many other legitimate clients.
>
> Banning a wide netblock is of course going to lock out legit clients.
> But IP rotation means that can happen anyway. You block a single IPv4
> address that right now represents an abusive user; that user
> disconnects and reconnects, gets a new IP, and someone else gets the
> other one. Can happen all too easily. That's why IP-banning is at best
> a temporary solution anyway.

IP blocking isn't a perfect solution as you have confirmed. That's why using it 
is so problematic. It may hurt legitimate clients and other unrelated ones, 
while the "abusive user" as you said gets out unharmed. 
  
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Simple algorithm question - how to reorder a sequence economically

2013-06-12 Thread Carlos Nepomuceno

> Date: Fri, 24 May 2013 17:28:07 -0700
> Subject: Re: Simple algorithm question - how to reorder a sequence 
> economically
> From: peter.h.m.bro...@gmail.com
> To: python-list@python.org
[...]
> If the scenario could be modelled mathematically, then there'd be no
> point in writing the simulation.

I don't know what you mean. A computer simulation is an instance of a 
mathematical model. 
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Python Magazine

2013-06-12 Thread Carlos Nepomuceno
I don't think IPv6 will change anything about NAPT usage. In fact, I guess, it 
will probably will make NAPT usage even more important and needed.  
   
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: how to detect the character encoding in a web page ?

2013-06-09 Thread Carlos Nepomuceno
Try this:

### get_charset.py ###
import re
import urllib2

def  get_charset(url):
resp = urllib2.urlopen(url)
#retrieve charset from header
headers = ''.join(resp.headers.headers)
charset_from_header_list = re.findall('charset=(.*)', headers)
charset_from_header = charset_from_header_list[-1] if 
charset_from_header_list else ''

#retrieve charset from html
html = resp.read()
charset_from_html_list = 
re.findall('Content-Type.*charset=["\']?(.*)["\']', html)
charset_from_html = charset_from_html_list[-1]  if charset_from_html_list 
else ''

return charset_from_html if charset_from_html else charset_from_header




> Date: Sun, 9 Jun 2013 04:47:02 -0700
> Subject: Re: how to detect the character encoding  in a web page ?
> From: redstone-c...@163.com
> To: python-list@python.org
> 
> 在 2012年12月24日星期一UTC+8上午8时34分47秒,iMath写道:
> > how to detect the character encoding  in a web page ?
> > 
> > such as this page 
> > 
> > 
> > 
> > http://python.org/
> 
> Finally ,I found by using PyQt’s QtextStream , QTextCodec and chardet ,we can 
> get a web page code more securely  
> even for this bad page
> http://www.qnwz.cn/html/yinlegushihui/magazine/2013/0524/425731.html 
> 
> this script 
> http://www.flvxz.com/getFlv.php?url=aHR0cDojI3d3dy41Ni5jb20vdTk1L3ZfT1RFM05UYzBNakEuaHRtbA==
> 
> and this page without chardet in its source code 
> http://msdn.microsoft.com/en-us/library/bb802962(v=office.12).aspx
> 
> 
> from PyQt4.QtCore import *
> from PyQt4.QtGui import *
> from PyQt4.QtNetwork  import *
> import sys
> import chardet
> 
> def slotSourceDownloaded(reply):
> redirctLocation=reply.header(QNetworkRequest.LocationHeader)
> redirctLocationUrl=reply.url() if not redirctLocation else redirctLocation
> #print(redirctLocationUrl,reply.header(QNetworkRequest.ContentTypeHeader))
> 
> if (reply.error()!= QNetworkReply.NoError):
> print('', reply.errorString())
> return
> 
> pageCode=reply.readAll()
> charCodecInfo=chardet.detect(pageCode.data())
> 
> textStream=QTextStream(pageCode)
> 
> codec=QTextCodec.codecForHtml(pageCode,QTextCodec.codecForName(charCodecInfo['encoding']
>  ))
> textStream.setCodec(codec)
> content=textStream.readAll()
> print(content)
> 
> if content=='':
> print('-', 'cannot find any resource !')
> return
> 
> reply.deleteLater()
> qApp.quit()
> 
> 
> if __name__ == '__main__':
> app =QCoreApplication(sys.argv)
> manager=QNetworkAccessManager ()
> url =input('input url :')
> request=QNetworkRequest 
> (QUrl.fromEncoded(QUrl.fromUserInput(url).toEncoded()))
> request.setRawHeader("User-Agent" ,'Mozilla/5.0 (Windows NT 5.1) 
> AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17 SE 
> 2.X MetaSr 1.0')
> manager.get(request)
> manager.finished.connect(slotSourceDownloaded)
> sys.exit(app.exec_())
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Listing modules from all installed packages

2013-06-08 Thread Carlos Nepomuceno
Just realized that you've asked for installed packages. Perhaps the following 
will do the trick. I don't know why the 'lib-tk' isn't included. Why not?

toplevel_packages = ['%s\\%s'%(ml.path,name)for ml,name,ispkg in 
pkgutil.iter_modules() if ispkg]
print '\n'.join(toplevel_packages)

> Date: Sat, 8 Jun 2013 21:30:48 -0700
> Subject: Listing modules from all installed packages
> From: jpha...@gmail.com
> To: python-list@python.org
> 
> Hi,
> 
> I'm trying to write a function that programmatically obtains and returns the 
> exact location of all first-level modules for all installed packages.
> 
> For example, if the packages named 'django' and 'django-debug-toolbar' are 
> installed, I'd like this function to return something like:
> >>> installed_modules()
> /Users/my_user/.virtualenvs/my_venv/lib/python2.6/site-packages/django
> /Users/my_user/.virtualenvs/my_venv/src/debug_toolbar
> 
> That is, this function needs to consider all installed packages, including 
> those that have been installed in "edit" mode (i.e. in the src/ folder). Note 
> also that the main module for the 'django-debug-toolbar' is in fact named 
> 'debug_toolbar'.
> 
> So far the closest I've been to retrieving the list of first-level modules is 
> as follows:
> 
> import os
> import pkg_resources
> import setuptools
> 
> pkgs = set()
> 
> for dist in pkg_resources.working_set:
> if os.path.isdir(dist.location):
> for pkg in setuptools.find_packages(dist.location):
> if '.' not in pkg:
> pkgs.add(pkg)
> 
> The idea is then to loop through that list of modules, import them and get 
> their exact locations by fetching their __file__ attribute values.
> 
> However, this feels very hackish and I don't think it's actually quite 
> correct either. I'm sure there must be a better way. If possible I'd also 
> like to avoid having to use setuptools.
> 
> Do you have any tips on how to achieve this?
> 
> Many thanks!
> 
> Julien
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Listing modules from all installed packages

2013-06-08 Thread Carlos Nepomuceno
print '\n'.join([re.findall("from '(.*)'",str(v))[0] for k,v in 
sys.modules.items() if str(v).find('from')>-1])


> Date: Sat, 8 Jun 2013 21:30:48 -0700
> Subject: Listing modules from all installed packages
> From: jpha...@gmail.com
> To: python-list@python.org
> 
> Hi,
> 
> I'm trying to write a function that programmatically obtains and returns the 
> exact location of all first-level modules for all installed packages.
> 
> For example, if the packages named 'django' and 'django-debug-toolbar' are 
> installed, I'd like this function to return something like:
> >>> installed_modules()
> /Users/my_user/.virtualenvs/my_venv/lib/python2.6/site-packages/django
> /Users/my_user/.virtualenvs/my_venv/src/debug_toolbar
> 
> That is, this function needs to consider all installed packages, including 
> those that have been installed in "edit" mode (i.e. in the src/ folder). Note 
> also that the main module for the 'django-debug-toolbar' is in fact named 
> 'debug_toolbar'.
> 
> So far the closest I've been to retrieving the list of first-level modules is 
> as follows:
> 
> import os
> import pkg_resources
> import setuptools
> 
> pkgs = set()
> 
> for dist in pkg_resources.working_set:
> if os.path.isdir(dist.location):
> for pkg in setuptools.find_packages(dist.location):
> if '.' not in pkg:
> pkgs.add(pkg)
> 
> The idea is then to loop through that list of modules, import them and get 
> their exact locations by fetching their __file__ attribute values.
> 
> However, this feels very hackish and I don't think it's actually quite 
> correct either. I'm sure there must be a better way. If possible I'd also 
> like to avoid having to use setuptools.
> 
> Do you have any tips on how to achieve this?
> 
> Many thanks!
> 
> Julien
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Idiomatic Python for incrementing pairs

2013-06-07 Thread Carlos Nepomuceno
Oh! I really though you were just adding 1 or 0 to those variables. In clude 
the loop next time! ;)

You can accumulate the values by doing this instead:

alpha, beta = (alpha + (1 if some_calculation(params) else 0), beta + (1 if 
other_calculation(params) else 0))

> Date: Fri, 7 Jun 2013 23:16:22 -0500
> From: python.l...@tim.thechases.com
> To: carlosnepomuc...@outlook.com
> CC: python-list@python.org
> Subject: Re: Idiomatic Python for incrementing pairs
> 
> On 2013-06-08 07:04, Carlos Nepomuceno wrote:
> > alpha, beta = (1 if some_calculation(params) else 0, 1 if
> > other_calculation(params) else 0)
> 
> This one sets them to absolute values, rather than the incrementing
> functionality in question:
> 
> > >   alpha += temp_a
> > >   beta += temp_b
> 
> The actual code in question does the initialization outside a loop:
> 
>   alphas_updated = betas_updated = 0
>   for thing in bunch_of_things:
> a, b = process(thing)
> alphas_updated += a
> betas_updated += b
> 
> and it just bugs me as being a little warty for having temp
> variables when Python does things like tuple-unpacking so elegantly.
> That said, as mentioned in a contemporaneous reply to Jason, I haven't
> found anything better that is still readable.
> 
> -tkc
> 
> 
> 
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Idiomatic Python for incrementing pairs

2013-06-07 Thread Carlos Nepomuceno
alpha, beta = (1 if some_calculation(params) else 0, 1 if 
other_calculation(params) else 0)

> Date: Fri, 7 Jun 2013 21:32:39 -0500
> From: python.l...@tim.thechases.com
> To: python-list@python.org
> Subject: Idiomatic Python for incrementing pairs
> 
> Playing around, I've been trying to figure out the most pythonic way
> of incrementing multiple values based on the return of a function.
> Something like
> 
>   def calculate(params):
> a = b = 0
> if some_calculation(params):
>   a += 1
> if other_calculation(params):
>   b += 1
> return (a, b)
> 
>   alpha = beta = 0
>   temp_a, temp_b = calculate(...)
>   alpha += temp_a
>   beta += temp_b
> 
> Is there a better way to do this without holding each temporary
> result before using it to increment?
> 
> -tkc
> 
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Source code to identify user through browser?

2013-06-05 Thread Carlos Nepomuceno
> Date: Wed, 5 Jun 2013 08:18:56 -0700
> Subject: Re: Source code to identify user through browser?
> From: rustompm...@gmail.com
[...]
> > What do you mean by user?
> 
> Ha! Nice question.  Not in direct answer but here's E.W Dijkstra
> defining 'user':
> 
> [from http://www.cs.utexas.edu/~EWD/transcriptions/EWD06xx/EWD618.html
> ]
> 
> The computer “user” isn’t a real person of flesh and blood, with
> passions and brains. No, he is a mythical figure, and not a very
> pleasant one either. A kind of mongrel with money but without taste,
> an ugly caricature that is very uninspiring to work for. He is, as a
> matter of fact, such an uninspiring idiot that his stupidity alone is
> a sufficient explanation for the ugliness of most computer systems.
> And oh! Is he uneducated! That is perhaps his most depressing
> characteristic. He is equally education-resistant as another equally
> mythical bore, “the average programmer”, whose solid stupidity is the
> greatest barrier to progress in programming. It is a sad thought that
> large sections of computing science are effectively paralyzed by the
> narrow-mindedness and other grotesque limitations with which a poor
> literature has endowed these influential mythical figures. (Computing
> science is not unique in inventing such paralyzing caricatures:
> universities all over the world are threatened by the invention of
> “the average student”, scientific publishing is severely hampered by
> the invention of “the innocent reader” and even “the poor reader”!)

Didn't know he was such a humorist! lol

Although I prefer when he's serious:

http://www.cs.utexas.edu/~EWD/transcriptions/EWD10xx/EWD1094.html

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


RE: Source code to identify user through browser?

2013-06-05 Thread Carlos Nepomuceno
> From: nos...@nospam.com
> Subject: Source code to identify user through browser?
> Date: Wed, 5 Jun 2013 15:08:54 +0200
> To: python-list@python.org
> 
> Hello
> 
> I was wondering if some Python module were available to identify a
> user through their browser, like it's done on the Panopticlick site:

What do you mean by user?

> http://panopticlick.eff.org/
> 
> I'd like to ban abusive users, and it seems like a good solution,
> since few users will think of installing a different browser, and
> there are few mainstream browsers anyway.
> 
> Thank you.
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Carlos Nepomuceno
> Date: Wed, 5 Jun 2013 07:40:52 -0700
> Subject: I just wrote my first Python program a guessing game and it exits
> with an error I get this.
> From: armandomontesdeoca...@gmail.com
> To: python-list@python.org
> 
> Traceback (most recent call last):
>   File "Guessing_Game.py", line 32, in 
> input (enter)
>   File "", line 0
> ^
> SyntaxError: unexpected EOF while parsing
> --
> (program exited with code: 1)
> This is the only place a string is used:
> else:
>   print "Sorry you loose the game."
>   computernum = str(computernum)
>   print " The computers number was!"+ computernum
>   input (enter)

Did you declared an 'enter' variable? Because input() expects a string.

>   sys.exit(0)
> Thank You,
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Python Magazine

2013-06-05 Thread Carlos Nepomuceno


> Date: Wed, 5 Jun 2013 00:37:53 -0700
> Subject: Re: Python Magazine
> From: rama29...@gmail.com
[...]
> > Do you have sponsors? Advertisers? What's the plan?
> Thanks Carlos,
> Right now we haven't engaged with sponsors or advertisers. Thinking 
> whether to have a community magazine or go with the same way as previous ones 
> some sort of commercialization.

Do you have other magazines? Which ones? How are you going to supply contents?
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-04 Thread Carlos Nepomuceno
> Date: Tue, 4 Jun 2013 18:28:17 -0700
> Subject: Re: Changing filenames from Greeklish => Greek (subprocess complain)
> From: wuwe...@gmail.com
[...]
> Just a reminder to everyone that the OP originally went by the name of
> Ferrous Cranus:
> http://redwing.hutman.net/~mreed/warriorshtm/ferouscranus.htm
> 
> He's told there's a missing parenthesis, he dismisses the claim. He's
> given code that demonstrates the missing parenthesis, and he acts
> confused. The list is rapidly becoming his support group for _his
> business_, and the bulk of it has very little to do with Python
> itself.
> 
> I've been struggling for a month to get an inheritance chain working
> with fresnel lenses, should I be posting every single bug I hit here
> every 10 minutes then bump them 10 minutes later when no one responds?
> Is that what the list is for now? We don't do people's home work for
> them, so why are we doing his _work_ for him?

I've had once this naive expectation that his obduracy would end! lol


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


RE: Do you consider Python a 4GL? Why (not)?

2013-06-04 Thread Carlos Nepomuceno
I don't have an opinion yet, but I've found contradictory evidence from many 
sources, such as:

"A domain-specific language (DSL) is a type of programming language or 
specification language in software development and domain engineering dedicated 
to a particular problem domain,
[...]
The opposite is:
a general-purpose programming language, such as C, Java or 
Python,"http://en.wikipedia.org/wiki/Domain-specific_programming_language

Since, 4GL is considered a subset of DSLs, this wiki page doesn't consider 
Python a 4GL.

Is is true? Why???
  -- 
http://mail.python.org/mailman/listinfo/python-list


Do you consider Python a 4GL? Why (not)?

2013-06-04 Thread Carlos Nepomuceno
Do you consider Python a 4GL? Why (not)?
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: How to increment date by week?

2013-06-04 Thread Carlos Nepomuceno
> Date: Tue, 4 Jun 2013 14:31:07 -0700
> Subject: How to increment date by week?
> From: r90...@gmail.com
> To: python-list@python.org
> 
>Starting on any day/date, I would like to create a one year list, by week 
> (start date could be any day of week).  Having a numerical week index in 
> front of date, ie 1-52, would be a bonus.  
>ie, 1.  6/4/2013
>2.  6/11/2013
>3.  6/18/2013etc to # 52.
> 
>And to save that result to a file.
>Moving from 2.7 to 3.3
> TIA

YAS:

import datetime
today = datetime.datetime.today()
week  = datetime.timedelta(weeks=1)

f=open('output.txt','w')
for i in range(52):
f.write((today+i*week).strftime(str(i+1)+'. %Y-%m-%d\n'))
f.close()

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


RE: create new python file

2013-06-04 Thread Carlos Nepomuceno


> Date: Tue, 4 Jun 2013 11:54:52 -0700
> Subject: Re: create new python file
> From: kakararunachalserv...@gmail.com
[...]
> > 
> > > So, can i program within just by the print statement? Or do i have to do 
> > > something else.
> > 
> > 
> > 
> > it is completely indecipherable (to me at least) what you are saying,
> > 
> > leave aside any issues with python.
> 
> God! Thanks "Dr." Rusi!

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


RE: Source code as text/plain

2013-06-04 Thread Carlos Nepomuceno
Thank you!

> Date: Tue, 4 Jun 2013 17:51:08 +0200
> From: andiper...@gmail.com
> To: python-list@python.org
> Subject: Re: Source code as text/plain
> 
> On 04.06.2013 00:34, Carlos Nepomuceno wrote:
> > 
> >> Date: Mon, 3 Jun 2013 09:06:46 +1000
> >> From: c...@zip.com.au
> >> To: c...@rebertia.com
> > [...]
> >> http://hg.python.org/cpython/raw-file/tip/Lib/string.py
> >
> > What's the 'tip' tag?   
> >
> http://hg.python.org/cpython/help/tip
> 
> Bye, Andreas
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: How to get an integer from a sequence of bytes

2013-06-04 Thread Carlos Nepomuceno


> From: invalid@invalid.invalid
> Subject: Re: How to get an integer from a sequence of bytes
> Date: Tue, 4 Jun 2013 13:42:46 +
> To: python-list@python.org
[...]
> VN designs are still very common in smaller CPUs (embedded stuff).

DSPs perhaps... not CPUs. Even ARMs are Harvard variants.

> Even modern desktop CPUs are "logically" still Von Neumann designs
> from the programmer's point of view (there's only a single address
> space for both data and instructions).  The fact that there are two
> sparate caches is almost entirely hidden from the user.  If you start
> to do stuff like write self-modifying code, then _may_ start having to
> worry about cache coherency.

Code/data separation isn't the only aspect. VN architecture is totally serial, 
even for RAM.

It's been a while since we've got into the multi-core, multipath world. Even in 
embedded devices.

> -- 
> Grant Edwards   grant.b.edwardsYow! I request a weekend in
>   at   Havana with Phil Silvers!
>   gmail.com
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Apache and suexec issue that wont let me run my python script

2013-06-04 Thread Carlos Nepomuceno


> Date: Tue, 4 Jun 2013 05:57:54 -0700
> Subject: Re: Apache and suexec issue that wont let me run my python script
> From: nikos.gr...@gmail.com
> To: python-list@python.org
> 
> root@nikos [~]# nano /usr/local/apache/conf/httpd.conf
> 
> and altering user nobody to user root.
> 
> root@nikos [~]# service httpd restart
> [Tue Jun 04 15:56:42 2013] [warn] module rpaf_module is already loaded, 
> skipping
> Syntax error on line 175 of /usr/local/apache/conf/httpd.conf:
> Error:\tApache has not been designed to serve pages while\n\trunning as root. 
>  There are known race conditions that\n\twill allow any local user to read 
> any file on the system.\n\tIf you still desire to serve pages as root 
> then\n\tadd -DBIG_SECURITY_HOLE to the CFLAGS env variable\n\tand then 
> rebuild the server.\n\tIt is strongly suggested that you instead modify the 
> User\n\tdirective in your httpd.conf file to list a non-root\n\tuser.\n
> root@nikos [~]#
> 
> What can i do?

You don't need to run httpd as root. In fact it's risky. You can use another 
user with less privileges to run it like nobody or something else you see fit.

I don't think the suggestion to rebuild the server is good, but I don't know 
how cPanel works so it's just a guess.


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


RE: Beginner question

2013-06-04 Thread Carlos Nepomuceno


> From: steve+comp.lang.pyt...@pearwood.info
> Subject: Re: Beginner question
> Date: Tue, 4 Jun 2013 12:35:59 +
> To: python-list@python.org
> 
> On Tue, 04 Jun 2013 14:23:39 +0300, Carlos Nepomuceno wrote:
> 
> > Started answering... now I'm asking! lol
> > 
> > I've tried to use dict() to create a dictionary to use like the switch
> > statement providing variable names instead of literals, such as:
> > 
> >>>> a='A'
> >>>> b='B'
> >>>> {a:0,b:1}#here the variables are resolved
> > {'A': 0, 'B': 1}
> > 
> > That's ok! But if I use dict() declaration:
> > 
> >>>> dict(a=0,b=1)
> > {'a': 0, 'b': 1}#here variable names are taken as literals
> > 
> > What's going on? Is there a way to make dict() to resolve the variables?
> 
> 
> This is by design. You're calling a function, dict(), and like all 
> functions, code like:
> 
> func(name=value)
> 
> provides a *keyword argument*, where the argument is called "name" and 
> the argument's value is as given. dict is no different from any other 
> function, it has no superpowers, keyword arguments are still keyword 
> arguments.
> 
> In this case, there is no simple way to use the dict() function[1] the 
> way you want. You could build up a string and then call eval():
> 
> s = "dict(%s=0, %s=1)" % (a, b)
> d = eval(s)
> 
> but that's slow and inconvenient and dangerous if your data is untrusted.
> 
> So in this specific case, you should stick to the {} method.
> 
> 
> 
> [1] Technically it's a type, not a function, but the difference makes no 
> difference here.
> 
> -- 
> Steven

It's superclear now! You're an excelent teacher!

Can you explain me the difference of the type and function you've just 
mentioned?

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


RE: Beginner question

2013-06-04 Thread Carlos Nepomuceno


> From: steve+comp.lang.pyt...@pearwood.info
> Subject: Re: Beginner question
> Date: Tue, 4 Jun 2013 12:25:27 +
> To: python-list@python.org
> 
> On Tue, 04 Jun 2013 14:53:29 +0300, Carlos Nepomuceno wrote:
> 
> > That's exactly the same!
> >>>>dict(**{a:0,b:1})=={a:0,b:1}
> > True
> 
> 
> Of course it is. Isn't that what you wanted?

Indeed! But that form isn't economically viable as you noted.
> 
> It's also a waste of time, because you create a dict literal using {}, 
> then unpack it into keyword arguments, then call dict() to create a new 
> dict with the same content. Rather like doing this:
> 
> n = int(str(42))
> 
> only even more expensive.
> 
> 
> > Are there any benefits from using dict() instead of {}?
> 
> Of course there are. {} can be used for creating dict literals, which 
> means you are limited to key/values that you explicitly include. dict(), 
> on the other hand, has a rich set of constructor APIs:
> 
> py> help(dict)
> 
> Help on class dict in module builtins:
> 
> class dict(object)
>  |  dict() -> new empty dictionary
>  |  dict(mapping) -> new dictionary initialized from a mapping object's
>  |  (key, value) pairs
>  |  dict(iterable) -> new dictionary initialized as if via:
>  |  d = {}
>  |  for k, v in iterable:
>  |  d[k] = v
>  |  dict(**kwargs) -> new dictionary initialized with the name=value pairs
>  |  in the keyword argument list.  For example:  dict(one=1, two=2)
> 
> 
> py> dict(zip('abcd', range(4)), x=23, y=42, z=999)
> {'a': 0, 'c': 2, 'b': 1, 'd': 3, 'y': 42, 'x': 23, 'z': 999}

Awesome! Now I can do it just like that:

>>> dict([(chr(ord('a')+x),x) for x in range(2)])
{'a': 0, 'b': 1}

Thanks a lot! ;)

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


RE: Apache and suexec issue that wont let me run my python script

2013-06-04 Thread Carlos Nepomuceno

> Date: Tue, 4 Jun 2013 04:48:34 -0700
> Subject: Re: Apache and suexec issue that wont let me run my python script
> From: nikos.gr...@gmail.com
> To: python-list@python.org
> 
> Τη Τρίτη, 4 Ιουνίου 2013 2:42:52 μ.μ. UTC+3, ο χρήστης Carlos Nepomuceno 
> έγραψε:
> > Post your httpd.conf to pastebin and send us the link...
> 
> 
> Here it is:  http://pastebin.com/kMT2BZp1
> -- 
> http://mail.python.org/mailman/listinfo/python-list

Your httpd.conf is automatically generated by cPanel. Take a look:

# Defined in /var/cpanel/cpanel.config: apache_portListen 0.0.0.0:82User 
nobodyGroup nobodyExtendedStatus OnServerAdmin nikos.gr33k@gmail.comServerName 
nikos.superhost.grLogLevel warn

That means you have to change the settings on cPanel not directly editing 
httpd.conf. I don't use cPanel so I can't help you on that.

Good luck!


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


RE: Apache and suexec issue that wont let me run my python script

2013-06-04 Thread Carlos Nepomuceno


> Date: Tue, 4 Jun 2013 04:36:06 -0700
> Subject: Re: Apache and suexec issue that wont let me run my python script
> From: nikos.gr...@gmail.com
> To: python-list@python.org
> 
> Τη Τρίτη, 4 Ιουνίου 2013 2:27:25 μ.μ. UTC+3, ο χρήστης Carlos Nepomuceno 
> έγραψε:
> > The httpd processes are run by user 'nobody'. You have to change your 
> > httpd.conf to assign the correct user or change the owner of the log file 
> > to nobody.
> > 
> > On httpd.conf look for the following directives:
> > User root
> > Group root
> 
> Why some httpd run as root(first two) and the rest as nobody?

The root processes are run by init during startup. The nobody processes are 
started by the first httpd processes based on httpd.conf settings.

> What is user 'nobody' anyways?

Just a user with no shell access.

> root@nikos [/home/nikos/www/data/apps]# nano /usr/local/apache/conf/httpd.conf
> root@nikos [/home/nikos/www/data/apps]# cat  
> /usr/local/apache/conf/httpd.conf | grep 'User root'
> root@nikos [/home/nikos/www/data/apps]# cat  
> /usr/local/apache/conf/httpd.conf | grep 'user root'
> root@nikos [/home/nikos/www/data/apps]# cat  
> /usr/local/apache/conf/httpd.conf | grep 'group root'
> root@nikos [/home/nikos/www/data/apps]# cat  
> /usr/local/apache/conf/httpd.conf | grep 'Group root'
> 
> Doesn't seem to be there.

You have to edit httpd.conf and change the User and Group directives. They 
currently are set to nobody, so you have to look for ' User nobody'  and ' 
Group nobody'.

Take care while editing httpd.conf. Make a backup copy just in case. ;)

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


RE: Apache and suexec issue that wont let me run my python script

2013-06-04 Thread Carlos Nepomuceno

Post your httpd.conf to pastebin and send us the link...

> Date: Tue, 4 Jun 2013 04:38:44 -0700
> Subject: Re: Apache and suexec issue that wont let me run my python script
> From: nikos.gr...@gmail.com
> To: python-list@python.org
> 
> root@nikos [/home/nikos/www/data/apps]# ls -l /usr/local/apache/logs/error_log
> -rwxr-xr-x 1 root apache 32447472 Jun  4 14:36 
> /usr/local/apache/logs/error_log*
> root@nikos [/home/nikos/www/data/apps]# chown nobody:apache 
> /usr/local/apache/logs/error_log
> root@nikos [/home/nikos/www/data/apps]# ls -l /usr/local/apache/logs/error_log
> -rwxr-xr-x 1 nobody apache 32447472 Jun  4 14:36 
> /usr/local/apache/logs/error_log*
> 
> 
> still the same error.
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Beginner question

2013-06-04 Thread Carlos Nepomuceno
>On 4 Jun 2013 12:28, "Carlos Nepomuceno"  wrote:
[...]
>> What's going on? Is there a way to make dict() to resolve the variables?
>Well yes.
>dict(**{a:0,b:1})
>The dict() constructor makes a dictionary from keyword arguments. So you just 
>have to feed it keyword arguments using **.
>And if you're in a bad day,
>dict(**locals())

That's exactly the same!
>>>dict(**{a:0,b:1})=={a:0,b:1}
True

Are there any benefits from using dict() instead of {}?
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Apache and suexec issue that wont let me run my python script

2013-06-04 Thread Carlos Nepomuceno
The httpd processes are run by user 'nobody'. You have to change your 
httpd.conf to assign the correct user or change the owner of the log file to 
nobody.

On httpd.conf look for the following directives:
User root
Group root


> Date: Tue, 4 Jun 2013 04:09:44 -0700
> Subject: Re: Apache and suexec issue that wont let me run my python script
> From: nikos.gr...@gmail.com
> To: python-list@python.org
> 
> Τη Τρίτη, 4 Ιουνίου 2013 2:04:36 μ.μ. UTC+3, ο χρήστης Carlos Nepomuceno 
> έγραψε:
> > send the output of the following command: 
> > ps aux|grep httpd
> 
> root@nikos [/home/nikos/www/data/apps]# ps aux | grep httpd
> root 19194  0.0  0.2  74224  4440 ?Ss   Jul13   0:00 
> /usr/local/apache/bin/httpd -k start -DSSL
> root 19201  0.0  0.1  74136  2576 ?SJul13   0:00 
> /usr/local/apache/bin/httpd -k start -DSSL
> nobody   19202  0.0  0.2  74492  4320 ?SJul13   0:00 
> /usr/local/apache/bin/httpd -k start -DSSL
> nobody   19203  0.0  0.2  74488  4304 ?SJul13   0:00 
> /usr/local/apache/bin/httpd -k start -DSSL
> nobody   19204  0.0  0.2  74488  4352 ?SJul13   0:00 
> /usr/local/apache/bin/httpd -k start -DSSL
> nobody   19205  0.0  0.2  74492  4336 ?SJul13   0:00 
> /usr/local/apache/bin/httpd -k start -DSSL
> nobody   19206  0.0  0.2  74544  4328 ?SJul13   0:00 
> /usr/local/apache/bin/httpd -k start -DSSL
> nobody   19215  0.0  0.2  74492  4300 ?SJul13   0:00 
> /usr/local/apache/bin/httpd -k start -DSSL
> nobody   20170  0.0  0.2  74356  4264 ?SJul13   0:00 
> /usr/local/apache/bin/httpd -k start -DSSL
> root 20860  0.0  0.0 103240   856 pts/2S+   Jul13   0:00 grep httpd
> root@nikos [/home/nikos/www/data/apps]#
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Beginner question

2013-06-04 Thread Carlos Nepomuceno
Started answering... now I'm asking! lol

I've tried to use dict() to create a dictionary to use like the switch 
statement providing variable names instead of literals, such as:

>>> a='A'
>>> b='B'
>>> {a:0,b:1}#here the variables are resolved
{'A': 0, 'B': 1}

That's ok! But if I use dict() declaration:

>>> dict(a=0,b=1)
{'a': 0, 'b': 1}#here variable names are taken as literals

What's going on? Is there a way to make dict() to resolve the variables?

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


RE: Apache and suexec issue that wont let me run my python script

2013-06-04 Thread Carlos Nepomuceno
send the output of the following command:

ps aux|grep httpd


> Date: Tue, 4 Jun 2013 03:56:19 -0700
> Subject: Re: Apache and suexec issue that wont let me run my python script
> From: nikos.gr...@gmail.com
> To: python-list@python.org
> 
> root@nikos [/home/nikos/www/cgi-bin]# chmod 755 /var/log/httpd/suexec.log
> 
> root@nikos [/home/nikos/www/cgi-bin]# ls -l /var/log/httpd/suexec.log
> -rwxr-xr-x 1 root apache 0 Jun  1 02:52 /var/log/httpd/suexec.log*
> 
> root@nikos [/home/nikos/www/cgi-bin]# chmod 755 
> /usr/local/apache/logs/error_log
> 
> root@nikos [/home/nikos/www/cgi-bin]# ls -l /usr/local/apache/logs/error_log
> -rwxr-xr-x 1 root root 32414017 Jun  4 13:51 /usr/local/apache/logs/error_log*
> 
> root@nikos [/home/nikos/www/cgi-bin]# chown root:apache 
> /usr/local/apache/logs/error_log
> root@nikos [/home/nikos/www/cgi-bin]# ls -l /usr/local/apache/logs/error_log
> 
> -rwxr-xr-x 1 root apache 32414017 Jun  4 13:51 
> /usr/local/apache/logs/error_log*
> root@nikos [/home/nikos/www/cgi-bin]#
> 
> 
> Now the error i get whn trying to run my scgi script via browser is
> 
> root@nikos [/home/nikos/www/cgi-bin]# [Tue Jun 04 13:55:26 2013] [error] 
> [client 46.12.95.59] suexec failure: could not open log file
> [Tue Jun 04 13:55:26 2013] [error] [client 46.12.95.59] fopen: Permission 
> denied
> [Tue Jun 04 13:55:26 2013] [error] [client 46.12.95.59] Premature end of 
> script headers: koukos.py
> [Tue Jun 04 13:55:26 2013] [error] [client 46.12.95.59] File does not exist: 
> /home/nikos/public_html/500.shtml
> 
> 
> I just don't get it.
> I chmod'ed
> i chown'ed
> 
> Why still doesn't work?
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Beginner question

2013-06-04 Thread Carlos Nepomuceno


> Date: Tue, 4 Jun 2013 00:53:04 -0700
> Subject: Re: Beginner question
> From: john_lada...@sbcglobal.net
> To: python-list@python.org
> 
> On Monday, June 3, 2013 11:46:03 PM UTC-7, Carlos Nepomuceno wrote:
> > That doesn't even works because input() is the same as eval(raw_input()). 
> > So you'll get a NameError exception.
> > 
> > I think you know that. Perhaps you mean raw_input() instead of input().
> 
> But the OP's code shows print() functions... which is not the habit of Python 
> 2 programmers, even though it's legal code.  And the OP says s/he's a 
> beginning programmer... so why start learning Python 2 in 2013?  Let me ask 
> the OP, are you programming in Python 2 or Python 3?  
> 
> If the answer is indeed Python 3: raw_input() has been banished from Python 
> 3, in favor of plain-old input().

Didn't know that. Thanks!

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


RE: Beginner question

2013-06-03 Thread Carlos Nepomuceno
That doesn't even works because input() is the same as eval(raw_input()). So 
you'll get a NameError exception.

I think you know that. Perhaps you mean raw_input() instead of input().
In that case the answer is yes, it can be more 'efficient' because the 
if-then-else clause always breaks the while loop.
I think you are looking for is a switch statement, which Python don't have.

You can use the following structure to emulate a switch statement:

def function1():
if raw_input() in option1:
print('he tumbles over you')
else:
print('he stabs you')

def function2():
if raw_input() in option2:
print('you trip him up')
else:
print('he stabs you')

def default():
print 'DEFAULT'

switch = {
option1: function1,
option2: function2
}
switch.get(randomizer, default)()

Note that switch is a dictionary and you can use it without creating a 
variable, for example:

{   option1: function1,
option2: function2
}.get(randomizer, default)()


> Date: Mon, 3 Jun 2013 20:39:28 -0700
> Subject: Beginner question
> From: eschneide...@comcast.net
> To: python-list@python.org
> 
> Is there a more efficient way of doing this? Any help is gratly appreciated.
> 
> 
> import random
> def partdeux():
> print('''A man lunges at you with a knife!
> Do you DUCK or PARRY?''')
> option1=('duck')
> option2=('parry')
> optionsindex=[option1, option2]
> randomizer=random.choice(optionsindex)
> while randomizer==option1:
> if input() in option1:
> print('he tumbles over you')
> break
> else:
> print('he stabs you')
> break
> while randomizer==option2:
> if input() in option2:
> print('you trip him up')
> break
> else:
> print('he stabs you')
> break
> partdeux()
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Apache and suexec issue that wont let me run my python script

2013-06-03 Thread Carlos Nepomuceno

> Date: Mon, 3 Jun 2013 17:23:16 -0600
> From: torr...@gmail.com
> To: python-list@python.org
> Subject: Re: Apache and suexec issue that wont let me run my python script
>
> On 06/03/2013 04:13 PM, Carlos Nepomuceno wrote:
>> '/var/log/httpd' is the default place for the Red Hat and CentOS 
>> installation of httpd.
>>
>> '/usr/local/apache/logs' is the default directory of the Apache httpd 
>> installation.
>>
>> httpd has probably been upgraded by 'make install'.
>
> Oh wow. What a mess. I think Nick needs to read a good book on Red Hat
> EL system administration. Think he needs to start over with a fresh
> install of CentOS and only install software that comes from a repo using
> yum until he learns what he's doing.
> --
> http://mail.python.org/mailman/listinfo/python-list

I did a httpd 'make install' on CentOS 6 and it worked fine. Needed a few 
tweaks that I don't remember though.

If you don't have any previous experience with Apache httpd settings I wouldn't 
try that on a production server.  
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: [RELEASED] Python 2.7.5

2013-06-03 Thread Carlos Nepomuceno
Thank you! :)


> To: python-list@python.org
> From: breamore...@yahoo.co.uk
[...]
>> What still doesn't work in Python 3?
>
> http://python3wos.appspot.com/
>
>>
>> Is Python 2.7.5 last (final, never to be updated) revision or will it still 
>> be supported?
>>
>
> http://www.python.org/dev/peps/pep-0373/
>
> --
> "Steve is going for the pink ball - and for those of you who are
> watching in black and white, the pink is next to the green." Snooker
> commentator 'Whispering' Ted Lowe.
>
> Mark Lawrence
>
> --
> http://mail.python.org/mailman/listinfo/python-list   
>   
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: How to get an integer from a sequence of bytes

2013-06-03 Thread Carlos Nepomuceno

> Date: Mon, 3 Jun 2013 15:41:41 -0700 
> Subject: Re: How to get an integer from a sequence of bytes 
> From: drsali...@gmail.com 
> To: python-list@python.org 
[...]
> Today though, it would be difficult to sell a conventional (Von  
> Neumann) computer that didn't have 8 bit bytes.  Quantum computers  
> would still sell if they were odd this way - they're going to be really  
> different anyway. 

Nowadays it would be a hard task to find a Von Neumann architecture machine.

Most of current CPUs are variants of the Harvard architecture: they separate 
instructions from data at the cache level.  
 
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: [RELEASED] Python 2.7.5

2013-06-03 Thread Carlos Nepomuceno

> From: na...@animats.com
> Subject: Re: [RELEASED] Python 2.7.5
> Date: Mon, 3 Jun 2013 12:20:43 -0700
[...]
> 3.x is a different language, with different libraries, and lots of
> things that still don't work. Many old applications will never
> be converted.
>
> John Nagle

What still doesn't work in Python 3?

Is Python 2.7.5 last (final, never to be updated) revision or will it still be 
supported? 
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Source code as text/plain

2013-06-03 Thread Carlos Nepomuceno

> Date: Mon, 3 Jun 2013 09:06:46 +1000
> From: c...@zip.com.au
> To: c...@rebertia.com
[...]
> http://hg.python.org/cpython/raw-file/tip/Lib/string.py

What's the 'tip' tag? 
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Apache and suexec issue that wont let me run my python script

2013-06-03 Thread Carlos Nepomuceno

> From: a...@sci.fi
> Subject: Re: Apache and suexec issue that wont let me run my python script
> Date: Mon, 3 Jun 2013 18:20:00 +0300
> To: python-list@python.org
>
> Νικόλαος Κούρας  writes:
>
>> [code]
>> root@nikos [/home/nikos/www/cgi-bin]# chmod g+w /var/log/httpd/suexec.log
>> root@nikos [/home/nikos/www/cgi-bin]# ls -l /var/log/httpd/suexec.log
>> -rw-rw-r-- 1 root root 0 Jun 1 02:52 /var/log/httpd/suexec.log
>> [/code]
>>
>>
>> and still iam receiving the same error.
>
> What did you hope to accomplish with this second chmod? Nobody is in the
> root group except root. I hope. My guess based on very minimal Googling
> on the topic is you should change the group of /var/log/httpd/suexec.log
> to apache.
>
> Then again, I have no idea why you have both
> /usr/local/apache/logs/suexec_log and /var/log/httpd/suexec.log, but the
> former apparently has some data in it and the latter does not so
> changing permissions on /var/log/httpd/suexec.log may not help...

'/var/log/httpd' is the default place for the Red Hat and CentOS installation 
of httpd.

'/usr/local/apache/logs' is the default directory of the Apache httpd 
installation.

httpd has probably been upgraded by 'make install'.

> Oh, apparently suexec prints its config if you run suexec -V, so include
> that output if you still have problems.
> --
> http://mail.python.org/mailman/listinfo/python-list   
>   
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: [Python-Dev] New FreeBSD 10.0-CURRENT buildbot

2013-06-03 Thread Carlos Nepomuceno

> Date: Sun, 2 Jun 2013 13:43:24 -0700 
> Subject: Re: [Python-Dev] New FreeBSD 10.0-CURRENT buildbot 
> From: drsali...@gmail.com 
> To: carlosnepomuc...@outlook.com 
> CC: python-...@python.org 
>  
>  
> On Sun, Jun 2, 2013 at 12:51 PM, Carlos Nepomuceno  
> mailto:carlosnepomuc...@outlook.com>>  
> wrote: 
>  
> > Date: Sun, 2 Jun 2013 15:12:43 +1000 
> > From: koobs.free...@gmail.com<mailto:koobs.free...@gmail.com> 
> > To: python-...@python.org<mailto:python-...@python.org> 
> > Subject: [Python-Dev] New FreeBSD 10.0-CURRENT buildbot 
> [...] 
> > koobs-freebsd10-amd64 (clang is default here) 
>  
>  
> Does CPython code compiled with clang runs faster than gcc? 
>  
> Why did you chose clang? Any benchmarks? Any benefits? 
>  
> Clang is sometimes favored over gcc for its non-GPL license; I believe  
> the FreeBSD project sees this as an important issue. 
>  
> In general, the more C compilers a piece of C code compiles on, the  
> fewer bugs are left in it, because different C compilers tend to catch  
> different problems - even with cranked up warnings. 
>

I've been to a Clang presentation and one of the important features they've 
shown were the improved error messages.

But I didn't try it yet.  
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-02 Thread Carlos Nepomuceno
Hey guys! Come on!!!

Repeat with me: "Googsfraba!"

http://www.youtube.com/watch?v=Fscuv4PIjws

lol


> To: python-list@python.org
> From: breamore...@yahoo.co.uk
> Subject: Re: Changing filenames from Greeklish => Greek (subprocess complain)
> Date: Sun, 2 Jun 2013 16:24:10 +0100
>
> On 02/06/2013 16:04, Νικόλαος Κούρας wrote:
>> Τη Κυριακή, 2 Ιουνίου 2013 5:51:31 μ.μ. UTC+3, ο χρήστης Mark Lawrence 
>> έγραψε:
>>
>>> You've obviously arrived very late at the party.
>>
>> Apart from the "funny" commenting, can you for once contribute towards to an 
>> actual solution or this is the best you can do to prove yourself smart in 
>> here by talking down on me?
>>
>
> The only thing I'll contribute is that if you're looking to run a
> commercial venture, you wouldn't be the last on my list for services,
> you'd never get on it.
>
> Further I'll point out that you never give any indication at all of ever
> doing any research before you ask a question. You simply fire off email
> after email in the hope that you'll get a response. Luckily for you a
> substantial number of people have come to your rescue. Unfortunately
> for you, you've exhausted the patience of a number who might well have
> been extremely helpful *IF* you'd put in a little effort. That is just
> too much to ask of course.
>
> --
> "Steve is going for the pink ball - and for those of you who are
> watching in black and white, the pink is next to the green." Snooker
> commentator 'Whispering' Ted Lowe.
>
> Mark Lawrence
>
> --
> http://mail.python.org/mailman/listinfo/python-list   
>   
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Python Magazine

2013-06-01 Thread Carlos Nepomuceno

> Date: Fri, 31 May 2013 04:11:06 -0700
> Subject: Re: Python Magazine
> From: rama29...@gmail.com
> To: python-list@python.org
>
> Hello all,
> Was busy with work. Finally finished the job of registering the domain name.
> Will be live soon. The url is http://pythonmagazine.org. Hope we will be live 
> soon.
> Regards,
> DRJ.
> --
> http://mail.python.org/mailman/listinfo/python-list

Nice! Wish you luck!

Do you have sponsors? Advertisers? What's the plan? 
  
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Short-circuit Logic

2013-06-01 Thread Carlos Nepomuceno

> From: steve+comp.lang.pyt...@pearwood.info
> Subject: Re: Short-circuit Logic
> Date: Fri, 31 May 2013 08:45:13 +
> To: python-list@python.org
>
> On Fri, 31 May 2013 17:09:01 +1000, Chris Angelico wrote:
>
>> On Fri, May 31, 2013 at 3:13 PM, Steven D'Aprano
>>  wrote:
>>> What makes you think that the commutative law is relevant here?
>>>
>>>
>> Equality should be commutative. If a == b, then b == a. Also, it's
>> generally understood that if a == c and b == c, then a == b, though
>> there are more exceptions to that (especially in loosely-typed
>> languages).
>
> Who is talking about equality? Did I just pass through the Looking Glass
> into Wonderland again? *wink*
>
> We're talking about *approximate equality*, which is not the same thing,
> despite the presence of the word "equality" in it. It is non-commutative,
> just like other comparisons like "less than" and "greater than or equal
> to". Nobody gets their knickers in a twist because the>= operator is non-
> commutative.

Approximately equality CAN be commutative! I have just showed you that in the 
beginning using the following criteria:

|v-u| <= ε*max(|u|,|v|)

Which is implemented as fpc_aeq():

def fpc_aeq(u,v,eps=sys.float_info.epsilon):
    au=abs(u)
    av=abs(v)
    return abs(v-u) <= (eps*(au if au>av else av))  # |v-u| <= ε*max(|u|,|v|)


> Approximate equality is not just non-commutative, it's also intransitive.
> I'm reminded of a story about Ken Iverson, the creator of APL. Iverson
> was a strong proponent of what he called "tolerant equality", and APL
> defined the = operator as a relative approximate equal, rather than the
> more familiar exactly-equal operator most programming languages use.
>
> In an early talk Ken was explaining the advantages of tolerant
> comparison. A member of the audience asked incredulously,
> “Surely you don’t mean that when A=B and B=C, A may not equal C?”
> Without skipping a beat, Ken replied, “Any carpenter knows that!”
> and went on to the next question. — Paul Berry

That's true! But it's a consequence of floating points (discretes representing 
a continuous set -- real numbers).
Out of context, as you put it, looks like approximate equality is 
non-commutative, but that's wrong.

Did you read the paper[1] you have suggested? Because SHARP APL in fact uses 
the same criteria I have mentioned and it supports it extensively to the point 
of applying it by default to many primitive functions, according to Lathwell[2] 
wich is reference 19 of [1].

"less than      ab
not equal           a≠b
floor       ⌊a
ceiling         ⌈a
membership      a∊b
index of        a⍳b"


I'll quote Lathwell. He called "tolerant comparison" what we are now calling 
"approximate equality".

"Tolerant comparison considers two numbers to be equal if they are within some 
neighborhood. The neighborhood has a radius of ⎕ct times the larger of the two 
in absolute value."

He says "larger of the two" which means "max(|u|,|v|)". So, you reference just 
reaffirms what TAOCP have demonstrated to be the best practice.

I really don't know what the fuck you are arguing about?

Can you show me at least one case where the commutative law wouldn't benefit 
the use of the approximate equality operator?

[1] http://www.jsoftware.com/papers/APLEvol.htm
[2] http://www.jsoftware.com/papers/satn23.htm


> The intransitivity of [tolerant] equality is well known in
> practical situations and can be easily demonstrated by sawing
> several pieces of wood of equal length. In one case, use the
> first piece to measure subsequent lengths; in the second case,
> use the last piece cut to measure the next. Compare the lengths
> of the two final pieces.
> — Richard Lathwell, APL Comparison Tolerance, APL76, 1976
>
> See also here:
>
> http://www.jsoftware.com/papers/APLEvol.htm
>
> (search for "fuzz" or "tolerance".
>
>
>
> --
> Steven
> --
> http://mail.python.org/mailman/listinfo/python-list   
>   
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Short-circuit Logic

2013-05-30 Thread Carlos Nepomuceno

> From: steve+comp.lang.pyt...@pearwood.info
> Subject: Re: Short-circuit Logic
> Date: Fri, 31 May 2013 05:13:51 +
> To: python-list@python.org
>
> On Fri, 31 May 2013 00:03:13 +0300, Carlos Nepomuceno wrote:
>
>> 
>>> From: steve+comp.lang.pyt...@pearwood.info Subject: Re: Short-circuit
>>> Logic
>>> Date: Thu, 30 May 2013 05:42:17 + To: python-list@python.org
>> [...]
>>> Here's another way, mathematically equivalent (although not necessarily
>>> equivalent using floating point computations!) which avoids the
>>> divide-by- zero problem:
>>>
>>> abs(a - b) < epsilon*a
>>
>> That's wrong! If abs(a) < abs(a-b)/epsilon you will break the
>> commutative law. For example:
>
> What makes you think that the commutative law is relevant here?

How can't you see?

I'll requote a previous message:

}On Thu, 30 May 2013 13:45:13 +1000, Chris Angelico wrote:
} 
}> Let's suppose someone is told to compare floating point numbers by
}> seeing if the absolute value of the difference is less than some
}> epsilon. 
} 
}Which is usually the wrong way to do it! Normally one would prefer 
}*relative* error, not absolute:
 
Since we are considering Chris's supposition ("to compare floating point 
numbers") it's totally relevant to understand how that operation can be 
correctly implemented.


> Many things break the commutative law, starting with division and
> subtraction:
>
> 20 - 10 != 10 - 20
>
> 1/2 != 2/1
>
> Most comparison operators other than equality and inequality:
>
> (23 < 42) != (42 < 23)
>
> String concatenation:
>
> "Hello" + "World" != "World" + "Hello"
>
> Many operations in the real world:
>
> put on socks, then shoes != put on shoes, then socks.
>

That's is totally irrelevant in this case. The commutative law is essential to 
the equality operation.

> But you are correct that approximately-equal using *relative* error is
> not commutative. (Absolute error, on the other hand, is commutative.) As
> I said, any form of "approximate equality" has gotchas. But this gotcha
> is simple to overcome:
>
> abs(a -b) < eps*max(abs(a), abs(b))
>
> (Knuth's "approximately equal to" which you give.)
>
>
>> This discussion reminded me of TAOCP and I paid a visit and bring the
>> following functions:
>
> "TAOCP"?

The Art of Computer Programming[1]! An old book full of excellent stuff! A MUST 
READ ;)

http://www-cs-faculty.stanford.edu/~uno/taocp.html

[1] Knuth, Donald (1981). The Art of Computer Programming. 2nd ed. Vol. 2. p. 
218. Addison-Wesley. ISBN 0-201-03822-6.

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


RE: Short-circuit Logic

2013-05-30 Thread Carlos Nepomuceno

> To: python-list@python.org
> From: wlfr...@ix.netcom.com
> Subject: Re: Short-circuit Logic
> Date: Thu, 30 May 2013 19:38:31 -0400
>
> On Thu, 30 May 2013 08:48:59 -0400, Roy Smith  declaimed
> the following in gmane.comp.python.general:
>
>>
>> Analysis of error is a complicated topic (and is much older than digital
>> computers). These sorts of things come up in the real world, too. For
>> example, let's say I have two stakes driven into the ground 1000 feet
>> apart. One of them is near me and is my measurement datum.
>>
>> I want to drive a third stake which is 1001 feet away from the datum.
>> Do I measure 1 foot from the second stake, or do I take out my
>> super-long tape measure and measure 1001 feet from the datum?
>
> On the same azimuth? Using the "super long tape" and ensuring it
> traverses the 1000 foot stake is probably going to be most accurate --
> you only have the uncertainty of the positioning of the tape on the
> datum, and the small uncertainty of azimuth over the 1000 foot stake.
> And even the azimuth error isn't contributing to the distance error.
>
> Measuring 1 foot from the 1000 foot stake leaves you with any error
> from datum to the 1000 foot, plus any error from the 1000 foot, PLUS any
> azimuth error which would contribute to shortening the datum distance.

Just because you have more causes of error doesn't mean you have lesser 
accurate measures.

If fact, errors may compensate each other. It all depends on the bias 
(accuracy) and variation (precision) involved in the measurements you are 
considering.

> --
> Wulfraed Dennis Lee Bieber AF6VN
> wlfr...@ix.netcom.com HTTP://wlfraed.home.netcom.com/
>
> --
> http://mail.python.org/mailman/listinfo/python-list   
>   
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Building a HPC data assimilation system using Python?

2013-05-30 Thread Carlos Nepomuceno
Hi Matthew! I'm on a similar quest!

I'm still learning the basics of Python so I may not be a good source of 
information.

I'm reading a lot of stuff about how to use Python for the parallelization of 
code and data and found BSP[1] to be very interesting and perhaps worth the 
time to learn it! ;)


[1] http://www.multicorebsp.com/




> Date: Wed, 29 May 2013 21:27:54 -0700
> Subject: Building a HPC data assimilation system using Python?
> From: mattjamesfran...@gmail.com
> To: python-list@python.org
>
> I have a prototype data assimilation code ( an ionospheric nowcast/forecast 
> model driven by GPS data ) that is written in IDL (interactive data language) 
> which is a horrible language choice for scaling the application up to large 
> datasets as IDL is serial and slow (interpreted).
>
> I am embarking on a project to convert this prototype into an operational 
> parallel HPC code. In the past I've used C++ for this kind of project and am 
> comfortable using MPI. On the other hand, I've recently started using python 
> and appreciate the flexibility and speed of development using python compared 
> with C++. I have read that there is a trend to use python as the high level 
> 'glue' for these kind of large number crunching projects, so it would seem 
> appropriate to go down that path. There are a number of C++ and FORTRAN(!) 
> libraries I'd need to incorporate that handle things such as the processing 
> of raw GPS data and computing ionospheric models, so I'd need to be able to 
> make the appropriate interface for these into python.
>
> If anyone uses python is this way, I'd appreciate any tips, hints, things to 
> be careful about and in general any war stories you can relate that you wish 
> you'd heard before making some mistake.
>
> Here are the things I have investigated that it looks like I'd probably need 
> to use:
>
> * scipy/numpy/matplotlib
> * Cython (or pyrex?) for speeding up any bottlenecks that occur in python 
> code (as opposed to C++/FORTRAN libraries)
> * MPI for Python (mpi4py). Does this play nice with Cython?
> * Something to interface python with other language libraries. ctypes, swig, 
> boost? Which would be best for this application?
> * Profiling. profile/cprofile are straightforward to use, but how do they 
> cope with a parallel (mpi4py) code?
> * If a C++ library call has its own MPI calls, does that work smoothly with 
> mpi4py operating in the python part of the code?
>
> Sorry if some of this is a little basic, I'm trying to get up to speed on 
> this a quick as I can.
>
> Thanks in advance!
> --
> http://mail.python.org/mailman/listinfo/python-list   
>   
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Python toplevel in a Web page

2013-05-30 Thread Carlos Nepomuceno

> From: nob...@nowhere.org
> Subject: Python toplevel in a Web page
> Date: Thu, 30 May 2013 14:20:18 +0200
> To: python-list@python.org
>
> Hello,
> I wonder if I can find some source code example
> of a Python 3 toplevel box in a Web page.
> Something simple, no mySQL, no Django hammer, etc.
> Just the basics of the technology to get the
> content of a small text editor in which the user

Do you mean HTML  element?

> writes some Python script, to be analyzed (eval'ed)
> then whose result is to be written in another text box.

Analyzed by the browser or server side?

> Simple, pythonistic.
> Thanks for the pointer,
>
> franck
> --
> http://mail.python.org/mailman/listinfo/python-list   
>   
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Short-circuit Logic

2013-05-30 Thread Carlos Nepomuceno

> From: steve+comp.lang.pyt...@pearwood.info
> Subject: Re: Short-circuit Logic
> Date: Thu, 30 May 2013 05:42:17 +
> To: python-list@python.org
[...]
> Here's another way, mathematically equivalent (although not necessarily
> equivalent using floating point computations!) which avoids the divide-by-
> zero problem:
>
> abs(a - b) < epsilon*a

That's wrong! If abs(a) < abs(a-b)/epsilon you will break the commutative law. 
For example:

import sys
eps = sys.float_info.epsilon
def almost_equalSD(a,b):
    return abs(a-b) < eps*a

#special case
a=1
b=1/(1-eps)
almost_equalSD(a,b) == almost_equalSD(b,a)

Returns False.

This discussion reminded me of TAOCP and I paid a visit and bring the following 
functions:


#Floating Point Comparison Operations
#Knuth, Donald (1981). The Art of Computer Programming. 2nd ed. Vol. 2. p. 218. 
Addison-Wesley. ISBN 0-201-03822-6.
import sys

#floating point comparison: u ≺ v(ε) "definitely less than" (definition 21)
def fpc_dlt(u,v,eps=sys.float_info.epsilon):
    au=abs(u)
    av=abs(v)
    return (v-u)> (eps*(au if au>av else av))  # v-u> ε*max(|u|,|v|)

#floating point comparison: u ~ v(ε) "approximately equal to" (definition 22)
def fpc_aeq(u,v,eps=sys.float_info.epsilon):
    au=abs(u)
    av=abs(v)
    return abs(v-u) <= (eps*(au if au>av else av))  # |v-u| <= ε*max(|u|,|v|)

#floating point comparison: u ≻ v(ε) "definitely greater than" (definition 23)
def fpc_dgt(u,v,eps=sys.float_info.epsilon):
    au=abs(u)
    av=abs(v)
    return (u-v)> (eps*(au if au>av else av))  # u-v> ε*max(|u|,|v|)

#floating point comparison: u ≈ v(ε) "essentially equal to" (definition 24)
def fpc_eeq(u,v,eps=sys.float_info.epsilon):
    au=abs(u)
    av=abs(v)
    return abs(v-u) <= (eps*(au if au
> Whichever method you choose, there are gotchas to watch out for.
>
>> http://xkcd.com/1047/
>
> Nice!
>
>
> --
> Steven
> --
> http://mail.python.org/mailman/listinfo/python-list   
>   
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Piping processes works with 'shell = True' but not otherwise.

2013-05-29 Thread Carlos Nepomuceno

> From: nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de
> Subject: Re: Piping processes works with 'shell = True' but not otherwise.
> Date: Wed, 29 May 2013 19:39:40 +0200
> To: python-list@python.org
>
> Am 27.05.2013 02:14 schrieb Carlos Nepomuceno:
>> pipes usually consumes disk storage at '/tmp'.
>
> Good that my pipes don't know about that.
>
> Why should that happen?
>
>
> Thomas
> --
> http://mail.python.org/mailman/listinfo/python-list

Ooops! My mistake! We've been using 'tee' when in debugging mode and I though 
that would apply to this case. Nevermind!   

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


RE: Python #ifdef

2013-05-28 Thread Carlos Nepomuceno

> Date: Tue, 28 May 2013 18:25:59 -0400 
> Subject: Re: Python #ifdef 
> From: joel.goldst...@gmail.com 
> To: breamore...@yahoo.co.uk 
> CC: python-list@python.org 
[...]
>  
> my original response was from cell phone.  I just answered that you  
> can't do ifdefs, implying that there is no preprocessor in python.  I  
> learned a lot of things I didn't know reading the thread, but I wonder  
> if it is a good idea in general to try to write code like this.  --  
> combined 2.x/3.x codebase can be a bear to maintain.  I wouldn't do it  
> unless there was some imposing reason that I must.  Its not just  
> print() -- that isn't bad, but changes in module names (urllib),  
> arithmetic, and unicode especially make this idea in general, very  
> tricky.  Pity the next developer who needs to try to maintain it. 
>  
> So, maybe you CAN do it, but SHOULD you want to do it? 
>  
> --  
> Joel Goldstick 
> http://joelgoldstick.com 


Thanks Joel! In this case I think it does because I would like to have the same 
short benchmarking script to be runnable by Python 2 and Python 3.

The only piece of code that doesn't run on Python 2 is a to_bytes() single 
call. So it's not a huge maintenance load. ;)

I didn't try to write 'portable' code to Python 3 yet. What's the catch?
  
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Future standard GUI library

2013-05-28 Thread Carlos Nepomuceno

> From: felip...@gmx.net
> Subject: Re: Future standard GUI library
> Date: Tue, 28 May 2013 19:26:55 +0200
> To: python-list@python.org
>
>> Please give me an example of a "suitable transport layer for a RPC
>> protocol".
>
> I won't give you an example, but just some very basic criteria:
>
> - It must be very efficient for very small "datagrams"

Interoperability is much more expensive than efficiency. That's why you won't 
get the most optimized protocol for speed or size.

> - It must provide connections

What do you mean?

> - For asynchronous programming it must provide for callbacks
> No RPC-over-HTTP protocol that I know of does this.

XHR implements asynchronous callbacks over HTTP.

> Besides, no one needs RPC just to logically separate GUI and
> application layer. And between application logic and database, you use
> the native database API for the RDBMS in question, of course.
>
> The whole idea to centralise application logic (and even the GUI with
> "web applications") is backwards, it dates from the 70s/early 80s when
> desktop computers weren't able to run application logic. Today, to make
> an application responsive (minimise latencies and maximise throughput),
> it's just obvious to *de*-centralise as much as possible. In fact,
> if Postgres-R was available for production, you could even distribute
> the persistence and run an entirely "serverless" application.

"web applications" is so nowadays! All of my recent software development 
projects (last 10 years) focus on business processes integration.
In all of them the BLL (Business Logic Layer), or "application logic", is run 
on server side (as a controller in MVC) due to security and performance reasons.
None of my clients want their business rules and internal workflows exposed, so 
the old ways of the 70/80's ain't gonna change.

> Sincerely,
>
> Wolfgang
> --
> http://mail.python.org/mailman/listinfo/python-list   
>   
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Python #ifdef

2013-05-28 Thread Carlos Nepomuceno

> From: invalid@invalid.invalid
> Subject: Re: Python #ifdef
> Date: Tue, 28 May 2013 20:42:34 +
> To: python-list@python.org
[...]
> Here's the important lesson from this thread:
>
> Instead of asking "how do I write X in Python" where yoy've assumed X
> is the solution to your problem, you're usually better off asking how
> to solve the underlying problem in a Pythonic way.
>
> IOW, instead of asking about a Python preprocessor (which you have
> assumed is the solution to the problem because that's how you would do
> it in C), ask about the actual problem (how to define a function
> differently depending on Python version).
>
> People on this list are very inventive and will expend a surprising
> amount of time to figure out often too-clever ways to do X because you
> asked how to do X -- even if doing X is a lousy way to solve your
> actual problem...
>
> When asking how do I solve a problem, it's OK to illustrate that
> question with an example X of how you would solve it in C or Java or
> Ruby or Perl or whatever, but remember
>
> 1) Not everybody here knows C or Java or Ruby or Perl or whatever,
> and the person who _does_ know everyting there is to know about
> solving some particular underlying problem isn't going to go
> learn a new language so that they can understand your example and
> figure out what you're trying to accomplish.
>
> 2) Programming languages differ. X may be the best way to solve the
> problem in one language, but it might be an awful way to do it in
> another language.
>
> --
> Grant Edwards grant.b.edwards Yow! I'm ANN LANDERS!!
> at I can SHOPLIFT!!
> gmail.com


You're right! Sometimes I hate myself for doing exactly the opposite of what I 
would like to do!

Unfortunately I can't change the thread subject.

How do you have "invalid@invalid.invalid" instead of your email address?
  
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Python #ifdef

2013-05-28 Thread Carlos Nepomuceno

> Date: Tue, 28 May 2013 21:34:36 +0100 
> Subject: RE: Python #ifdef 
> From: fabiosantos...@gmail.com 
> To: carlosnepomuc...@outlook.com 
> CC: python-list@python.org 
>  
>  
> On 28 May 2013 21:26, "Carlos Nepomuceno"  
> mailto:carlosnepomuc...@outlook.com>>  
> wrote: 
> > Haha! That's it!!! 
> > 
> > Just realized how funny this can be: ;) 
> > 
> > ### never to be opened ### 
> > def pandoras_box(v): 
> > return v/0.0 
> > 
> > if customer_didnt_pay(): 
> > pandoras_box() 
> > 
> > #lol 
>  
> 1/0 is, after print, my most common debug statement.

What's the best debugger for Python? Have you tried HAP[1]?

[1] http://hapdebugger.sourceforge.net/ 
  
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Python #ifdef

2013-05-28 Thread Carlos Nepomuceno

> From: invalid@invalid.invalid
> Subject: Re: Python #ifdef
[...]
> You're trying to make this a lot harder than it really is:
>
> if sys.version_info[0] == 3:
> def original(n):
> m = 0
> for b in n.to_bytes(6, 'big'):
> m = 256*m + b
> return m
> else:
> def original(n):
> 
>
>
> --
> Grant Edwards grant.b.edwards Yow! Am I having fun yet?
> at
> gmail.com

Haha! That's it!!!

Just realized how funny this can be: ;)

### never to be opened ###
def pandoras_box(v):
    return v/0.0

if customer_didnt_pay():
    pandoras_box()

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


RE: Python #ifdef

2013-05-28 Thread Carlos Nepomuceno
Thank you! I made it run like the following. What do you think about that? IS 
there a better way?



#The following runs on Python 2.7
sc3='''
# Python 3
def original(n):
    m = 0
    for b in n.to_bytes(6, 'big'):
    m = 256*m + b
    return m
'''
if sys.version_info[0] == 3:
    exec(sc3) 
-- 
http://mail.python.org/mailman/listinfo/python-list


Python #ifdef

2013-05-28 Thread Carlos Nepomuceno
Are there Python 'preprocessor directives'?

I'd like to have something like '#ifdef' to mix code from Python 2 and 3 in a 
single file.

Is that possible? How?
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Short-circuit Logic

2013-05-28 Thread Carlos Nepomuceno

> Date: Tue, 28 May 2013 01:39:09 -0700
> Subject: Re: Short-circuit Logic
> From: abdulsh...@gmail.com
[...]
>> What Steven wrote is entirely correct: sys.float_info.epsilon is the
>>
>> smallest value x such that 1.0 and 1.0+x have distinct floating-point
>>
>> representations. It has no relevance for comparing to zero.
>
> He just said that the way to test for zero equality is x == 0, and I meant 
> that this is true for integers but not necessarily for floats. And that's not 
> specific to Python.


Have you read [1]? There's a section "Infernal Zero" that discuss this problem. 
I think it's very interesting to know! ;)

Just my 49.98¢! lol


[1] 
http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/

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


  1   2   3   >