On 11/10/16 10:16, tracey jones-Francis wrote:
> Is it possible someone on here can advise me where I am going wrong.
Yesm, thats what this list is for but...
We need to see code - we can't guess what you did.
We need to know what input you used, what output
you got and why its not what you expec
Hi
I have just started Com Sci in Uni and I am new to coding. I feel pretty
inadequate as I am really struggling with the latest tasks. Most of the work is
self-directed learning so we need to figure it out ourselves but I am running
out of time. Is it possible someone on here can advise me wh
On Thu, Jun 4, 2009 at 3:48 PM, W W wrote:
> On Thu, Jun 4, 2009 at 8:29 AM, Norman Khine wrote:
>>
>> Hello,
>> I have the following code, which searches through a directory structure
>> such as:
>>
>> $ tree -L 2 companies
>> companies
>> |-- aberdeen-airport-ltd
>> | |-- aberdeen-airport-dyc
On Thu, Jun 4, 2009 at 8:29 AM, Norman Khine wrote:
> Hello,
> I have the following code, which searches through a directory structure
> such as:
>
> $ tree -L 2 companies
> companies
> |-- aberdeen-airport-ltd
> | |-- aberdeen-airport-dyce-grampian
> | `-- aberdeen-airport-dyce-grampian.meta
Hello,
I have the following code, which searches through a directory structure such as:
$ tree -L 2 companies
companies
|-- aberdeen-airport-ltd
| |-- aberdeen-airport-dyce-grampian
| `-- aberdeen-airport-dyce-grampian.metadata
|-- aberdeen-airport-ltd.metadata
|-- aberdeen-motor-company-ltd
|
On Sun, Feb 15, 2009 at 5:53 AM, Norman Khine wrote:
MXlocate = re.compile('^.*preference = (\d*).*exchanger = (.*)$',
> On the shell, the command
>
> $ nslookup -querytype=MX abakuc.com
> Server: 193.252.19.3
> Address:193.252.19.3#53
>
> Non-authoritative answer:
> abakuc.c
Hello,
What am I doing wrong here.
>>> import smtplib, socket, re, os, operator, sys
>>> domain = 'abakuc.com'
>>> validMXservers = []
>>> MXlocate = re.compile('^.*preference = (\d*).*exchanger = (.*)$',
re.IGNORECASE)
>>> MXservers = os.popen('nslookup -querytype=MX %s' %domain, 'r')
>>> for
Jacob,
Apart from all the other comments you received, here are my thoughts.
I think you could do one more thing to speed up your calculations and
that is to use a more efficient method. The Reimann sum is not a very
efficient.
One simple method that is rahter popular is Simpson's rule.
The
Thanks everyone!
Kent started the suggestion of making a code object, but everyone else seems
to have worked their way to it.
Beautiful! I only have to call exec once, and it cuts down time
considerably.
Here is the new code.
Jacob Schmidt
Please remind me if I've forgotten anything.
### Start #
> If the user must be able to enter in the function, then it would be
better
> to evaluate this once and turn it into some sort of function that
you can
> call inside the loop (it's the eval that is so expensive). How to
do that
> depends a lot on how complex the possible functions can be (if
they
> > There has been alot of talk on this list about using list comprehensions
> > lately, and this could be one of those useful places. While I don't
> > have time to experiment with real code, I would suggest changing your
> > function to look like:
> >
> > steps = [ min_x + i*delta_x for i in r
On Wed, 26 Jan 2005, Bill Kranec wrote:
> There has been alot of talk on this list about using list comprehensions
> lately, and this could be one of those useful places. While I don't
> have time to experiment with real code, I would suggest changing your
> function to look like:
>
> steps = [
There has been alot of talk on this list about using list comprehensions
lately, and this could be one of those useful places. While I don't
have time to experiment with real code, I would suggest changing your
function to look like:
steps = [ min_x + i*delta_x for i in range(steps) ]
totalare
There was a discussion about this same question (in the context of graphing a user-supplied
function) just a few weeks ago. My suggestion was to use exec to create a real function object that
you can call directly; you can read it here:
http://mail.python.org/pipermail/tutor/2005-January/034696.h
What is the function? 3*x*x
What is the minimum? 2
What is the maximum? 5
117.000435
Which, considering that it is supposed to be exactly 117, It's darn
good. Unfortunately, it also takes about
10 seconds to do all that.
Any suggestions? Any advice? TIA
Jacob Schmidt
Jacob,
You can get better acc
[Tony Meyer]
> If the user must be able to enter in the function, then it
> would be better to evaluate this once and turn it into some
> sort of function that you can call inside the loop (it's the
> eval that is so expensive).
I should have included some code that does this:
"""
from __futur
> Anyway, I know the first thing that some of you are going to
> say is using eval().
[...]
> Which, considering that it is supposed to be exactly 117,
> It's darn good.
> Unfortunately, it also takes about 10 seconds to do all that.
> Any suggestions? Any advice?
On my machine your version ta
Hi all.
Long time no see. (About five days, right?)
Anyway, I know the first thing that some of you are going to say is using
eval(). I don't want a whole
guilt trip on security risks and all that. I do not want to share the code
with anyone else while it's on my
computer, and I sure don't hav
18 matches
Mail list logo