Re: Which module I'm missing?

2014-09-25 Thread Igor Korot
Thanx Dieter.


On 9/24/14, dieter  wrote:
> Igor Korot  writes:
>> I got a suggestion to install eric for my developmental needs.
>> Unfortunately, it looks like my Linux distribution have a bug as
>> running eric throws an exception.
>>
>> [code]
>> igor@IgorDellGentoo ~/plaso-build/liblnk-20140905 $ eric5
>> An unhandled exception occurred. Please report the problem
>> using the error reporting dialog or via email to
>> .
>> A log has been written to "/home/igor/.eric5/eric5_error.log".
>>
>> Error information:
>> 
>> 2014-09-21, 07:56:26
>> 
>> :
>> No module named 'DebugClients.Python3.coverage'
>
> This tells you that "DebugClients.Python3.coverage" could not
> be imported. The real problem might be "DebugClients"
> or "DebugClients.Python3" or "DebugClients.Python2.coverage".
> To find out, import those packages/modules in an interactive
> Python interpreter session in turn. The first failing import
> indicates the real problem.
>
> If "DebugClients" is the culprit, then either the package is
> not installed or not covered by "sys.path" (the envvar "PYTHONPATH").
> You might try "locate DebugClients" to see whether "DebugClients" is
> somewhere
> on your file system.
>
> The installation instructions for "eric" might tell you something
> about package or configuration dependencies.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Python Imaging Library 1.x - 64bit setup file for Python 2.7.2.

2014-09-25 Thread Pinter, Karina /C
Dear Team,

I am working as a software analyst at ExxonMobil. I received a software request 
for Python Imaging Library 1.x and the user needs a 64bit setup file for Python 
2.7.2. Can I download it somewhere?

Thanks in advance.


Best Regards,

Karina Pinter
ExxonMobil BSC Hungary Kft.
Software Analyst
EMIT / IT Operations / Customer Infrastructure / IT Asset Management
H-1139 Budapest, Váci út 81-85. Phone: +36 1 298 5361
[cid:image001.png@01CFD8A8.777C8BB0]

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


Re: ThreadPoolExecutor - callback guaranteed to run in same thread as the submitted function?

2014-09-25 Thread Marko Rauhamaa
Ian Kelly :

> The documentation for Future.add_done_callback says: "If the future
> has already completed or been cancelled, fn will be called
> immediately."

That sounds really bad.

There should be a guarantee that the callback is not called from the
same thread before returning from Future.add_done_callback. Otherwise,
the caller may have a really difficult time handling preemption and
avoiding deadlocks at the same time.

Example (pseudocode):

   def callback(self):
  with self.lock:
  ...

   def xyz(self, f):
  with self.lock:
  ...
  f.add_done_callback(self.callback)

The code will deadlock if the callback is invoked immediately.


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


Re: Python Imaging Library 1.x - 64bit setup file for Python 2.7.2.

2014-09-25 Thread Vincent Vande Vyvre

Le 25/09/2014 10:07, Pinter, Karina /C a écrit :


Dear Team,

I am working as a software analyst at ExxonMobil. I received a 
software request for Python Imaging Library 1.x and the user needs a 
64bit setup file for Python 2.7.2. Can I download it somewhere?


Thanks in advance.

*/Best Regards,/*

*/
Karina Pinter/**
**/ExxonMobil BSC Hungary Kft./*
/Software Analyst/
/EMIT / IT Operations / Customer Infrastructure / IT Asset Management/*//*

/H-1139 Budapest, Váci út 81-85. Phone/: +36 1 298 5361

cid:image001.png@01CEF5B8.F78ACF20




for Windows I presume, have a look here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow
--
https://mail.python.org/mailman/listinfo/python-list


Re: GCD in Fractions

2014-09-25 Thread Akira Li
Mark Lawrence  writes:

> On 24/09/2014 12:14, Mark Dickinson wrote:
>> Mark Lawrence  yahoo.co.uk> writes:
>>> Somebody got there first http://bugs.python.org/issue22477
>>
>> I think there's good reason to suspect that Brian Gladman and
>> blindanagram are one and the same. :-)
>>
> sorted("BrianGladman".lower()) == sorted("blindanagram")
>> True
>>
>
> Is that considered proof that I still reign supreme as the most
> unobservant person on the planet? :)

It might mean that you are *too observant* because I've noticed that
the order of the letters is different just now.

http://english.stackexchange.com/questions/8628/is-it-true-that-only-the-positions-of-the-first-and-last-letter-in-a-word-matter

[spoiler: it is not true in general but brains can do a lot of
"error-correction" subconsciously]


--
Akira

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


Re: GCD in Fractions

2014-09-25 Thread Chris Angelico
On Thu, Sep 25, 2014 at 8:56 PM, Akira Li <4kir4...@gmail.com> wrote:
> It might mean that you are *too observant* because I've noticed that
> the order of the letters is different just now.
>
> http://english.stackexchange.com/questions/8628/is-it-true-that-only-the-positions-of-the-first-and-last-letter-in-a-word-matter
>
> [spoiler: it is not true in general but brains can do a lot of
> "error-correction" subconsciously]

It's definitely not true, and has been frequently debunked. But brains
do error-correct, and not just on the order of letters. I spend a lot
of time on MUDs, where the typographical quality is comparable to IRC;
those of you who hang out on #python can probably attest to the same
thing. When people type quickly, they make errors... and they're often
the same errors (one hand not on the home keys, two letters
transposed, omitted letters, etc). Those of us who hang out there tend
to get familiar enough with the errors to autocorrect them - and
sometimes not even notice them :)

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


how to execute the following command using python

2014-09-25 Thread pradeepatjob
Hi group,

 I am trying to mount a remote network to my Ubuntu system.  
 
The remote machine keeps on changes or it is given by the user whoever wants to 
use my script.
  
 so , user enters what to mount.

 I found following command and it is running successfully when I execute using 
shell. 

the command:
echo -e 'ubuntumachinepassword/\nremotemachinepasword' | sudo --stdin sshfs 
root@remoteip:/remotesystem/folder/  /localmountpoint / -o workaround=rename -o 
password_stdin -o allow_other

but when i used this in
os.system(abovecommad)
 i was not successfull.

 any help on this?

thanks & regards
Pradeep Kumar
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: String representations of numbers and approximate equality

2014-09-25 Thread Dave Angel
Chris Angelico  Wrote in message:
> On Thu, Sep 25, 2014 at 5:56 AM, Dave Angel  wrote:
>> Your definition is not nearly as concrete as you think. Is the
>>  first number considered to be exact, and we'll only check the
>>  second? Will the factor always be an int, and thus
>>  exact?
> 
> Apologies: the definition is concrete, just under-specified in the post.
> 
> No, both numbers are inexact; most notably, one third of the factor
> might be involved - both of these should be correct:
> 
> ["1.333", "40"]
> ["1.33", "40"]
> 
> But if it's easier to assume that one or t'other must be exact, that's
> fine too - I can just run the check twice, once each way.
> 

You could assume that the one with more significant digits is the
 exact one.

Another approach is to see if twiddling the last digit gets you
 from too high to too low. I used this approach to check a trig
 package I wrote in '75. An answer was close enough if twiddling
 the last digit changed the result value from too high to too low,
 or if twiddling the last digit of the argument did. I needed to
 go both ways because the curve sometimes had a slope greater than
 one.

Oh, and don't forget to set the precision of Decimal to a couple
 more than the sum of the digits. 


-- 
DaveA

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


Re: how to execute the following command using python

2014-09-25 Thread Chris Angelico
On Thu, Sep 25, 2014 at 10:28 PM,   wrote:
> echo -e 'ubuntumachinepassword/\nremotemachinepasword' | sudo --stdin sshfs 
> root@remoteip:/remotesystem/folder/  /localmountpoint / -o workaround=rename 
> -o password_stdin -o allow_other
>

This implies that you're embedding two passwords in the script, in
clear text. I suggest not doing this - it's actually easier that way.
All you need to do is permit passwordless access: first to sudo, then
to the remote machine.

Passwordless sudo access can be done either globally or for this one
specific password, via the sudoers file. You can find out how to do
that on the internet; it's not a Python issue. Passwordless SSH
(including sshfs) is usually done with a key pair - look up ssh-keygen
and the authorized_keys file (you put your public key into that file,
and access is granted without a password). Again, plenty of info about
that on the internet.

(Side point: I strongly recommend NOT granting access via the root
login. Even if you know what you're doing, even if you think you've
locked it down to just SFTP, even if you think it's granting read-only
access, I still say mounting root@anything is a dangerous thing to do.
And if you haven't locked it down, and are giving root shell access to
anyone who knows a password that's stored in clear text in a script...
you definitely shouldn't be doing that.)

Once you have that, all you need is to run this:

sudo sshfs root@remoteip:/remotesystem/folder /localmountpoint -o allow_other

and you might not even need "-o allow_other". Everything should just
work by itself - that's what I do with the Yosemite Project, with an
additional feature of automating the authorized_keys management (based
on IP address ranges that are permitted access).

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


Re: String representations of numbers and approximate equality

2014-09-25 Thread Chris Angelico
On Thu, Sep 25, 2014 at 10:40 PM, Dave Angel  wrote:
> Another approach is to see if twiddling the last digit gets you
>  from too high to too low. I used this approach to check a trig
>  package I wrote in '75. An answer was close enough if twiddling
>  the last digit changed the result value from too high to too low,
>  or if twiddling the last digit of the argument did. I needed to
>  go both ways because the curve sometimes had a slope greater than
>  one.

Ooh, that sounds clean. So, something like this:

if x * FACTOR > y:
reduce_last_digit_of_x
if x * FACTOR > y: error
otherwise do the opposite check

? That's pretty doable.

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


Re: cannot run a ruby script from a python script.

2014-09-25 Thread Shawn Bright
On Wednesday, September 24, 2014 6:57:34 PM UTC-5, Shawn Bright wrote:
> hello all. 
> 
> 
> 
> i have a linux computer that i use to run a GUI (wxGTK) program. In this 
> program, there is a call to run an external ruby script.
> 
> 
> 
> command = "ruby run_my_command.rb &" 
> 
> os.system(command)
> 
> 
> 
> however, when it runs, i get this in the terminal
> 
> sh: 1: ruby: not found
> 
> 
> 
> i had considered that the path to the executable was messed up or somesuch, 
> but when i just run python in the interpreter, it works fine.
> 
> 
> 
> also, i have another computer with identical hardware, same OS, same package 
> versions that it does work on also. This machine is to be a backup. 
> 
> 
> 
> Another note: When i run which ruby i get the path to the ruby executable. If 
> i use that in my code, it will run, however, it will not be able to find any 
> of the modules that i need for the ruby script to import.
> 
> 
> 
> example
> 
> 
> 
> command = "/path/to/ruby run_my_command.rb &" 
> 
> os.system(command) 
> 
> 
> 
> will run the ruby script, but the ruby script will not be able to import any 
> of it's modules.
> 
> 
> 
> 
> 
> thanks for any tips on this.

I tried this with the same results. 
I am executing the GUI program from a terminal. It is a data engine that only 
really can serve our company so no reason to create menu entries for it and 
such. 
It did try to execute the ruby code, but could not.

Thanks for your help.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ThreadPoolExecutor - callback guaranteed to run in same thread as the submitted function?

2014-09-25 Thread Ian Kelly
On Thu, Sep 25, 2014 at 3:46 AM, Marko Rauhamaa  wrote:
> Ian Kelly :
>
>> The documentation for Future.add_done_callback says: "If the future
>> has already completed or been cancelled, fn will be called
>> immediately."
>
> That sounds really bad.
>
> There should be a guarantee that the callback is not called from the
> same thread before returning from Future.add_done_callback. Otherwise,
> the caller may have a really difficult time handling preemption and
> avoiding deadlocks at the same time.
>
> Example (pseudocode):
>
>def callback(self):
>   with self.lock:
>   ...
>
>def xyz(self, f):
>   with self.lock:
>   ...
>   f.add_done_callback(self.callback)
>
> The code will deadlock if the callback is invoked immediately.

Easily solved using a re-entrant lock. Alternatively, one could use
synchronization to make sure the future can't complete until all
callbacks have been added. That would have the benefit of keeping the
callback processing on the same thread as the future, as the OP
wanted.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python as Windows Service

2014-09-25 Thread Nagy László Zsolt



*De :*Gmail [mailto:mrje...@gmail.com]
*Envoyé :* Wednesday, September 24, 2014 2:41 PM
*À :* Arulnambi Nandagoban
*Objet :* Re: Python as Windows Service

Also, this may work for you





NSSM installs an existing app as a service.


//Jean/



By the way, do we have support for creating a Windows Service for Python 
3 already? I know it was not working about 6 months ago. Does pywin32 
(PythonService.exe ?) still lack this feautue?


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: ThreadPoolExecutor - callback guaranteed to run in same thread as the submitted function?

2014-09-25 Thread Marko Rauhamaa
Ian Kelly :

> On Thu, Sep 25, 2014 at 3:46 AM, Marko Rauhamaa  wrote:
>> Example (pseudocode):
>>
>>def callback(self):
>>   with self.lock:
>>   ...
>>
>>def xyz(self, f):
>>   with self.lock:
>>   ...
>>   f.add_done_callback(self.callback)
>>
>> The code will deadlock if the callback is invoked immediately.
>
> Easily solved using a re-entrant lock.

Not easily. Your state transition might not be complete at the time of
the preemption. Many such issues can be resolved by moving the
preemptive function calls to the end of the critical section, but that
is not always possible, easy or taken into account.

If preemption needs to be prepared for, the real solution is:


   def xyz(self, f):
   with self.lock:
   ...
   def add_callback():
   f.add_done_callback(self.callback)
   self.executor.schedule(add_callback)

which is ugly, of course.

> Alternatively, one could use synchronization to make sure the future
> can't complete until all callbacks have been added. That would have
> the benefit of keeping the callback processing on the same thread as
> the future, as the OP wanted.

You can still keep the callback in the same thread if your executor is
tied to the the same thread as the calling function. That's the classic
event loop. The executor API should be independent of the implementation
(single vs multithreaded), but it should be able to guarantee that it
never makes callbacks preemptively.


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


Re: Python as Windows Service

2014-09-25 Thread Zachary Ware
On Thu, Sep 25, 2014 at 9:33 AM, Nagy László Zsolt  wrote:
> By the way, do we have support for creating a Windows Service for Python 3
> already? I know it was not working about 6 months ago. Does pywin32
> (PythonService.exe ?) still lack this feautue?

I can confirm that a Windows service can be created using the latest
py2exe (which supports Python 3.3+) with Python 3.4 and pywin32 build
219.  I assume that pythonservice.exe would also work, but I haven't
tried it on its own.

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


Re: ThreadPoolExecutor - callback guaranteed to run in same thread as the submitted function?

2014-09-25 Thread Ian Kelly
On Thu, Sep 25, 2014 at 8:47 AM, Marko Rauhamaa  wrote:
> Ian Kelly :
>
>> On Thu, Sep 25, 2014 at 3:46 AM, Marko Rauhamaa  wrote:
>>> Example (pseudocode):
>>>
>>>def callback(self):
>>>   with self.lock:
>>>   ...
>>>
>>>def xyz(self, f):
>>>   with self.lock:
>>>   ...
>>>   f.add_done_callback(self.callback)
>>>
>>> The code will deadlock if the callback is invoked immediately.
>>
>> Easily solved using a re-entrant lock.
>
> Not easily. Your state transition might not be complete at the time of
> the preemption. Many such issues can be resolved by moving the
> preemptive function calls to the end of the critical section, but that
> is not always possible, easy or taken into account.

Fair enough. In the simple example above, I see no harm in simply
moving the add_done_callback call outside (after) the "with self.lock"
block altogether. I can imagine more complex examples where the call
is further down the stack and harder to isolate from the lock,
although I would argue that's probably a code smell.

> If preemption needs to be prepared for, the real solution is:
>
>
>def xyz(self, f):
>with self.lock:
>...
>def add_callback():
>f.add_done_callback(self.callback)
>self.executor.schedule(add_callback)
>
> which is ugly, of course.

YMMV, but I think I would prefer to make the executor.schedule call be
the callback:

def callback(self, f):
with self.lock:
...

def xyz(self, f):
with self.lock:
...
f.add_done_callback(
functools.partial(self.executor.schedule, self.callback))
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ThreadPoolExecutor - callback guaranteed to run in same thread as the submitted function?

2014-09-25 Thread Chris Angelico
On Fri, Sep 26, 2014 at 1:40 AM, Ian Kelly  wrote:
> Fair enough. In the simple example above, I see no harm in simply
> moving the add_done_callback call outside (after) the "with self.lock"
> block altogether. I can imagine more complex examples where the call
> is further down the stack and harder to isolate from the lock,
> although I would argue that's probably a code smell.

I'd definitely call it code smell. What happens with this?

with lock:
def inner():
do_more_work()
f.add_done_callback(inner)

The lock's possibly released before the callback happens, or possibly
not, but either way, the code *looks* as if it's all happening inside
the "with lock" block. Recipe for confusion IMO.

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


Re: Flask and Python 3

2014-09-25 Thread Chris “Kwpolska” Warrick
On Wed, Sep 24, 2014 at 9:39 PM, Juan Christian
 wrote:
> On Wednesday, September 24, 2014, Chris “Kwpolska” Warrick
>  wrote:
>>
>> Learning from videos is the worst thing you can do.  Use the official
>> flask documentation at http://flask.pocoo.org/docs/0.10/quickstart/ —
>> it’s much friendlier than a video.
>>
>> Also, there is nothing to “learn” — just change the line, and you will
>> have more helpful errors.
>
>
> That's the way I always learned everything. I watch some video courses, read
> a book and read the official documentation altogether.
>
> My way can't work for you, but for me it's excellent. And you don't even
> know which video/course I'm talking about, so it's gross to tell that
> "videos are the worst thing"...

It doesn’t matter.  Here, have some wisdom, as provided by the top
Google hit for “video tutorials suck”:
https://news.ycombinator.com/item?id=4565615

The thing is, it’s text.  I suppose I could use some text-to-speech
software to provide you with a video tutorial version of that.

-- 
Chris “Kwpolska” Warrick 
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Imaging Library 1.x - 64bit setup file for Python 2.7.2.

2014-09-25 Thread Mark Lawrence

On 25/09/2014 09:07, Pinter, Karina /C wrote:

Dear Team,

I am working as a software analyst at ExxonMobil. I received a software
request for Python Imaging Library 1.x and the user needs a 64bit setup
file for Python 2.7.2. Can I download it somewhere?

Thanks in advance.

*/Best Regards,/*

*/
Karina Pinter/**
**/ExxonMobil BSC Hungary Kft./*
/Software Analyst/
/EMIT / IT Operations / Customer Infrastructure / IT Asset Management/*//*

/H-1139 Budapest, Váci út 81-85. Phone/: +36 1 298 5361

cid:image001.png@01CEF5B8.F78ACF20



Are you aware that PIL is no longer supported?  However a friendly fork 
is available see https://pypi.python.org/pypi/Pillow/2.5.3 where right 
at the bottom of a long page you'll find Pillow-2.5.3.win-amd64-py2.7.exe


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: Flask and Python 3

2014-09-25 Thread Juan Christian
On Thu, Sep 25, 2014 at 2:28 PM, Chris “Kwpolska” Warrick <
kwpol...@gmail.com> wrote:
>
> It doesn’t matter.  Here, have some wisdom, as provided by the top
> Google hit for “video tutorials suck”:
> https://news.ycombinator.com/item?id=4565615
>

Using your link, the first comment from user 'arocks':

" If you have been into teaching you would realize that there are different
kinds of learners. Some prefer verbal material, others prefer more visual,
while some others like written material. The vast majority however prefer a
combination of the above. While you can pour over tutorials on how to use
Emacs; just watching a video of a power user using Emacs gives you a
different impression. It is really a completely different experience.

Sometimes it is faster to produce a set of video tutorials than to prepare
well-written documentation. Hence they make a call. However, I agree that
written documentation is the best medium for long term (i.e. smaller,
searchable etc)

So, rather than asking for one medium of instruction to stop, I would
rather encourage the plurality. Let the end-user pick and choose whatever
he/she likes. "


As the guy said, and many others in the comments agree, "rather than asking
for one medium of instruction to stop, I would rather encourage the
plurality.", and indeed, I prefer plurality, I DO use the official doc, I
don't only see video-tutorials. You don't know me, you don't know my
learning process, so stop imposing what YOU think is right, because what's
right for YOU won't necessarily be for others. No matter what you say, it
won't change, don't try to standardize the learning process, you nor anyone
can do this.



> The thing is, it’s text.  I suppose I could use some text-to-speech
> software to provide you with a video tutorial version of that.


No, you can't, if you think a video tutorial is only that, I'm afraid to
tell that you only saw terrible courses/tutorials in your life.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Flask and Python 3

2014-09-25 Thread Chris Angelico
On Fri, Sep 26, 2014 at 4:18 AM, Juan Christian
 wrote:
> On Thu, Sep 25, 2014 at 2:28 PM, Chris “Kwpolska” Warrick
>  wrote:
>>
>> It doesn’t matter.  Here, have some wisdom, as provided by the top
>> Google hit for “video tutorials suck”:
>> https://news.ycombinator.com/item?id=4565615
>
>
> Using your link, the first comment from user 'arocks':
>
> " So, rather than asking for one medium of instruction to stop, I would rather
> encourage the plurality. Let the end-user pick and choose whatever he/she
> likes. "
>
>
> As the guy said, and many others in the comments agree, "rather than asking
> for one medium of instruction to stop, I would rather encourage the
> plurality.", and indeed, I prefer plurality, I DO use the official doc, I
> don't only see video-tutorials. You don't know me, you don't know my
> learning process, so stop imposing what YOU think is right, because what's
> right for YOU won't necessarily be for others. No matter what you say, it
> won't change, don't try to standardize the learning process, you nor anyone
> can do this.

Actually, what most of the comments are agreeing on is that videos
need their transcripts. Without them, they suck. Most videos don't
have any sort of transcript. Ergo, most videos suck.

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


Re: Flask and Python 3

2014-09-25 Thread Chris “Kwpolska” Warrick
On Thu, Sep 25, 2014 at 8:18 PM, Juan Christian
 wrote:
>> The thing is, it’s text.  I suppose I could use some text-to-speech
>> software to provide you with a video tutorial version of that.
>
>
> No, you can't, if you think a video tutorial is only that, I'm afraid to
> tell that you only saw terrible courses/tutorials in your life.

Go on, show me a good video tutorial.  One that is quick to consume,
and one I can come back to at any time I please (within reasonable
bounds).  I can just open a text-based tutorial and use my browser’s
search capabilities (or a Table of Contents or an index in an analog
book) to find the precise bit of knowledge I need.  You can’t easily
do that with video tutorials.

Also, video tutorials for code (as well as analog books) lack a very
important feature: copy-paste.  Nobody likes retyping large passages
of code.  Especially because it’s error-prone.

-- 
Chris “Kwpolska” Warrick 
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Flask and Python 3

2014-09-25 Thread Juan Christian
On Thu, Sep 25, 2014 at 3:23 PM, Chris Angelico  wrote:

> Actually, what most of the comments are agreeing on is that videos
> need their transcripts. Without them, they suck. Most videos don't
> have any sort of transcript. Ergo, most videos suck.


I'm not talking about "360p 3min kid's tutorial form Youtube" here, when I
say video tutorial, it's implied that every video that I talked about have
1. The source-code (if programming/code related), 2. The transcripts and in
some cases even 3. PDF version of the video. In this topic my code went
wrong because I did it on my own, and not crtlc/crtlv from the original
source-code, and it was a stupid typo error


On Thu, Sep 25, 2014 at 3:26 PM, Chris “Kwpolska” Warrick <
kwpol...@gmail.com> wrote:

> Also, video tutorials for code (as well as analog books) lack a very
> important feature: copy-paste.  Nobody likes retyping large passages
> of code.  Especially because it’s error-prone.


Coursera, edX, digitaltutors, tv.adobe, tutsplus and many other sites. But,
doesn't matter, if the person watching them is close minding and blindly
hate any type of video tutorial, all these sites, no matter how good they
are will suck for this person...


Any, I think you two fled the point here. I didn't create this topic in
order to talk about "video vs text", if you guy want to continue this waste
of time, create a topic and talk everything you want. I'm done here, as I
said, PLURALITY is the key thing, don't try to impose what you think is
right and wrong.

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


Re: Flask and Python 3

2014-09-25 Thread Chris Angelico
On Fri, Sep 26, 2014 at 3:28 AM, Chris “Kwpolska” Warrick
 wrote:
> It doesn’t matter.  Here, have some wisdom, as provided by the top
> Google hit for “video tutorials suck”:
> https://news.ycombinator.com/item?id=4565615

"""The online video medium may be great for bloggers, but when I'm
seeking information, everything else is a distraction."""

Not sure what "bloggers" means here. I blog in plain text, because I
believe it's the best medium for anything of importance. If you're
going to write something and then stand by it, and expect people to
respond with serious debate, text is by far the best way to convey
your point, if for one reason: quotability. Go ahead, make a video
response, and quote something someone else said! Easy, isn't it? No?
Hmm. Would you prefer to try quoting something from a text blog?

http://rosuav.blogspot.com/

Maybe you're offended by my stance on the Bible. Or maybe you think
Alice's Adventures In Down-Under-Land are worth talking about. Or
perhaps you think my review of The Merry Widow is unfair to your
sister's cousin's aunt who was in the cast. You can grab some of my
text, surround it with quote characters, copy and paste the link to my
blog, and make your own point. In five seconds, if you're used to it.
Even if you're really familiar with your tools, I doubt very much that
you can quote a video that quickly.

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


Re: Flask and Python 3

2014-09-25 Thread Chris Angelico
On Fri, Sep 26, 2014 at 4:35 AM, Juan Christian
 wrote:
> when I say video tutorial, it's implied that every video that I talked about
> have 1. The source-code (if programming/code related), 2. The transcripts
> and in some cases even 3. PDF version of the video.

I've almost never seen videos that have all of that - and certainly
not enough to *imply* that about the term.

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


Re: Dynamically swapping between two algorithms

2014-09-25 Thread Cameron Simpson

On 24Sep2014 00:48, Steven D'Aprano  
wrote:

I have a certain calculation which can be performed two radically different
ways. With the first algorithm, let's call it SHORT, performance is very
fast for small values of the argument, but terrible for large values. For
the second algorithm, LARGE, performance is quite poor for small values,
but excellent for large values.

To add to the complexity, I perform this calculation repeatedly, in a loop:

value = 1
while True:
   x = SHORT(value)  # Or should I use LARGE? Decisions, decisions...
   process(x)
   value += some_increment()
   if condition: break

Luckily, the value never gets smaller. So if I could somehow determine a
cut-over point, CUTOFF, I might write my loop like this:

value = 1
while True:
   f = SHORT if value < CUTOFF else LARGE
   x = f(value)
   process(x)
   value += some_increment()
   if condition: break

alas, the CUTOVER point is likely to be machine-dependent. Take it as a
given that inserting a fixed CUTOVER point into the source code (say,
``CUTOVER = 123456``) is not likely to be very effective, and dynamically
calculating it at import time is impractical.


I have two suggestions. The first suggestion presumes multiple CPUs, and is a 
bit of a brute force hack. If the total runtime domain for SHORT (total runtime 
for when SHORT is better) is small compared to the domain for LARGE it may be 
worthwhile.


FIRST SUGGESTION

Run SHORT and LARGE in subprocesses, flat out. When either stops, kill the 
other. Once LARGE is the first to stop, do not bother with SHORT any more.


FIRST SUGGESTION

Chris Angelico's approach looks pretty cool, but seems unstable (in choices) 
initially.


Are the input values predictable? Or a fixed sequences?

I am wondering if there's any scope for gathering all the values (or all the 
values up to comfortably past the unknown cutover point) before running SHORT 
or LARGE at all?


I was thinking bisecting to find the CUTOFF, but the cost of the wrong 
algorithm for values well over the CUTOFF would be nasty.


Alternatively:

Did you say SHORT becomes quadratic in cost as it grows and LARGE roughtly 
linear? Pretend they really are purely quadratic and linear respectively.


Then you could start with both SHORT and LARGE for your first value.
Run SHORT and LARGE. Measure the elapsed time for each. Compute their ratio.

I think you should be able to estimate the cutover point as the point where the 
two curves intersect. Run the SHORT algorithm until them. Then run both.  
Remeasure. Re-estimate. Repeat until definitely LARGE domain (estimate points 
into the past, maybe with an error margin). Then just use LARGE.


Thoughts?

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


PyDev 3.8.0 Released

2014-09-25 Thread Fabio Zadrozny
What is PyDev?
---

PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and
IronPython development.

It comes with goodies such as code completion, syntax highlighting, syntax
analysis, code analysis, refactor, debug, interactive console, etc.

Details on PyDev: http://pydev.org
Details on its development: http://pydev.blogspot.com


What is LiClipse?
---

LiClipse is a PyDev standalone with goodies such as support for Multiple
cursors, theming and a number of other languages such as Django Templates,
Kivy Language, Mako Templates, Html, Javascript, etc.

It's also a commercial counterpart which helps supporting the development
of PyDev.

Details on LiClipse: http://brainwy.github.io/liclipse/


Release Highlights:
---

* **Important**: PyDev requires Eclipse 3.8 or 4.3 onwards and Java 7! For
older versions, keep using PyDev 2.x (use LiClipse:
http://brainwy.github.io/liclipse for a PyDev standalone with all
requirements bundled).

* **Debugger**

* It's now possible to **attach debugger to running process in Windows
and Linux** (open debug perspective > PyDev > Attach to Process)

* pep8 upgraded to 1.5.7
* Fixed issue in dialog shown when PyDev editor is opened which could lead
to closing the IDE.
* Selecting PyQT API version using sip.setapi no longer fails in debug mode
(PyDev-452).
* Code completion tries to get docstring definition from class before
evaluating property (PyDev-412).
* Internal error error when parsing file with wrong syntax:
java.lang.ClassCastException for invalid dict (PyDev-411).
* runfile was restored in pydevconsole (Ctrl+Alt+Enter is working again).
* **Variables** and **Expressions** views working again when debugging
interactive console (PyDev-446).
* Pressing Shift to debug with Ctrl+F9 test runner now properly works in
Linux (PyDev-444).
* Fixed interpreter configuration when the interpreter prints something
before actually running interpreterInfo.py (PyDev-448).
* Fixed NullPointerException when debugging file without extension.


Cheers,

--
Fabio Zadrozny
--
Software Developer

LiClipse
http://brainwy.github.io/liclipse

PyDev - Python Development Environment for Eclipse
http://pydev.org
http://pydev.blogspot.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Dynamically swapping between two algorithms

2014-09-25 Thread Ethan Furman

On 09/23/2014 07:48 AM, Steven D'Aprano wrote:


alas, the CUTOVER point is likely to be machine-dependent. Take it as a
given that inserting a fixed CUTOVER point into the source code (say,
``CUTOVER = 123456``) is not likely to be very effective, and dynamically
calculating it at import time is impractical.


Have your setup script do some timings to figure out where CUTOFF is on any particular machine.  You can then store it 
in a .conf file, or directly modify the source file with the value, or ...


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


Re: "Fuzzy" Counter?

2014-09-25 Thread Steven D'Aprano
Ian Kelly wrote:

> On Tue, Sep 23, 2014 at 11:01 PM, Miki Tebeka 
> wrote:
>> On Tuesday, September 23, 2014 7:33:06 PM UTC+3, Rob Gaddi wrote:
>>
>>> While you're at it, think
>>> long and hard about that definition of fuzziness.  If you can make it
>>> closer to the concept of histogram "bins" you'll get much better
>>> performance.
>> The problem for me here is that I can't determine the number of bins in
>> advance. I'd like to get frequencies. I guess every "new" (don't have any
>> previous equal item) can be a bin.
> 
> Then your result depends on the order of your input, which is usually
> not a good thing.
> 
> Why would you need to determine the *number* of bins in advance? You
> just need to determine where they start and stop. If for example your
> epsilon is 0.5, you could determine the bins to be at [-0.5, 0.5);
> [0.5, 1.5); [1.5, 2.5); ad infinitum. Then for each actual value you
> encounter, you could calculate the appropriate bin, creating it first
> if it doesn't already exist.

That has the unfortunate implication that:

0.50001 and 1.4 (delta = 0.8)

are considered equal, but:

1.50001 and 1.4 (delta = 0.2)

are considered unequal.



-- 
Steven

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


https://www.python.org/ seems to be down

2014-09-25 Thread Gmane
https://www.python.org/ seems to be down when I last checked on 06:45 UTC on
26th Sep 2014.
Anybody else experiencing this problem?

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


Re: https://www.python.org/ seems to be down

2014-09-25 Thread Rock Neurotiko
2014-09-26 8:46 GMT+02:00 Gmane :

> https://www.python.org/



http://www.downforeveryoneorjustme.com/python.org

-- 
Miguel García Lafuente - Rock Neurotiko

Do it, the devil is in the details.
The quieter you are, the more you are able to hear.
Happy Coding. Code with Passion, Decode with Patience.
If we make consistent effort, based on proper education, we can change the
world.

El contenido de este e-mail es privado, no se permite la revelacion del
contenido de este e-mail a gente ajena a él.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: https://www.python.org/ seems to be down

2014-09-25 Thread Chris Angelico
On Fri, Sep 26, 2014 at 4:46 PM, Gmane
 wrote:
> https://www.python.org/ seems to be down when I last checked on 06:45 UTC on
> 26th Sep 2014.
> Anybody else experiencing this problem?

Working for me. Are you getting DNS failure, HTTP failure, SSL
certificate issues, or what?

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