Re: [q-lang-users] cgi.q
Brought to you by:
agraef
From: Albert G. <Dr....@t-...> - 2006-05-19 21:41:21
|
Tim Haynes wrote: > Eep, well spotted. OK, I'm attaching the latest version I have in use here. Dear Tim, thanks a lot indeed. I'm ready to commit the new version to cvs, but with Q 7.1 I get: Error cgi.q, line 91: invalid character escape `\?'. Here's the corresponding line: (regex "" "^http://[^?]+\?(.*)$" HR (reg 1) ) You probably want a \\? there? (Yes, John, I admit that you were right all along: It's hard to spot such bugs without making unrecognized char escapes a syntax error. (-:) > * A `strictatoi' function (a wrapper around val that only works if the > string is a number - saves a risk of Q-injection! - also uses `matches') I don't know whether this is helpful, but you can also use `valq' to do a "safe parse" without evaluating anything: safe_atoi S = I where 'I:Int = valq S; BTW, do you still have a Q-powered page available anywhere? I remember that you once had a part of the interface to your picture collection written in Q, is that still the case? In case someone is interested in this side of Q programming, I also have a little Q-powered website. The entry point is here: http://muwiinfa.geschichte.uni-mainz.de:5050/kirnberger.html It lets you throw the dice (you must have JavaScript enabled in your browser to make that work) and compose your own random "Kirnberger polonaise", which is then served as a MIDI file. Instructions and a link to the source code of the script are on the page. Hmm, it just came to me that I should probably put some Q cgi scripting examples on q-lang.sf.net... Cheers, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |