integer multiplication

2011-04-03 Thread Eddie Tsay
Does anyone know what algorithms for integer multiplication does Python use? I am trying to compare it to those used by Sage as it seems like it takes much longer for Python to do large integer multiplication as compared to Sage (anyone know off the top of their heads?) thank you -- http://mail.p

function call overhead

2009-02-03 Thread Eddie Watson
What's the Python function call overhead like? Eddie Watson "CLC plonkers in a state of panic!!!" -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing a file with iterators

2008-10-17 Thread Eddie Corns
Luis Zarrabeitia <[EMAIL PROTECTED]> writes: >I need to parse a file, text file. The format is something like that: >TYPE1 metadata >data line 1 >data line 2 >... >data line N >TYPE2 metadata >data line 1 >... >TYPE3 metadata >... >And so on. The type and metadata determine how to parse the fol

Re: Regarding Telnet library in python

2008-08-13 Thread Eddie Corns
tn.write("ls\n") stdout = tn.read_until(prompt) for line in stdout.splitlines(): ... etc. alternatively just send them all in one go as you have been and save the output in a variable and split that on the prompt. In either case you may want to change the prompt to something easier to match on like "$hostname# ". Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: trying to match a string

2008-07-18 Thread Eddie Corns
[EMAIL PROTECTED] writes: >Hi, >Hi, >I am taking a string as an input from the user and it should only >contain the chars:L , M or R >I tried the folllowing in kodos but they are still not perfect: >[^A-K,^N-Q,^S-Z,^0-9] >[L][M][R] >[LRM]?L?[LRM]? etc but they do not exactly meet what I need.

Re: parse dates

2008-06-02 Thread Eddie Corns
s pdt >>> p = pdt.Calendar() >>> p.parse('next month') ((2008, 7, 1, 9, 0, 0, 1, 183, -1), 1) Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: Thousand Seperator

2008-03-14 Thread Eddie Corns
$number = reverse $_[0]; >$number =~ s/(\d\d\d)(?=\d)(?!d*\.)/$1,/g; >return scalar reverse $number; >} >But I cannot find how to do this in Python. Look at the locale module. If you're producing the numbers yourself then they get printed in that format othe

Re: Intelligent Date & Time parsing

2008-03-10 Thread Eddie Corns
[EMAIL PROTECTED] writes: >I'm new to python and I was wondering if there are any intelligent >date/time parsing modules out there. I've looked at strptime (or >whichever it is) and mxDateTime from the eGenix package. I need >something to parse user input for a django app, and it's awesome to be >

Re: Online Debugging

2008-01-31 Thread Eddie Corns
e working for me. >Is there an easier/better way to debug online scripts? I was hoping >there might be something similar to php where it gives some error info >and the line code. One simple method might be something along these lines: http://aspn.activestate.com/ASPN/Cookbook/Python/Reci

Re: Wo killed Benazir Bhutto of Pakistan = NEOCON/ZIOCON many layers of deception

2008-01-30 Thread Eddie Davis
A moron posting from google? How unusual! -- Posted via a free Usenet account from http://www.teranews.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Natural-language datetime parsing and display (was: user friendly datetime features)

2008-01-09 Thread Eddie Corns
For PARSING see http://code-bear.com/code/parsedatetime/ The OP was looking for presentation though. I know roundup has code for this if an independent library can't be found. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: why did these companies choose Tcl over Python

2007-10-31 Thread Eddie Corns
proved beyond all recognition since I last used it). Try putting together some sample scripts in both languages and see how easily others can understand them (and yourself in a few months). When I want something nimbler than Python I use Lua. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: Can a low-level programmer learn OOP?

2007-07-24 Thread Eddie Corns
Paul McGuire <[EMAIL PROTECTED]> writes: >On Jul 23, 12:43 pm, [EMAIL PROTECTED] (Eddie Corns) wrote: >> Paul McGuire <[EMAIL PROTECTED]> writes: >> >On Jul 23, 5:53 am, [EMAIL PROTECTED] (Eddie Corns) wrote: >> >> Wolfgang Strobl <[EMAIL PROTECTED]&g

Re: Can a low-level programmer learn OOP?

2007-07-23 Thread Eddie Corns
Paul McGuire <[EMAIL PROTECTED]> writes: >On Jul 23, 5:53 am, [EMAIL PROTECTED] (Eddie Corns) wrote: >> Wolfgang Strobl <[EMAIL PROTECTED]> writes: >> >few of James Gimple's snippets from "Algorithms in SNOBOL4" >> >(->http://www.snobol4.

Re: Can a low-level programmer learn OOP?

2007-07-23 Thread Eddie Corns
iced them or the PDF of the book there before. Some Friday afternoon reading for sure. Personally I hope to get more to time to look at a combination of Lua and PEGs (http://en.wikipedia.org/wiki/Parsing_expression_grammar) for my parsing needs. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: Can a low-level programmer learn OOP?

2007-07-17 Thread Eddie Corns
he benefit of SNOBOL matching without direct language support. There's only so much a library can do. However a valiant and interesting effort: http://www.wilmott.ca/python/patternmatching.html Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: How Can I Increase the Speed of a Large Number of Date Conversions

2007-06-08 Thread Eddie Corns
hances are pretty >good. ;-) I can't help noticing that dates in '-mm-dd' format are already sortable as strings. >>> '1999-12-30' > '1999-12-29' True depending on the pattern of access the slightly slower compare speed _might_ compensate for the conversion speed. Worth a try. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: Calculating CIDR blocks

2007-04-20 Thread Eddie Corns
=?iso-8859-1?q?Pekka_J=E4rvinen?= <[EMAIL PROTECTED]> writes: >On 20 huhti, 14:34, [EMAIL PROTECTED] (Eddie Corns) wrote: >> Look at:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/466298 >> it handles most of the logic of combining IP ranges. >> >> Eddi

Re: Calculating CIDR blocks

2007-04-20 Thread Eddie Corns
Look at: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/466298 it handles most of the logic of combining IP ranges. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help to learn Python

2007-03-26 Thread Eddie Corns
r to the language. Worked for me. The 1/e was the easiest intro to a language I've ever read. (I don't suppose you fancy doing one for Ruby :) Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: flattening/rolling up/aggregating a large sorted text file

2007-03-22 Thread Eddie Corns
cidentally I don't think you could do it in SQL at all in this way but you could do it in a more vertical fashion (eg 001, red, circle, 11 001, blue, square, 4 002, red, rhombus, 99) etc. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: CherryPy/Turbogears on server not controlled by me

2007-02-20 Thread Eddie Corns
roduce a security hazard in your app is that only your files are endangered. I run several TG apps in user space and the only small problem I've had is the logistics of telling people if you have to move it somewhere else since a DNS alias doesn't help much with explicit port numbers in the URL. Eddie -- http://mail.python.org/mailman/listinfo/python-list

profiling memory usage

2006-10-05 Thread Eddie
constant swapping. Is there a way to look at which objects or variables are taking the huge amount of memory space? Thanks, Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: BaseHTTPServer weirdness

2006-09-12 Thread Eddie Corns
Well if it's any consolation; that's exactly what I did - cut about 7 lines from CGIHTTPSERVER into my do_POST method. Maybe we're both stoopid. This was at least 3 years ago before I moved on to Quixote and then CherryPy/TurboGears but I recall thinking at the time that it wa

Re: String pattern matching

2006-04-03 Thread Eddie Corns
Kent Johnson <[EMAIL PROTECTED]> writes: >Eddie Corns wrote: >> If I get time I'll try to get this working in Sam Wilmott's Python pattern >> matching library. >> >> What fun! >Cool! I have to get in on the fun :-) >This program uses Sa

Re: String pattern matching

2006-04-03 Thread Eddie Corns
7; '/' arb $ x arb $ y arb $ z '/' *x *y '/' +arb $ v *x arb $ w '/' *differ(v) *differ(w) *differ(x) +*differ(y) *differ(z) *foo(v '/' w '/' x '/' y '/' z) :F(end) generates: ee/bcac/a/bca/aab eeabc/c/a/bca/aab ee/cac/ab/ca/aab ee/ac/abc/a/aab If I get time I'll try to get this working in Sam Wilmott's Python pattern matching library. What fun! Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: telnet session

2006-03-29 Thread Eddie Corns
[EMAIL PROTECTED] writes: >hi >i am using a telnet session to simulate an authentication mechanism >USER = "user" >PASSWORD = "password" >try: >telnet = telnetlib.Telnet(HOST) >telnet.set_debuglevel(5) >telnet.read_until("login: ") >telnet.write(USER + "\n") >

Re: Help: Creating condensed expressions

2006-03-24 Thread Eddie Corns
d so easy!. There's also a whole bunch of tools on that page. Maybe there's an optimiser you can use in one of them. Failing that I guess you build a tree and try to merge nodes where they fork. I suspect an optimal solution would be hard but if you knew your input did have lots of redundancy a simple algorithm might work. Or I could be talking crap as usual. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: A better RE?

2006-03-10 Thread Eddie Corns
"Jim" <[EMAIL PROTECTED]> writes: >Eddie Corns wrote: >> Just a small point - what does "in order" mean here? if it means that eg 1362 >> is not valid then you're stuck because it's context sensitive and hence not >> regular. >I

Re: A better RE?

2006-03-10 Thread Eddie Corns
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: >Eddie Corns wrote: >> >I want an re that matches strings like "21MAR06 31APR06 1236", >> >where the last part is day numbers (1-7), i.e it can contain >> >the numbers 1-7, in order, only one

Re: A better RE?

2006-03-10 Thread Eddie Corns
as thinking of Just a small point - what does "in order" mean here? if it means that eg 1362 is not valid then you're stuck because it's context sensitive and hence not regular. I can't see how any of the fancy extensions could help here but maybe I'm just lacking insi

Re: telnetlib problems

2006-03-02 Thread Eddie Corns
lid password) the far end might throw away any pending input when it finally does send the Password: prompt (otherwise it would probably have got back in sync). In short you shouldn't go past each stage unless you've verified that you got the expected response. I can't actually remember exactly what the responses signify but at a minimum I assume the empty string means there's no point in continuing because what you expected to see wasn't there so you need to either abort or try some recovery process. And also make sure you give it a reasonable time to respond. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: telnetlib problems

2006-03-01 Thread Eddie Corns
about it? Have you checked the return value from the read_until()s to see if they're returning anything sensible? are any of them timing out? Anyway, my first guess would be the use of read_very_eager(), it's something you normally only descend to when you're stuck for something to match on. Normally you would do another read_until() for the prompt. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: RPy / R

2006-02-12 Thread Eddie
http://numeric.scipy.org/ Eddie jason wrote: > Thanks for your response. I'll try to install all the same versions that you > have. > > I have removed my version of Python and installed ActivePython > (ActivePython-2.4.2.10-win32-x86.msi). > > Could you please tell me which ver

Re: Twisted book opinions?

2006-02-09 Thread Eddie Corns
a cookbook is misleading, it shows how to do essential tasks using fairly complete examples. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: RPy / R

2006-02-07 Thread Eddie
might be worth trying to unistall Python and installing the Activestate version (which includes the Win32 extensions). Good luck Eddie jason wrote: > Hello: > > I installed the following: > > python-2.4.2.msi > pywin32-207.win32-py2.4.exe > R-2.2.1-win32.exe > rpy-0.4

Re: Python and curses

2005-12-16 Thread Eddie Corns
. http://excess.org/urwid/ I've only played with it a little bit but it looks useful. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: another time challenge

2005-09-29 Thread Eddie Corns
cleaner shortcut. You could extract the hours,mins,secs part to a DateTimeDelta which supports float() and just divide that into 86400.0. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for system/network monitoring tool written in Python

2005-09-22 Thread Eddie Corns
Simon Brunning <[EMAIL PROTECTED]> writes: >On 9/22/05, Mike Meyer <[EMAIL PROTECTED]> wrote: >> I've found a fair number of systems/network monitoring tools (things >> like Big Brother, Big Sister, cricket, etc.) written in Perl. I'm >> curious if there

Re: Looking for system/network monitoring tool written in Python

2005-09-22 Thread Eddie Corns
to write your own scripts in Python. This is probably OK for small networks. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: "week-year" conversion to date

2005-09-14 Thread Eddie Corns
y = year >ww = week # >Thanks for any and all help. >>> import mx.DateTime >>> d=mx.DateTime.DateTime(1992)+mx.DateTime.RelativeDateTime(weeks=15) >>> d >>> d=mx.DateTime.DateTime(1992)+mx.DateTime.RelativeDateTime(weeks=51) >>> d Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: need a little help with time

2005-08-26 Thread Eddie Corns
[EMAIL PROTECTED] writes: >Hey there. >i have a time string (created with strftime) then read from a file, >i am having some trouble understanding how to get the difference >between times. >i know i can structime(timestring) and get a time value, but i dont >know how to manipulate it. >basically,

Re: How to know if connection is active when using telnetlib?

2005-08-26 Thread Eddie Corns
'active'? I'm just basing this on reading telnetlib.py. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: ideas for university project ??

2005-08-26 Thread Eddie Corns
useful but whether it rocks your boat interest wise ... Admittedly I personally would like to play with Erlang rather than Python for this. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: shuffle the lines of a large file

2005-03-07 Thread Eddie Corns
ay that it is not sorted in any way >- shuffle corpus.uniq > corpus.uniq.shuffled >Unfortunately, none of the machines that I may use has 80G RAM. >So, using a dictionary will not help. >Any ideas? Instead of shuffling the file itself maybe you could index it (with dbm for insta

Re: Trouble using telentlib

2005-02-28 Thread Eddie Corns
while True: # get one more line line = tn.read_until ('\n') regex_thing (line) Remember, "tail -f" never exits, so you probably want to break when you've find what you want and then just close the telnet session. It would probably be nice if telnetlib had a readline function that handled all the messy details for portable end of line checking. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: Trees

2005-02-28 Thread Eddie Corns
might do most of what you want. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: Tar module issue

2005-02-07 Thread Eddie Corns
file that either doesn't exist on the system you are restoring to or not from the directory where you now are. I hope that makes sense. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Re: HTML Tree View with and

2005-01-28 Thread Eddie Corns
selected_node = document.getElementById(id); selected_id = id; } function set_visibility_all (n, vis) { if (n == null) return false; if (n.nodeType == 1) { if (n.tagName == "DIV" && n.id != "") set_visibility (n.id, n, vis); for (var c = n.firstChild; c != null; c = c.nextSibling) set_visibility_all (c, vis); } } --- the javascript code is extracted from a larger set of functions that include a popup menu with inbuilt search (which opens tree levels as necessary), if you're interested. Eddie -- http://mail.python.org/mailman/listinfo/python-list

Clarification of two concepts (or maybe one?)

2004-12-10 Thread Eddie Parker
Sorry, I’ve tried to search the web on this, but I’m still a little fuzzy. I was hoping a quick e-mail might clear this up. What I’m looking for, is a way to turn a python ‘application’, into a ‘stand-alone’ application. i.e., you don’t need the Python interpreter, libraries, etc, install

Re: Question on sorting

2004-11-30 Thread Eddie Corns
sorting on individual fields rather than whole lines. In which case I would think of doing a line.split(';') on each line before sorting. It would still need either to use a function to make empty fields go later or alternatively use DSU (google!) and convert '' to say '~' and back again. This also solves the problem of what to expect when only some of the fields are blank rather than all of them. Eddie -- http://mail.python.org/mailman/listinfo/python-list