Re: Fork You.. Forking and threading..

2006-07-05 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, rh0dium wrote: > if os.fork() == 0: > os.setsid > sys.stdout = open("/dev/null", 'w') > sys.stdin = open("/dev/null", 'r') I don't know if it's the cause of your problem, but you're not doing the backgrounding right, it should be: if o

Re: IRC questions!!

2006-07-07 Thread Jon Clements
gt; thanks.. > > -bruce Assuming you're familiar with the basics of IRC. In mIRC, File->Select Server->Add, enter "Freenode" as description, enter "irc.freenode.net" as server. Leave the port as 6667, then change it later if server supports other ports. Click c

Re: how can I avoid abusing lists?

2006-07-07 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Thomas Nelson wrote: > This is exactly what I want to do: every time I encounter this kind of > value in my code, increment the appropriate type by one. Then I'd like > to go back and find out how many of each type there were. This way > I've written seems simple e

Re: add without carry

2006-09-15 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Bruno Desthuilliers wrote: > Hugh wrote: >> Sorry, here's an example... >> >> 5+7=12 >> >> added without carrying, 5+7=2 >> >> i.e the result is always less than 10 > >> I've been thinking some more about this and my brain is starting to >> work something out...

Re: A critique of cgi.escape

2006-09-23 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > Lawrence D'Oliveiro wrote: >> So I think the default for the second argument to cgi.escape should be >> changed to True. Or alternatively, the second argument should be removed >> altogether, and quotes should always be escaped. > > you're con

Re: A critique of cgi.escape

2006-09-24 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Georg Brandl wrote: >> Attributes can be quoted with either single or double quotes. That's what >> the HTML spec says. cgi.escape doesn't correctly allow for that. Ergo, >> cgi.escape is broken. QED. > > A function is broken if its implementation doesn't match the

Re: A critique of cgi.escape

2006-09-24 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >> Making cgi.escape always escape the '"' character would not break >> anything, and would probably fix a few bugs in existing code. Yes, >> those bugs are not cgi.escape's fault, but that's no reason not to >> be helpful. It's a minor improveme

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > maybe you haven't done software long enough to understand that > software works better if you use it the way it was intended to be > used, but that's no excuse for being stupid. So what's your excuse? -- http://mail.python.org/mailman/listinf

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > If you're really serious about making things easier to use, shouldn't > you look at the whole picture? HTML documents are byte streams, so > any transformation from internal character data to HTML must take both > escaping and encoding into ac

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > (still waiting for the "jon's enhanced escape" proposal, btw, but I guess it's > easier to piss on others than to actually contribute something useful). Well, yes, you certainly seem to be good at the "pissing on others" part, even if you have

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Duncan Booth wrote: > It is generally a principle of Python that new releases maintain backward > compatability. An incompatible change such proposed here would probably > break many tests for a large number of people. Why is the suggested change incompatible? Wha

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >> There's nothing to say that cgi.escape should take them both into account >> in the one function > > so what exactly are you using cgi.escape for in your code ? To escape characters so that they will be treated as character data and not cont

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Georg Brandl wrote: >> I'm sorry, that's not good enough. How, precisely, would it break >> "existing code"? Can you come up with an example, or even an >> explanation of how it *could* break existing code? > > Is that so hard to see? If cgi.escape replaced "'" with

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Duncan Booth wrote: > I guess you've never seen anyone write tests which retrieve some generated > html and compare it against the expected value. If the page contains any > unescaped quotes then this change would break it. You're right - I've never seen anyone do

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Max M wrote: >> I'm sorry, that's not good enough. How, precisely, would it break >> "existing code"? Can you come up with an example, or even an >> explanation of how it *could* break existing code? > > Some examples are: > > - Possibly any code that tests for str

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Max M wrote: > Oh ... because you cannot see a use case for that *documented* > behaviour, it must certainly be wrong? No, but if nobody else can find one either, that's a clue that maybe it's safe to change. Here's a point for you - the documentation for cgi.esca

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: >> I'm sorry, that's not good enough. How, precisely, would it break >> "existing code"? > > ('owdo Mr. Ribbens!) Good afternoon Mr Glover ;-) > URI= 'http://www.oreilly.com/' > html= cgi.escape(text) > html= html.replace('O\'R

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >> Sorry, that's still not good enough. > > that's not up to you to decide, though. It's up to me to decide whether or not an argument is good enough to convince me, thank you very much. -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Filip Salomonsson wrote: >> Here's a point for you - the documentation for cgi.escape says that >> the characters "&", "<" and ">" are converted, but not what they are >> converted to. > > If the documentation isn't clear enough, that means the documentation > shoul

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >> It's up to me to decide whether or not an argument is good enough to >> convince me, thank you very much. > > not if you expect anyone to take anything you say seriously. Now you're just being ridiculous. In this thread you have been rude, e

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Brian Quinlan wrote: >> Now you're just being ridiculous. In this thread you have been rude, >> evasive, insulting, vague, hypocritical, and have failed to answer >> substantive points in favour of sarcastic and erroneous sniping - I'd >> suggest it's you that needs

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Georg Brandl wrote: >> Here's a point for you - the documentation for cgi.escape says that >> the characters "&", "<" and ">" are converted, but not what they are >> converted to. > > It says "to HTML-safe sequences". That's reasonably clear without the need > to re

Re: QuoteSQL

2006-09-25 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Lawrence D'Oliveiro wrote: > You're proposing two separate functions: > > 1) quoting of non-wildcard specials > 2) quoting of wildcard specials Lawrence, you're wrong in this thread for the same reason you were right in the cgi.escape thread. Escaping gener

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Steve Holden wrote: >> I would have hoped that people don't treat that as a licence to be >> obnoxious, though. I am aware of Fredrik's history, which is why I >> was somewhat surprised and disappointed that he was being so rude >> and unpleasant in this thread. He i

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > the same documentation tells people what function to use if they > want to quote *every-thing* that might need to be quoted, so if > people did actually understand everything that was written in a > reasonably clear way, this thread wouldn't ev

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Steve Holden wrote: >> Why do you say that? I have confined myself to simple logical >> arguments, and been frankly very restrained when presented with >> rudeness and misunderstanding from other thread participants. >> In what way should I have modified my postings?

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >> It's a pity he's being rude when presented with well-informed comment >> then. > > since when is the output of > [snip code] > > well-informed? heck, it doesn't even pass the turing test ;-) Since when did that bear any resemblance to wha

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >>> the same documentation tells people what function to use if they >>> want to quote *every-thing* that might need to be quoted, so if >>> people did actually understand everything that was written in a >>> reasonably clear way, this thread wou

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >> This has nothing to do with character encodings. > > it has *everything* to do with encoding of existing data into HTML > so it can be safely transported to, and recreated by, an HTML-aware > client. I can't tell if you're disagreeing or not

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Brian Quinlan wrote: > A summary of this pointless argument: Your summary seems pretty reasonable, but please note that later on, the thread was not about cgi.escape escaping (or not) quote characters (as described in your summary), but about Fredrik arguing, somewh

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > I know the answer. I'm pretty sure everyone else who's actually > read my posts to this thread might have figured it out by now, too. > But since you're still trying to "win" the debate, long after it's > over, I think it's safest to end this

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Brian Quinlan wrote: >> Your summary seems pretty reasonable, but please note that later on, >> the thread was not about cgi.escape escaping (or not) quote >> characters (as described in your summary), but about Fredrik arguing, >> somewhat incoherently, that it shou

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > Jon Ribbens wrote: > >>> does the word "information set" mean anything to you? >> >> You would appear to be talking about either game theory, or XML, >> neither of which have anything to do w

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >> What do XML Information Sets have to do with escaping control >> characters in HTML? > > figure out the connection, and you'll have the answer to your "substantial > point". If you don't know the answer, you can say so y'know. There's no sha

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Brian Quinlan wrote: > Well, there are dozens (hundreds?) of templating systems for Python. I know, I wrote one of them ;-) > t = Template("test.html") > t['foo'] = 'Brian -> "Hi!"' > assert str(t) == 'Brian -> "Hi"' > > So how would you test our template system?

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Brian Quinlan wrote: > If, in the example that I showed, the less-than character was not > correctly escaped, then it might not manifest itself frequently in a > typical application because the less-than character is seldom used in > English prose. OK, but effect

Re: A critique of cgi.escape

2006-09-27 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Gabriel G wrote: > By example, I do not validate a "page". I validate that all methods > that make up pieces of a page, build them the way they should - these > are our "unit tests". Then, it's up to the templating library to join > all the pieces into the final h

Re: Computer Language Popularity Trend

2006-09-27 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: >> http://xahlee.org/lang_traf/index.html > > Careful there with the sweeping generalizations and quick judgments > about languages :) I just read "PHP as a language is rather dry and business-like", and fell off my chair. -- http://mail.p

Re: CGI -> mod_python

2006-10-03 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Paul Boddie wrote: >> it is a kind of nooby question. Is there a way to transfer a CGI python >> script to mod_python without rewriting the code? > > Had you used WebStack [1] to begin with, this migration would involve > changing a few lines of glue code. Or Jonpy

Re: Raw strings and escaping

2006-10-03 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Matthew Warren wrote: > I would expect this to work, > > rawstring=r'some things\new things\some other things\' > > But it fails as the last backslash escapes the single quote. String constants in Python are weird - raw strings doubly so. In a raw string, backslas

Re: Raw strings and escaping

2006-10-03 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Duncan Booth wrote: >> I presume there was originally some reason for this bizarre behaviour >> - it'd be interesting to know what it is/was, if anyone knows? >> > See the FAQ for the explanation: > > http://www.python.org/doc/faq/general/#why-can-t-raw-strings-r-s

Re: Simple question on indexing

2006-12-01 Thread Jon Clements
> > but I'm not able to find the name of the function ??? in the python > documentation, any help? > Thanks Ummm, that's a list not a tuple: I'll assume you meant sequence. This will generate a list of indexes which match the criteria: >>> a = [ 1, 2, 3, 2, 5, 7] >>> [elno for elno,el in enumerate(a) if el == 2] [1, 3] hth Jon. -- http://mail.python.org/mailman/listinfo/python-list

Re: route planning

2006-12-01 Thread Jon Clements
ng Kevin Bacon and dependency tracking etc... so a good old Google might do you some good -- ie, it's not completely related, but it might give you a few extra things to search on... All the best with the search. Jon. PS. If you do find a library, can you let me know? I'd be intereste

Re: About alternatives to Matlab

2006-12-01 Thread Jon Harrop
2 in let c4 = 0.51763809020504137 in let c5 = 1.9318516525781364 in let n = Array.length x in let odd i = x.(2*i) and even i = x.(2*i + 1) in let d1 i = odd i -. c1 *. even i in let f = function -1 -> n/2 - 1 | i -> i in let s1 i = even i +. c2 *. d1 i +. c3 *. d1 (f(i-1)) in l

Re: About alternatives to Matlab

2006-12-02 Thread Jon Harrop
n't easily make. (It'd require are really smart JIT compiler > or some concessions in dynamicity.) Writing a JIT to compile this kind of stuff is easy. My point is that this is fundamentally bad code, so why bother trying to write a Python JIT? Why not just write in a better language for

Re: About alternatives to Matlab

2006-12-03 Thread Jon Harrop
ttp://showmedo.com/videos/series?name=pythonThompsonVPythonSeries I just found some more interesting stuff here: http://www.phy.syr.edu/~salgado/software/vpython/ This is really great work but I can't help but wonder why the authors chose to use Python when other languages seem better suited. I'd like to work on raising people's awareness of these alternatives, and probably create some useful tools in the process. So I'm keen to learn what Python programmers would want/expect from F# and OCaml. What would it take to make you convert? -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists -- http://mail.python.org/mailman/listinfo/python-list

Re: About alternatives to Matlab

2006-12-03 Thread Jon Harrop
ome useful tools in the process. So I'm keen to learn what Python >> programmers would want/expect from F# and OCaml. >> >> What would it take to make you convert? > > Them not being functional would be a good start They don't impose functional programming on you. -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists -- http://mail.python.org/mailman/listinfo/python-list

Re: About alternatives to Matlab

2006-12-03 Thread Jon Harrop
t the Zen of > Python, a set of principles by which the language is designed. One of > them is "Practicality beats purity." And let's face it, functional > languages are (or seem to be) all about purity. Notice that there's no > Zen that says "Fast i

Re: About alternatives to Matlab

2006-12-04 Thread Jon Harrop
es are now iterating over the arrays many times instead of once and the whole program is slower than a simple loop written in C. Indeed, this algorithm could be written concisely using pattern matching over linked lists. I wonder if that would be as fast as using BLAS from Python. -- Dr Jon D Harro

Re: About alternatives to Matlab

2006-12-05 Thread Jon Harrop
d t a = match t, a with | [x0; x1; x2; x3], x4::x5::x6::_ -> h x0 x1 x2 x3::h x2 x3 x4 x5::s, g x1 x2 x3 x4::g x3 x4 x5 x6::d | x0::x1::(x2::x3::x4::_ as t), a -> d4_even (h x0 x1 x2 x3 :: s) (g x1 x2 x3 x4 :: d) t a let rec d4 = function | [_; _; _; _] as a -> [a, []] |

Re: About alternatives to Matlab

2006-12-05 Thread Jon Harrop
Filip Wasilewski wrote: > Besides of that this code is irrelevant to the original one and your > further conclusions may not be perfectly correct. Please learn first > about the topic of your benchmark and different variants of wavelet > transform, namely difference between lifting scheme and dwt,

Re: merits of Lisp vs Python

2006-12-09 Thread Jon Harrop
y, max. And they would work the right way first time. > No, I haven't actually done it myself. But I'm sure I could do it, easy." True. -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/inde

Re: merits of Lisp vs Python

2006-12-09 Thread Jon Harrop
moization whereas c.l.p has a thread about wrestling oiled pigs. -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet -- http://mail.python.org/mailman/listinfo/python-list

Re: About alternatives to Matlab

2006-12-11 Thread Jon Harrop
[EMAIL PROTECTED] wrote: > On 10.12.2006, at 11:23, Jon Harrop wrote: >> F# addresses this by adding operator overloading. However, you have >> to add more type annotations... > > That sounds interesting, but I'd have to see this in practice to form > an opinion. As

Re: About alternatives to Matlab

2006-12-11 Thread Jon Harrop
Carl Banks wrote: > Jon Harrop wrote: >> What about translating the current Python interpreter into a language >> with a GC, like MLton-compiled SML? That would probably make it much >> faster, more reliable and easier to develop. > > I doubt it would work too

Re: About alternatives to Matlab

2006-12-12 Thread Jon Harrop
NET vs OCaml or MLton). -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-12 Thread Jon Harrop
/www.ffconsultancy.com/products/ocaml_for_scientists/visualisation More recently, I've been writing F# examples: http://www.ffconsultancy.com/dotnet/fsharp You can probably translate the F# demos into a Lisp for .NET without too much difficulty. -- Dr Jon D Harrop, Flying Frog Consultanc

Re: merits of Lisp vs Python

2006-12-12 Thread Jon Harrop
and related syntax (e.g. pattern matching, comprehensions). I think this is an important point often missed by Lispers. > lazyness has a nontrivial cost, however, both runtime and cognitive. The main problem with lazy evaluation is unpredictable memory use. -- Dr Jon D Harrop, Flying Frog C

Re: merits of Lisp vs Python

2006-12-12 Thread Jon Harrop
body decades of programming language research. -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-12 Thread Jon Harrop
o learn what's new. For example, we're going multicore whether you like it or not, so concurrent GCs will become much more important over the next few years. F# adds that to OCaml. That's new and its better. -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-12 Thread Jon Harrop
Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet -- http://mail.python.org/mailman/listinfo/python-list

Re: About alternatives to Matlab

2006-12-12 Thread Jon Harrop
s inherently slower. I haven't benchmarked this in detail but F# seems to be 2-4x slower than OCaml here. -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-12 Thread Jon Harrop
7; p e1 e2 = doodleShooble(); force (if p then e1 else e2) -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-12 Thread Jon Harrop
g, f_Args(x), g_Args(x)) > > if you adopt cond. But of course it is getting ugly. > So a macro can free you from this extra code. Yes, that's just lazy evaluation. Again, you don't need macros. -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists htt

Re: merits of Lisp vs Python

2006-12-12 Thread Jon Harrop
unting the brain units which I regard as an important factor > they are both equal. Python is clearly more succinct in this case. I also think it is worth counting chars or LOC as well as tokens. Lisp has unnecessarily long built-in tokens... -- Dr Jon D Harrop, Flying Frog Consultancy Objective

Re: merits of Lisp vs Python

2006-12-12 Thread Jon Harrop
ode is 30x slower than native code on this benchmark. -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet -- http://mail.python.org/mailman/listinfo/python-list

Re: About alternatives to Matlab

2006-12-13 Thread Jon Harrop
Filip Wasilewski wrote: > Jon, both Python and Matlab implementations discussed here use the > lifting scheme, while yours is a classic convolution based approach. I've done both in OCaml. The results are basically the same. > These are two *different* algorithms for computing wave

Re: About alternatives to Matlab

2006-12-13 Thread Jon Harrop
quite a good PPC backend for the Mac already so you might be able to persuade a student to do the conversion as a project. If Mono runs on that platform then you might also consider F#... -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.

Re: About alternatives to Matlab

2006-12-13 Thread Jon Harrop
Marc 'BlackJack' Rintsch wrote: > So you don't count line endings when counting bytes. ;-) You'd probably replace "\n" -> " " so it wouldn't affect the byte count. Anyway, I think I was using non-whitespace bytes, so neither "\n" nor

Re: About alternatives to Matlab

2006-12-14 Thread Jon Harrop
oint intensive code is as fast as OCaml and MLton. -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet -- http://mail.python.org/mailman/listinfo/python-list

Re: About alternatives to Matlab

2006-12-14 Thread Jon Harrop
Filip Wasilewski wrote: > Jon Harrop wrote: >> Filip Wasilewski wrote: >> > Jon, both Python and Matlab implementations discussed here use the >> > lifting scheme, while yours is a classic convolution based approach. >> >> I've done both in OCaml. The r

Re: About alternatives to Matlab

2006-12-15 Thread Jon Harrop
Filip Wasilewski wrote: > Jon Harrop wrote: >> Yes. The time taken is dominated by memory accesses. The amount of >> arithmetic is almost irrelevant. > > I can say from my experience, that this depends much on the input size > and the CPU cache size. For arrays of about n^

Re: About alternatives to Matlab

2006-12-15 Thread Jon Harrop
sturlamolden wrote: > Jon Harrop wrote: >> Yes. The time taken is dominated by memory accesses. The amount of >> arithmetic is almost irrelevant. > > That is extremely interesting. It would explain why I see almost the > same performance in NumPy and Fortran 95 on this kin

Re: merits of Lisp vs Python

2006-12-16 Thread Jon Harrop
t; a particular paradigm, however powerful, is what makes any such > language strictly less expressive than one with syntactic abstraction > over a uniform syntax. Can you give an example of a Lisp macro that does something useful that you can't do in these other languages?

Re: merits of Lisp vs Python

2006-12-17 Thread Jon Harrop
Raffael Cavallaro wrote: > On 2006-12-16 13:58:37 -0500, Jon Harrop <[EMAIL PROTECTED]> said: >> Why do you think that uniform syntax is necessary to provide new >> paradigms when it is equivalent to infix syntax? > > Because it doesn't require one to write a parse

Re: merits of Lisp vs Python

2006-12-17 Thread Jon Harrop
Raffael Cavallaro wrote: > On 2006-12-17 07:54:28 -0500, Jon Harrop <[EMAIL PROTECTED]> said: >> What if eager impurity isn't the "very nature" of the problem but, >> rather, is the very nature of Tilton's chosen solution? > > That's the who

Re: merits of Lisp vs Python

2006-12-17 Thread Jon Harrop
haskell and ocaml when you > already have lisp. On the contrary, Lisp predates the features and, since their inception, most Lisp programmers have moved on to newer languages. -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml

Re: merits of Lisp vs Python

2006-12-17 Thread Jon Harrop
ed, without causing a leak, so these > programs are no longer buggy. The pool of non-buggy programs has > increased without anything being rejected. You have rejected all programs that rely upon a resource being disposed before a certain point. -- Dr Jon D Harrop, Flying Frog Consul

Re: How to replace a comma

2006-12-18 Thread Jon Clements
s depending on what you really want to achieve. For instance, what happens with: a comma appearing before any text, consecutive commas (ie ,,,), or commas within quotes? hth Jon. -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-19 Thread Jon Harrop
(OCaml, SML and F#) are typically much faster than those that do (Lisp, Scheme, Dylan). -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet -- http://mail.python.org/mailman/listinfo/python-list

Re: Xah's Edu Corner: Introduction to 3D Graphics Programing

2006-12-23 Thread Jon Harrop
interactive mode that allows you to visualise 2D and 3D graphics in real time with simplicity rivalling Mathematica but the sophistication and performance of DirectX, whilst also having the power of the F# programming language and .NET to analyse your data. -- Dr Jon D Harrop, Flying Frog Consu

Re: Writing more efficient code

2007-01-01 Thread Jon Harrop
everal fold whilst also having it run a few orders of magnitude faster and having it statically checked, so it will be more reliable. You might want to look at any language with pattern matching: OCaml, SML, Haskell, F#, Mathematica etc. If you're running Windows then F# is a .NET language... -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing more efficient code

2007-01-01 Thread Jon Harrop
[EMAIL PROTECTED] wrote: > Jon Harrop: >> OCaml's pattern matcher is very sophisticated and very fast. You'll >> probably shrink your code by several fold whilst also having it run a few >> orders of magnitude faster and having it statically checked, so it will >

Re: Writing more efficient code

2007-01-02 Thread Jon Harrop
hing isn't a language. -- Dr Jon D Harrop, Flying Frog Consultancy Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?usenet -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing more efficient code

2007-01-02 Thread Jon Harrop
[EMAIL PROTECTED] wrote: > Jon Harrop: >> I think most people could pick up the core ideas in a day and start >> writing working programs. > > Probably I am not that intelligent, I probably need some months :-) But > that language has many good sides, and one day I'll

Re: Encoding / decoding strings

2007-01-05 Thread Jon Clements
27; of the input data: given this, it's impossible to reproduce the original input. Is this what you're looking for? >>> import urllib >>> urllib.quote('[EMAIL PROTECTED]') 'some.persons%40somedomain.com' hth Jon. -- http://mail.python.org/mailman/listinfo/python-list

Best Web dev language

2005-06-10 Thread Jon Slaughter
ed to make certain things easier and dynamic(just as generating tables and forms and all that). Thanks for any help, Jon -- http://mail.python.org/mailman/listinfo/python-list

Re: 16bit hash

2007-06-27 Thread Jon Ribbens
On 2007-06-27, Robin Becker <[EMAIL PROTECTED]> wrote: > Is the any way to get an efficient 16bit hash in python? int(md5.new(s).hexdigest()[:4], 16) ? -- http://mail.python.org/mailman/listinfo/python-list

Re: web page text extractor

2007-07-12 Thread Jon Rosebaugh
On 2007-07-12 04:42:25 -0500, kublai <[EMAIL PROTECTED]> said: > For a project, I need to develop a corpus of online news stories. I'm > looking for an application that, given the url of a web page, "copies" > the rendered text of the web page (not the source HTNL text), opens a > text editor (Not

Re: I need a string/list/generator/comprehension incantation.

2007-04-20 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Steven W. Orr wrote: > Now I want something that's going to give me a string whose value is the > set of all of the first letters of months. Order is not important. "".join(set(m[0] for m in calendar.month_abbr[1:])) > And for extra credit, I need the string whose

Re: *** Watch BOMBSHELL video of Senator John Kerry admitting 911 was in INSIDE JOB ???

2007-04-24 Thread Jon Slaughter
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > http://www.911blogger.com/node/8053 > > Senator John Kerry was questioned concerning 9/11 during an appearance > at Book People in Austin, Texas. Members of Austin 9/11 Truth Now > asked Kerry about the officially unexplained collapse

Re: Writing a nice formatted csv file

2007-05-02 Thread Jon Clements
# List of formatting to apply to each column (change this to suit) format = ['%03d', '%10s', '%10s'] data = [1, 10, 100] print [fmt % d for fmt,d in zip(format,data)] Results in: ['001', '10', ' 100'] Then write that using the CSV module. hth Jon. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why stay with lisp when there are python and perl?

2007-05-03 Thread Jon Harrop
ing polymorphic variants. However, this is not generally a good idea because they are slower and harbor some of the disadvantages of dynamic typing. It is worth noting that eager, statically-typed languages like OCaml and F# are many times faster than the other languages at this task. This is preci

Re: File modes

2007-05-10 Thread Jon Pentland
I don't really see the use for being able to do that. Have you tried doing it with the 'app' mode?, But I am guessing that it is just an advanced mode spawned from 'w'. So, no, I don't think you can do this. -- http://mail.python.org/mailman/listinfo/python-list

Re: File writing success

2007-05-11 Thread Jon Ribbens
On 2007-05-11, HMS Surprise <[EMAIL PROTECTED]> wrote: > If file writing has no return value (http://docs.python.org/lib/bltin- > file-objects.html), how do you know if the write was successful? Because no exception was thrown? Although bear in mind that some errors might not become apparent unti

Iron Python

2007-05-15 Thread Jon Harrop
Anybody tried it? -- Dr Jon D Harrop, Flying Frog Consultancy The F#.NET Journal http://www.ffconsultancy.com/products/fsharp_journal/?usenet -- http://mail.python.org/mailman/listinfo/python-list

psycopg2 & large result set

2007-05-25 Thread Jon Clements
s an interface or a server thing. Any ideas are most welcome. Cheers, Jon. -- http://mail.python.org/mailman/listinfo/python-list

Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations

2007-05-28 Thread Jon Harrop
, Java or any functional language (except OCaml and F# and excluding WPF and Silverlight)? -- Dr Jon D Harrop, Flying Frog Consultancy The F#.NET Journal http://www.ffconsultancy.com/products/fsharp_journal/?u7 -- http://mail.python.org/mailman/listinfo/python-list

Re: google maps api for py?

2007-05-30 Thread Jon Crump
Kev, Geopy is pretty cool: http://exogen.case.edu/projects/geopy/ On Wed, 30 May 2007, Bell, Kevin wrote: > I see that the weapon of choice for google maps is javascript... Is > there anything for python? > > > > Kev > > -- http://mail.python.org/mailman/listinfo/python-list

sys.ps1 with formatting (linux)

2007-07-23 Thread Jon Dobson
I'm trying to set sys.ps1 and sys.ps2 with some formatting (linux) using: python -i -c 'import sys; sys.ps1="\033[1m\033[32mspy>\033[0m";sys.ps2="\033[1m\033[32m .\033[0m"' I get the colored prompt(s) as you might expect, but I'm getting some strange behavior with wrapping. Once the interact

<    1   2   3   4   5   6   7   8   9   10   >