Ed Avis
Recent Actions
-
Commented on My Top MySQL Gripes
I think that having a general-purpose string type in the database is a wonderful idea. It is less good to pretend to parse definitions like 'int' or 'char(10)' but silently ignore them. If SQLLite required all columns to be declared...
-
Commented on My Top MySQL Gripes
You think that's bad? In SQLLite, even the type of a column is silently parsed and then ignored! "So, for example, if a column is of type INTEGER and you try to insert a string into that column, SQLite will...
-
Commented on Q: When not to use Regexp? A: HTML parsing
Yes, I have sometimes found it easier to use HTML::TableExtract or other modules which truly parse the HTML and walk over its structure. It depends on how well-structured the page is and what you are trying to extract. A CSS...
-
Commented on Q: When not to use Regexp? A: HTML parsing
Why bother to parse the HTML cleanly if a change to the site will break your code anyway? Usually you do not care about the structure of the whole HTML page but only the part you are interested in. The...
-
Commented on Marpa::R2 is beta
Thanks for answering my query about the O-notation. I have an existing grammar for Parse::RecDescent and use that module's $RD_AUTOACTION hook to return the complete parse tree. Is there a tool to convert the grammar or a way to get...
-
Commented on Marpa::R2 is beta
When you say O(n^2) what is n? The size of the input document or the size of the grammar?...
Comment Threads
-
Aristotle commented on
Q: When not to use Regexp? A: HTML parsing
Yes, that is what the link to “the cthulhu way” points to.
-
Aristotle commented on
Q: When not to use Regexp? A: HTML parsing
Because you can start by taking an example of the HTML you want to match and adding placeholders, it is immediately clear what HTML structure is matched - as long as you keep your regexp nicely formatted and commented using /x.
No amount of
/x
will make regexps look less messy than a CSS selector. Aside from that, the regexp will break not only when the layout breaks, but for even the most minor variation, such as the quotes around an attribute changing from double to single, or being removed altogether; the order of attributes changing; a comment being… -
Aristotle commented on
My Top MySQL Gripes
SQLite does assign some significance to the data type of a column – it picks different type coercion affinities depending on the data type. And it supports types in the same way Perl does: if you ask it for a string it will do its best to try and give you a string, and if you ask for an integer it will do its best to give you that. Works for me in Perl, I’m not sure why it’s suddenly horrible when it happens in SQL instead.
If you think MySQL is better than SQLite for supporting data types, I want to see your face next time you
INSERT
a 200-character strin… -
asknet999.myopenid.com commented on
Marpa::R2 is beta
Hi,
I'm learning to use Marpa::R2. I see when the parse fails only it gives the below error
Problem in b->new(): No parse at /fs_user/saddanki/perl5.12.3/lib/site_perl/5.12.3/x86_64-linux/Marpa/R2/Value.pm line 645Above information isn't much helpful. I don't why it's failed? so how to further debug to know.
I have uploaded my experimental code here
http://pastebin.com/ayiUtVsPPlease tell me what else I need to do to enable a better debugging messages!
-
Jeffrey Kegler commented on
Marpa::R2 is beta
For support there is a Marpa mailing list: marpa-parser@googlegroups.com. I follow this list as much as I can, and other experts in Marpa use help answer the questions.
As a start, the Marpa::R2 documentation has a page on tracing issues with grammars. In particular, Marpa's "progress reports" are extremely helpful -- I use them a lot.
About blogs.perl.org
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.