Searching \ for '[OT] Problems and solutions (Was: Preemptive Timin' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/index.htm?key=preemptive+timin
Search entire site for: 'Problems and solutions (Was: Preemptive Timin'.

Exact match. Not showing close matches.
PICList Thread
'[OT] Problems and solutions (Was: Preemptive Timin'
2009\05\25@121649 by Gerhard Fiedler

picon face
solarwind wrote:

> On Sun, May 24, 2009 at 5:36 PM, Rikard Bosnjakovic wrote:
>>    Some people, when confronted with a problem, think ´I know,
>>    Iÿll use regular expressions.¡. Now they have two problems.
>>
>>                --Jamie Zawinski
>
> This jamie zawinski dude has no idea what he's talking about. Regular
> expressions are awesome. They've worked so well for me in the past.
> Really well. They're used all over the world, all the time. They solve
> problems. They're easy to use, solid and time tested.

I don't know that guy (do you?), but I know regexps -- and I know what
he is talking about. A similar quote (don't know from whom) is --
paraphrased --: When all you know is a hammer, everything looks like a
nail. Only after you learn how to properly use screwdrivers, wrenches of
all sorts, and all the other nice tools around do you get a fuller
picture.

Gerhard

2009\05\25@122746 by Tamas Rudnai

face picon face
2009/5/25 Gerhard Fiedler <spam_OUTlistsTakeThisOuTspamconnectionbrazil.com>

> I don't know that guy (do you?), but I know regexps -- and I know what
> he is talking about. A similar quote (don't know from whom) is --
> paraphrased --: When all you know is a hammer, everything looks like a
> nail. Only after you learn how to properly use screwdrivers, wrenches of
> all sorts, and all the other nice tools around do you get a fuller
> picture.


I my experience all problems are coming when you use variables in regexp. To
tracking down in what circumstances the regexp does not work sometimes is
quite hard. Also to speed the process up is a bit of tedious job.

Tamas

2009\05\25@133934 by Rolf

flavicon
face
Tamas Rudnai wrote:
> 2009/5/25 Gerhard Fiedler <.....listsKILLspamspam@spam@connectionbrazil.com>
>
>  
>> I don't know that guy (do you?), but I know regexps -- and I know what
>> he is talking about. A similar quote (don't know from whom) is --
>> paraphrased --: When all you know is a hammer, everything looks like a
>> nail. Only after you learn how to properly use screwdrivers, wrenches of
>> all sorts, and all the other nice tools around do you get a fuller
>> picture.
>>    
>
>
> I my experience all problems are coming when you use variables in regexp. To
> tracking down in what circumstances the regexp does not work sometimes is
> quite hard. Also to speed the process up is a bit of tedious job.
>
> Tamas
>  
bahhhh.

I love RegEx's... for all the wrong reasons, I am sure.... but, in
general, regexes are used to solve problems that would otherwise take
(many ..) multiple lines to program.

The complexity of a RegEx is no greater than the equivalent code in
whatever language. In other words, complex problems can have
complex-looking solutions... whether those solutions are short
'confusing' regexes, or longer but convoluted 'traditional' code. The
likelihood of a bug in one or the other approach is approximately
equivalent (my opinion). On the other hand, it is much easier for a
Regex competent person to put something in a regex than to do the same
thing 'long-handed'... and also easier/quicker to maintain (but pity the
person who needs to maintain a regex and does not know how they work ...).

There are two issues I encounter when I deal with regexes....

1. using them in places where they try to solve simple problems in
complex ways.... like having 'OR' logic in a regex is often overkill...
when simple if (regex1) else if (regex2) else ... blocks would suffice.
Regexes are nice, but in my opinion they should not be used to implement
program logic flow. Use them to process text... and leave program logic
outside the regex.

2. They are near impossible to debug. Most languages allow you to trace
or step through the program... but the regex engine is a huge black-box
monstrosity that you can't debug. So, if there are regex problems it is
hard to fix. Anyway, even if you could trace through the engine, you
likelyy would not understand it anyway ;-)
Breaking the regex in to multiple smaller steps is often the only way
to solve this problem.

Otherwise, RegExes are the holy grail of text processing.

Rolf

2009\05\25@142814 by Harold Hallikainen

face
flavicon
face
I am by no means a regular expressions expert, but I do find them useful.
I use them to build the pages at htp://http://www.hallikainen.com . I used them
(in perl) to convert Unifont font files to hex code to program a flash.
There are some nice online regular expression evaluators where you can put
in some text and the regular expression and immediately see the results. I
end up experimenting through these until I get something that does what I
want.

Powerful and cryptic!

Harold


--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!

2009\05\25@145545 by Isaac Marino Bavaresco

flavicon
face
Harold Hallikainen escreveu:
> I am by no means a regular expressions expert, but I do find them useful.
> I use them to build the pages at htp://http://www.hallikainen.com . I used them
> (in perl) to convert Unifont font files to hex code to program a flash.
> There are some nice online regular expression evaluators where you can put
> in some text and the regular expression and immediately see the results. I
> end up experimenting through these until I get something that does what I
> want.
>
> Powerful and cryptic!
>
> Harold
>  


Most problems admit more than one solution, some bad some good.
Some problems admit several good solutions, and the programmer may chose
among them, based on his own preferences or skills.

Some programs may be written using state machines or a RTOS, other
problems may not be well served by one or another method.
If the programmer only masters one method, he will use it, even if it is
not the best one.

I think saying "RTOS are useless" or "state machines are too
complicated" or something like this is silly, because sometimes it is
the best solution.
Each case is best suited to a method, or sometimes to more than one.
In my case, I prefer to know as many methods I can, so I can chose the
best fit for each situation.

Regards,

Isaac

__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

2009\05\25@160519 by Alex Harford

face picon face
2009/5/25 Gerhard Fiedler <listsspamKILLspamconnectionbrazil.com>:
>
> I don't know that guy (do you?), but I know regexps -- and I know what
> he is talking about. A similar quote (don't know from whom) is --
> paraphrased --: When all you know is a hammer, everything looks like a
> nail. Only after you learn how to properly use screwdrivers, wrenches of
> all sorts, and all the other nice tools around do you get a fuller
> picture.

Jamie Zawinski, of xemacs, Netscape and xscreensaver fame.  jwz.org is
his website.

Some great articles:
http://www.jwz.org/doc/

2009\05\25@160943 by Harold Hallikainen

face
flavicon
face

> Each case is best suited to a method, or sometimes to more than one.
> In my case, I prefer to know as many methods I can, so I can chose the
> best fit for each situation.
>

Summarizing, If all you have is a hammer, everything looks like a nail.

Harold



--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!

2009\05\25@180626 by Vitaliy

flavicon
face
Harold Hallikainen wrote:
>I am by no means a regular expressions expert, but I do find them useful.
> I use them to build the pages at htp://http://www.hallikainen.com . I used them
> (in perl) to convert Unifont font files to hex code to program a flash.
> There are some nice online regular expression evaluators where you can put
> in some text and the regular expression and immediately see the results. I
> end up experimenting through these until I get something that does what I
> want.
>
> Powerful and cryptic!

Harold, can you recommend any good tutorials, and maybe provide a link to
your favorite regex evaluator?


2009\05\25@210504 by Harold Hallikainen

face
flavicon
face

> Harold, can you recommend any good tutorials, and maybe provide a link to
> your favorite regex evaluator?

Unfortunately not. I think I first started reading about regular
expressions in a book on perl. Now, when I need to do something using
regex, it's a situation of I know it can be done and then have to research
how to do it. So... not much help from here...

Harold



--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!

2009\05\27@141016 by Alex Harford

face picon face
On Mon, May 25, 2009 at 3:05 PM, Vitaliy <.....spamKILLspamspam.....maksimov.org> wrote:
> Harold Hallikainen wrote:
>>
>> Powerful and cryptic!
>
> Harold, can you recommend any good tutorials, and maybe provide a link to
> your favorite regex evaluator?
>

I'm not Harold, but I've found these two to be useful.
http://www.amk.ca/python/howto/regex/
http://www.geocities.com/volontir/

Testing a regex in vim is my favourite method because of the
highlighting, undos, and command history but I wouldn't recommend
learning vi just for regexs!

Alex

2009\05\28@064237 by Gerhard Fiedler

picon face
Alex Harford wrote:

> Testing a regex in vim is my favourite method

Note that there are different flavors of regexes around -- so if you're
looking for a tester/simulator, make sure it works the same way as the
regexes you're using in your code :)

Gerhard

More... (looser matching)
- Last day of these posts
- In 2009 , 2010 only
- Today
- New search...