Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41049

Re: Regular expression problem

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'revision': 0.05; 'python': 0.09; 'correct,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; 'toss': 0.09; 'wrong,': 0.09; 'programmer': 0.11; 'languages.': 0.15; 'correctness.': 0.16; 'losing': 0.16; 'low-level': 0.16; 'meanwhile,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:Regular': 0.16; 'subject:expression': 0.16; 'later': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'tests': 0.18; 'code.': 0.20; 'equivalent': 0.20; 'trying': 0.21; 'subject:problem': 0.22; 'programming': 0.23; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; '[1]': 0.27; 'correct': 0.28; 'header:X-Complaints-To:1': 0.28; 'all.': 0.28; 'run': 0.28; 'thus,': 0.29; '(and': 0.32; 'getting': 0.33; 'to:addr:python-list': 0.33; 'know.': 0.33; 'wrong': 0.34; 'faster': 0.35; 'pm,': 0.35; 'received:org': 0.36; 'but': 0.36; 'test': 0.36; 'should': 0.36; 'problems': 0.36; 'bad': 0.37; 'correctly': 0.37; 'previous': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'back': 0.62; 'solve': 0.62; 'limit': 0.65; 'teaching': 0.66; 'received:fios.verizon.net': 0.84; 'refuses': 0.84; 'remember,': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Regular expression problem
Date Sun, 10 Mar 2013 22:06:12 -0400
References <c24ab822-a3f4-4faf-8a6d-2e1fde6552ae@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-173-75-251-66.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3
In-Reply-To <c24ab822-a3f4-4faf-8a6d-2e1fde6552ae@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3174.1362967600.2939.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1362967600 news.xs4all.nl 6842 [2001:888:2000:d::a6]:35251
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:41049

Show key headers only | View raw


On 3/10/2013 1:42 PM, mukesh tiwari wrote:
> Hello all
> I am trying to solve this problem[1]
> [1] http://www.spoj.com/problems/MAIN12C/

As I remember, and as it still appears, this site severely penalizes 
Python solvers by using the same time limit for all languages. Thus, a 
'slow' python program may work correctly but the site will not let you 
know. A test that refuses to answer is no test at all. In the meanwhile, 
an algorithmically equivalent C program will be run and judged correct, 
so the programmer can try to speed up while not losing correctness.

By teaching 'speed before correctness", this site promotes bad 
programming habits and thinking (and the use of low-level but faster 
languages). I quote your later response: "Now I am getting wrong answer 
so at least program is faster then previous one". If the previous one 
was correct and the revision wrong, you should toss the revision and go 
back to the correct program.

I recommend that you work on problems where you have tests that you can 
actually run even before you code.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Regular expression problem mukesh tiwari <mukeshtiwari.iiitm@gmail.com> - 2013-03-10 10:42 -0700
  Re: Regular expression problem Chris Angelico <rosuav@gmail.com> - 2013-03-11 04:59 +1100
    Re: Regular expression problem mukesh tiwari <mukeshtiwari.iiitm@gmail.com> - 2013-03-10 11:05 -0700
    Re: Regular expression problem mukesh tiwari <mukeshtiwari.iiitm@gmail.com> - 2013-03-10 11:05 -0700
  Re: Regular expression problem Chris Angelico <rosuav@gmail.com> - 2013-03-11 05:08 +1100
    Re: Regular expression problem mukesh tiwari <mukeshtiwari.iiitm@gmail.com> - 2013-03-10 11:48 -0700
      Re: Regular expression problem Chris Angelico <rosuav@gmail.com> - 2013-03-11 05:57 +1100
    Re: Regular expression problem mukesh tiwari <mukeshtiwari.iiitm@gmail.com> - 2013-03-10 11:48 -0700
  Re: Regular expression problem Terry Reedy <tjreedy@udel.edu> - 2013-03-10 22:06 -0400
    Re: Regular expression problem jmfauth <wxjmfauth@gmail.com> - 2013-03-11 02:28 -0700
      Re: Regular expression problem Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-03-11 10:19 +0000
      Re: Regular expression problem rusi <rustompmody@gmail.com> - 2013-03-11 06:18 -0700
      On topic, please [Was:Re: Regular expression problem] Ned Deily <nad@acm.org> - 2013-03-11 11:13 -0700
  Re: Regular expression problem Serhiy Storchaka <storchaka@gmail.com> - 2013-03-11 20:30 +0200
  Re: Regular expression problem Terry Reedy <tjreedy@udel.edu> - 2013-03-11 16:23 -0400

csiph-web