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


Groups > comp.lang.javascript > #32752 > unrolled thread

regexp 0 - 3 digits

Started byAndrew Poulos <ap_prog@hotmail.com>
First post2017-03-15 14:39 +1100
Last post2017-04-04 06:20 -0700
Articles 20 on this page of 23 — 9 participants

Back to article view | Back to comp.lang.javascript


Contents

  regexp 0 - 3 digits Andrew Poulos <ap_prog@hotmail.com> - 2017-03-15 14:39 +1100
    Re: regexp 0 - 3 digits JJ <jj4public@vfemail.net> - 2017-03-15 10:55 +0700
      Re: regexp 0 - 3 digits Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2017-03-15 06:42 +0100
        Re: regexp 0 - 3 digits "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-03-15 09:19 +0100
          Re: regexp 0 - 3 digits Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2017-03-15 09:29 +0100
            Re: regexp 0 - 3 digits Julio Di Egidio <julio@diegidio.name> - 2017-03-15 03:01 -0700
            Re: regexp 0 - 3 digits "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-03-15 05:39 -0700
          Re: regexp 0 - 3 digits Julio Di Egidio <julio@diegidio.name> - 2017-03-15 05:20 -0700
            Re: regexp 0 - 3 digits "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-03-15 05:43 -0700
              Re: regexp 0 - 3 digits Julio Di Egidio <julio@diegidio.name> - 2017-03-15 05:48 -0700
                Re: regexp 0 - 3 digits "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-03-15 06:28 -0700
                  Re: regexp 0 - 3 digits Julio Di Egidio <julio@diegidio.name> - 2017-03-15 06:43 -0700
                    Re: regexp 0 - 3 digits Jon Ribbens <jon+usenet@unequivocal.eu> - 2017-03-15 14:06 +0000
                      Re: regexp 0 - 3 digits Julio Di Egidio <julio@diegidio.name> - 2017-03-15 07:56 -0700
                        Re: regexp 0 - 3 digits Jon Ribbens <jon+usenet@unequivocal.eu> - 2017-03-15 16:05 +0000
                          Re: regexp 0 - 3 digits Julio Di Egidio <julio@diegidio.name> - 2017-03-15 21:12 -0700
                            Re: regexp 0 - 3 digits Jon Ribbens <jon+usenet@unequivocal.eu> - 2017-03-16 11:04 +0000
                    Re: regexp 0 - 3 digits "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-03-15 08:12 -0700
    Re: regexp 0 - 3 digits "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-03-15 05:45 -0700
    Re: regexp 0 - 3 digits Dr J R Stockton <J.R.Stockton@physics.org> - 2017-03-15 11:54 -0700
      Re: regexp 0 - 3 digits Dr J R Stockton <reply1700@merlyn.demon.co.uk.invalid> - 2017-04-03 19:59 +0100
        Re: regexp 0 - 3 digits "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-04 09:38 +0200
          Re: regexp 0 - 3 digits Dr J R Stockton <J.R.Stockton@physics.org> - 2017-04-04 06:20 -0700

Page 1 of 2  [1] 2  Next page →


#32752 — regexp 0 - 3 digits

FromAndrew Poulos <ap_prog@hotmail.com>
Date2017-03-15 14:39 +1100
Subjectregexp 0 - 3 digits
Message-ID<v_edndmyGa_2KlXFnZ2dnUU7-I_NnZ2d@westnet.com.au>
I have this string
   dd:dd:dd,ddd
where the d's are digits and I'm using this to match it
   match(/^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9][0-9][0-9]/);

Now I find that after the comma there may be from 0 to 3 digits.

How can I modify the expression to handle that?

Andrew Poulos

[toc] | [next] | [standalone]


#32753

FromJJ <jj4public@vfemail.net>
Date2017-03-15 10:55 +0700
Message-ID<173p630vvwvm8.1i0p4mivdhm7b.dlg@40tude.net>
In reply to#32752
On Wed, 15 Mar 2017 14:39:22 +1100, Andrew Poulos wrote:
> I have this string
>    dd:dd:dd,ddd
> where the d's are digits and I'm using this to match it
>    match(/^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9][0-9][0-9]/);
> 
> Now I find that after the comma there may be from 0 to 3 digits.
> 
> How can I modify the expression to handle that?
> 
> Andrew Poulos

  /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9]{0,3}/

You can short it to:

  /^[0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{0,3}/

[toc] | [prev] | [next] | [standalone]


#32754

FromCezary Tomczyk <cezary.tomczyk@gmail.com>
Date2017-03-15 06:42 +0100
Message-ID<oaak7j$1ag0$1@csiph.com>
In reply to#32753
On 15/03/2017 04:55, JJ wrote:
> On Wed, 15 Mar 2017 14:39:22 +1100, Andrew Poulos wrote:
>> I have this string
>>    dd:dd:dd,ddd
>> where the d's are digits and I'm using this to match it
>>    match(/^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9][0-9][0-9]/);
>>
>> Now I find that after the comma there may be from 0 to 3 digits.
>>
>> How can I modify the expression to handle that?
>>
>> Andrew Poulos
>
>   /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9]{0,3}/
>
> You can short it to:
>
>   /^[0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{0,3}/

or to:

/^[\d]{2}:[\d]{2}:[\d]{2},[\d]{0,3}/

-- 
Cezary Tomczyk
http://www.ctomczyk.pl/
https://www.aslint.org/ - Accessibility linting tool

[toc] | [prev] | [next] | [standalone]


#32755

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-03-15 09:19 +0100
Message-ID<XnsA7395EE1BE64eejj99@194.109.6.166>
In reply to#32754
Cezary Tomczyk <cezary.tomczyk@gmail.com> wrote on 15 Mar 2017 in 
comp.lang.javascript:

> On 15/03/2017 04:55, JJ wrote:
>> On Wed, 15 Mar 2017 14:39:22 +1100, Andrew Poulos wrote:
>>> I have this string
>>>    dd:dd:dd,ddd
>>> where the d's are digits and I'm using this to match it
>>>    match(/^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9][0-9][0-9]/);
>>>
>>> Now I find that after the comma there may be from 0 to 3 digits.
>>>
>>> How can I modify the expression to handle that?
>>>
>>> Andrew Poulos
>>
>>   /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9]{0,3}/
>>
>> You can short it to:
>>
>>   /^[0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{0,3}/
> 
> or to:
> 
> /^[\d]{2}:[\d]{2}:[\d]{2},[\d]{0,3}/

\d\d is shorter than \d{2}

No reason for the '[]'s
and
'\d\d' is shorter than '\d{2}'

/^\d\d:\d\d:\d\d,\d{0,3}/

Meseems you want no trailing characters,
so add a final '$':

/^\d\d:\d\d:\d\d,\d{0,3}$/

But probably you want to have no comma, 
when there are zero decimals:

/^\d\d:\d\d:\d\d(,\d{1,3})?$/

or if you want to make the comma optional,
when no decimals:

/^\d\d:\d\d:\d\d(,|,\d{1,3})?$/

==================

testing:

<script type='text/javascript'> 'use strict'
	function w(x,a) { document.write(x.test(a)+'<br>'); };
	w(/^\d\d:\d\d:\d\d(,\d{1,3})?$/, '01:01:01,12'); // true
	w(/^\d\d:\d\d:\d\d(,\d{1,3})?$/, '01:01:01,12 '); // false
	w(/^\d\d:\d\d:\d\d(,\d{1,3})?$/, '01:01:01'); // true
	w(/^\d\d:\d\d:\d\d(,\d{1,3})?$/, '01:01:01,'); // false
	w(/^\d\d:\d\d:\d\d(,|,\d{1,3})?$/, '01:01:01'); // true
	w(/^\d\d:\d\d:\d\d(,|,\d{1,3})?$/, '01:01:01,'); // true
</script>

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#32757

FromCezary Tomczyk <cezary.tomczyk@gmail.com>
Date2017-03-15 09:29 +0100
Message-ID<oaau26$1hg8$1@csiph.com>
In reply to#32755
On 15/03/2017 09:19, Evertjan. wrote:
> Cezary Tomczyk <cezary.tomczyk@gmail.com> wrote on 15 Mar 2017 in
> comp.lang.javascript:
>
>> On 15/03/2017 04:55, JJ wrote:
>>> On Wed, 15 Mar 2017 14:39:22 +1100, Andrew Poulos wrote:
>>>> I have this string
>>>>    dd:dd:dd,ddd
>>>> where the d's are digits and I'm using this to match it
>>>>    match(/^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9][0-9][0-9]/);
>>>>
>>>> Now I find that after the comma there may be from 0 to 3 digits.
>>>>
>>>> How can I modify the expression to handle that?
>>>>
>>>> Andrew Poulos
>>>
>>>   /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9]{0,3}/
>>>
>>> You can short it to:
>>>
>>>   /^[0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{0,3}/
>>
>> or to:
>>
>> /^[\d]{2}:[\d]{2}:[\d]{2},[\d]{0,3}/
>
> \d\d is shorter than \d{2}

Yes and it does the same.

> No reason for the '[]'s
> and
> '\d\d' is shorter than '\d{2}'
>
> /^\d\d:\d\d:\d\d,\d{0,3}/
>
> Meseems you want no trailing characters,
> so add a final '$':
>
> /^\d\d:\d\d:\d\d,\d{0,3}$/
>
> But probably you want to have no comma,
> when there are zero decimals:
>
> /^\d\d:\d\d:\d\d(,\d{1,3})?$/
>
> or if you want to make the comma optional,
> when no decimals:
>
> /^\d\d:\d\d:\d\d(,|,\d{1,3})?$/
>
> ==================
>
> testing:
>
> <script type='text/javascript'> 'use strict'
> 	function w(x,a) { document.write(x.test(a)+'<br>'); };
> 	w(/^\d\d:\d\d:\d\d(,\d{1,3})?$/, '01:01:01,12'); // true
> 	w(/^\d\d:\d\d:\d\d(,\d{1,3})?$/, '01:01:01,12 '); // false
> 	w(/^\d\d:\d\d:\d\d(,\d{1,3})?$/, '01:01:01'); // true
> 	w(/^\d\d:\d\d:\d\d(,\d{1,3})?$/, '01:01:01,'); // false
> 	w(/^\d\d:\d\d:\d\d(,|,\d{1,3})?$/, '01:01:01'); // true
> 	w(/^\d\d:\d\d:\d\d(,|,\d{1,3})?$/, '01:01:01,'); // true
> </script>

Nice.

Btw this is a very good case as a candidate to write first unit tests 
and then required function.

-- 
Cezary Tomczyk
http://www.ctomczyk.pl/
https://www.aslint.org/ - Accessibility linting tool

[toc] | [prev] | [next] | [standalone]


#32759

FromJulio Di Egidio <julio@diegidio.name>
Date2017-03-15 03:01 -0700
Message-ID<83fb508e-4b24-4e92-97ee-54913b51fe8c@googlegroups.com>
In reply to#32757
On Wednesday, March 15, 2017 at 9:30:03 AM UTC+1, Cezary Tomczyk wrote:

> Btw this is a very good case as a candidate to write first unit tests 
> and then required function.

It is also a very good candidate for having cappuccino, or not.

Julio

[toc] | [prev] | [next] | [standalone]


#32762

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2017-03-15 05:39 -0700
Message-ID<eadb0f42-f2d9-480b-a2d1-71f7f2410ee5@googlegroups.com>
In reply to#32757
Cezary Tomczyk wrote:
Evertjan. wrote:
> > Cezary Tomczyk wrote
> >
> >> JJ wrote:
> >>>  Andrew Poulos wrote:
> >>>> I have this string
> >>>>    dd:dd:dd,ddd
> >>>> where the d's are digits and I'm using this to match it
> >>>>    match(/^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9][0-9][0-9]/);
> >>>>
> >>>> Now I find that after the comma there may be from 0 to 3 digits.
> >>>>
> >>>> How can I modify the expression to handle that?
> >>>>
> >>>> Andrew Poulos
> >>>
> >>>   /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9]{0,3}/
> >>>
> >>> You can short it to:
> >>>
> >>>   /^[0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{0,3}/
> >>
> >> or to:
> >>
> >> /^[\d]{2}:[\d]{2}:[\d]{2},[\d]{0,3}/
> >
> > \d\d is shorter than \d{2}
> 
> Yes and it does the same.
> 
> > No reason for the '[]'s
> > and
> > '\d\d' is shorter than '\d{2}'
> >
> > /^\d\d:\d\d:\d\d,\d{0,3}/
> >
> > Meseems you want no trailing characters,
> > so add a final '$':
> >
> > /^\d\d:\d\d:\d\d,\d{0,3}$/
> >
> > But probably you want to have no comma,
> > when there are zero decimals:
> >
> > /^\d\d:\d\d:\d\d(,\d{1,3})?$/
> >
> > or if you want to make the comma optional,
> > when no decimals:
> >
> > /^\d\d:\d\d:\d\d(,|,\d{1,3})?$/
> >
> > ==================
> >
> > testing:
> >
> > <script type='text/javascript'> 'use strict'
> > 	function w(x,a) { document.write(x.test(a)+'<br>'); };
> > 	w(/^\d\d:\d\d:\d\d(,\d{1,3})?$/, '01:01:01,12'); // true
> > 	w(/^\d\d:\d\d:\d\d(,\d{1,3})?$/, '01:01:01,12 '); // false
> > 	w(/^\d\d:\d\d:\d\d(,\d{1,3})?$/, '01:01:01'); // true
> > 	w(/^\d\d:\d\d:\d\d(,\d{1,3})?$/, '01:01:01,'); // false
> > 	w(/^\d\d:\d\d:\d\d(,|,\d{1,3})?$/, '01:01:01'); // true
> > 	w(/^\d\d:\d\d:\d\d(,|,\d{1,3})?$/, '01:01:01,'); // true
> > </script>
> 
> Nice.
> 
> Btw this is a very good case as a candidate to write first unit tests 
> and then required function.

Unit tests are existence proofs for failure. These also can have bugs and oversights. For example, in the above the 3 digit tail was overlooked as well as a 4 digit one to show failure:

01:01:01,123
01:01:01,1234

We've also not qualified if 0-digit tail can follow a comma or not:

01:01:01,

[toc] | [prev] | [next] | [standalone]


#32761

FromJulio Di Egidio <julio@diegidio.name>
Date2017-03-15 05:20 -0700
Message-ID<088ea623-b60c-4115-a558-f21251598f78@googlegroups.com>
In reply to#32755
On Wednesday, March 15, 2017 at 9:19:48 AM UTC+1, Evertjan. wrote:

> /^\d\d:\d\d:\d\d,\d{0,3}/

FWIW, in a code review I'd object to that (a little bit, not much): the
following I find (most) readable and expressive (plus I have introduced
a little "fix", assuming that was the intended use):

  /^\d{2}:\d{2}:\d{2},\d{0,3}$/

Anyway, the code must be readable, not "writable".  As a rule of thumb,
every keystroke saved now costs 1 more day every day in terms of
technical dept... roughly, but precisely.

Julio

[toc] | [prev] | [next] | [standalone]


#32763

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2017-03-15 05:43 -0700
Message-ID<7a8905e7-6fa0-41ac-8e90-0becb06e879c@googlegroups.com>
In reply to#32761
 Julio Di Egidio wrote:
> Evertjan. wrote:
> 
> > /^\d\d:\d\d:\d\d,\d{0,3}/
> 
> FWIW, in a code review I'd object to that (a little bit, not much): the
> following I find (most) readable and expressive (plus I have introduced
> a little "fix", assuming that was the intended use):
> 
>   /^\d{2}:\d{2}:\d{2},\d{0,3}$/
> 
> Anyway, the code must be readable, not "writable".  As a rule of thumb,
> every keystroke saved now costs 1 more day every day in terms of
> technical dept... roughly, but precisely.

Let's not conflate succinctness with code-golf though.

[toc] | [prev] | [next] | [standalone]


#32765

FromJulio Di Egidio <julio@diegidio.name>
Date2017-03-15 05:48 -0700
Message-ID<00bec821-02d1-4199-be22-a6090c4ae553@googlegroups.com>
In reply to#32763
On Wednesday, March 15, 2017 at 1:43:54 PM UTC+1, Michael Haufe (TNO) wrote:
> Julio Di Egidio wrote:
> > Evertjan. wrote:
> > 
> > > /^\d\d:\d\d:\d\d,\d{0,3}/
> > 
> > FWIW, in a code review I'd object to that (a little bit, not much): the
> > following I find (most) readable and expressive (plus I have introduced
> > a little "fix", assuming that was the intended use):
> > 
> >   /^\d{2}:\d{2}:\d{2},\d{0,3}$/
> > 
> > Anyway, the code must be readable, not "writable".  As a rule of thumb,
> > every keystroke saved now costs 1 more day every day in terms of
> > technical dept... roughly, but precisely.
> 
> Let's not conflate succinctness with code-golf though.

Let's cut the bullshit.

Sorry for the typo.

Julio

[toc] | [prev] | [next] | [standalone]


#32767

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2017-03-15 06:28 -0700
Message-ID<b5145155-c503-4e89-bb51-3949b9f5a71f@googlegroups.com>
In reply to#32765
Julio Di Egidio wrote:
> Michael Haufe (TNO) wrote:
> > Julio Di Egidio wrote:
> > > Evertjan. wrote:
> > > 
> > > > /^\d\d:\d\d:\d\d,\d{0,3}/
> > > 
> > > FWIW, in a code review I'd object to that (a little bit, not much): the
> > > following I find (most) readable and expressive (plus I have introduced
> > > a little "fix", assuming that was the intended use):
> > > 
> > >   /^\d{2}:\d{2}:\d{2},\d{0,3}$/
> > > 
> > > Anyway, the code must be readable, not "writable".  As a rule of thumb,
> > > every keystroke saved now costs 1 more day every day in terms of
> > > technical dept... roughly, but precisely.
> > 
> > Let's not conflate succinctness with code-golf though.
> 
> Let's cut the bullshit.
> 
> Sorry for the typo.

Agreed: rules of thumb, keystrokes = days, scare-quote writability...

Too much vagueness for my tastes.

[toc] | [prev] | [next] | [standalone]


#32768

FromJulio Di Egidio <julio@diegidio.name>
Date2017-03-15 06:43 -0700
Message-ID<24cc05c4-9dbe-4f59-b479-a8aec9599090@googlegroups.com>
In reply to#32767
On Wednesday, March 15, 2017 at 2:28:33 PM UTC+1, Michael Haufe (TNO) wrote:
> Julio Di Egidio wrote:
> > Michael Haufe (TNO) wrote:
> > > Julio Di Egidio wrote:
> > > > Evertjan. wrote:
> > > > 
> > > > > /^\d\d:\d\d:\d\d,\d{0,3}/
> > > > 
> > > > FWIW, in a code review I'd object to that (a little bit, not much): the
> > > > following I find (most) readable and expressive (plus I have introduced
> > > > a little "fix", assuming that was the intended use):
> > > > 
> > > >   /^\d{2}:\d{2}:\d{2},\d{0,3}$/
> > > > 
> > > > Anyway, the code must be readable, not "writable".  As a rule of thumb,
> > > > every keystroke saved now costs 1 more day every day in terms of
> > > > technical dept... roughly, but precisely.
> > > 
> > > Let's not conflate succinctness with code-golf though.
> > 
> > Let's cut the bullshit.
> > 
> > Sorry for the typo.
> 
> Agreed: rules of thumb, keystrokes = days, scare-quote writability...
> 
> Too much vagueness for my tastes.

OK, I'll say it once more and more explicitly: it is NOT vague at all, not
per chance I said "precisely", it's fucking proper software engineering as
you would hardly find anywhere nowadays.  Of course, it might not interest
you, or even many.  Not a problem if you don't make it a problem.

Julio

[toc] | [prev] | [next] | [standalone]


#32769

FromJon Ribbens <jon+usenet@unequivocal.eu>
Date2017-03-15 14:06 +0000
Message-ID<slrnociinl.664.jon+usenet@sable.unequivocal.eu>
In reply to#32768
On 2017-03-15, Julio Di Egidio <julio@diegidio.name> wrote:
> OK, I'll say it once more and more explicitly: it is NOT vague at all, not
> per chance I said "precisely", it's fucking proper software engineering as
> you would hardly find anywhere nowadays.  Of course, it might not interest
> you, or even many.  Not a problem if you don't make it a problem.

Without wishing to prolong this ridiculous conversation, I must admit
that I am curious as to what you understand the words "roughly" and
"precisely" to mean, if you think that something can be both at once.

[toc] | [prev] | [next] | [standalone]


#32771

FromJulio Di Egidio <julio@diegidio.name>
Date2017-03-15 07:56 -0700
Message-ID<f92f184b-003d-4709-bcc1-6bc9f4ed0598@googlegroups.com>
In reply to#32769
On Wednesday, March 15, 2017 at 3:09:05 PM UTC+1, Jon Ribbens wrote:
> On 2017-03-15, Julio Di Egidio <julio@diegidio.name> wrote:
> > OK, I'll say it once more and more explicitly: it is NOT vague at all, not
> > per chance I said "precisely", it's fucking proper software engineering as
> > you would hardly find anywhere nowadays.  Of course, it might not interest
> > you, or even many.  Not a problem if you don't make it a problem.
> 
> Without wishing to prolong this ridiculous conversation, I must admit
> that I am curious as to what you understand the words "roughly" and
> "precisely" to mean, if you think that something can be both at once.

The ensuing conversation is indeed ridiculous.

Fucking hell, guys, read some James Joyce once in your life, meanwhile
ponder what it means to build a bridge that SHALL NOT collapse.

*Plonk*

Julio

[toc] | [prev] | [next] | [standalone]


#32773

FromJon Ribbens <jon+usenet@unequivocal.eu>
Date2017-03-15 16:05 +0000
Message-ID<slrnocipof.664.jon+usenet@sable.unequivocal.eu>
In reply to#32771
On 2017-03-15, Julio Di Egidio <julio@diegidio.name> wrote:
> On Wednesday, March 15, 2017 at 3:09:05 PM UTC+1, Jon Ribbens wrote:
>> On 2017-03-15, Julio Di Egidio <julio@diegidio.name> wrote:
>> > OK, I'll say it once more and more explicitly: it is NOT vague at all, not
>> > per chance I said "precisely", it's fucking proper software engineering as
>> > you would hardly find anywhere nowadays.  Of course, it might not interest
>> > you, or even many.  Not a problem if you don't make it a problem.
>> 
>> Without wishing to prolong this ridiculous conversation, I must admit
>> that I am curious as to what you understand the words "roughly" and
>> "precisely" to mean, if you think that something can be both at once.
>
> The ensuing conversation is indeed ridiculous.
>
> Fucking hell, guys, read some James Joyce once in your life, meanwhile
> ponder what it means to build a bridge that SHALL NOT collapse.
>
> *Plonk*

Gosh. That truly was a masterclass in proper weapons-grade gibberish.

[toc] | [prev] | [next] | [standalone]


#32778

FromJulio Di Egidio <julio@diegidio.name>
Date2017-03-15 21:12 -0700
Message-ID<931dff72-9f4d-40c8-be9a-207df7da1249@googlegroups.com>
In reply to#32773
On Wednesday, March 15, 2017 at 5:08:52 PM UTC+1, Jon Ribbens wrote:
> On 2017-03-15, Julio Di Egidio <julio@diegidio.name> wrote:
<snip>
> > The ensuing conversation is indeed ridiculous.
> >
> > Fucking hell, guys, read some James Joyce once in your life, meanwhile
> > ponder what it means to build a bridge that SHALL NOT collapse.
> >
> > *Plonk*
> 
> Gosh. That truly was a masterclass in proper weapons-grade gibberish.

I wrote a little piece of software engineering and you and co. are taking my
final little joke and making a fuss out of that and insisting: which means
that you are either just a bunch of fucking idiots and/or are actually part
of the mega scum that has been bashing proper engineering for some 20 years
now.  But I don't give a shit which is which, stupid or dishonest or both,
be reassured that not only I'll keep posting that kind of stuff whenever I see fit and in whichever style I find effective to communicate, I will also
debunk you jerks and incompetent enemies of rationality whenever I feel like
and see fit.  For now just go fuck yourself.

Julio

[toc] | [prev] | [next] | [standalone]


#32782

FromJon Ribbens <jon+usenet@unequivocal.eu>
Date2017-03-16 11:04 +0000
Message-ID<slrnocksfh.664.jon+usenet@sable.unequivocal.eu>
In reply to#32778
On 2017-03-16, Julio Di Egidio <julio@diegidio.name> wrote:
> On Wednesday, March 15, 2017 at 5:08:52 PM UTC+1, Jon Ribbens wrote:
>> On 2017-03-15, Julio Di Egidio <julio@diegidio.name> wrote:
><snip>
>> > The ensuing conversation is indeed ridiculous.
>> >
>> > Fucking hell, guys, read some James Joyce once in your life, meanwhile
>> > ponder what it means to build a bridge that SHALL NOT collapse.
>> >
>> > *Plonk*
>> 
>> Gosh. That truly was a masterclass in proper weapons-grade gibberish.
>
> I wrote a little piece of software engineering and you and co. are taking my
> final little joke and making a fuss out of that and insisting: which means
> that you are either just a bunch of fucking idiots and/or are actually part
> of the mega scum that has been bashing proper engineering for some 20 years
> now.  But I don't give a shit which is which, stupid or dishonest or both,
> be reassured that not only I'll keep posting that kind of stuff
> whenever I see fit and in whichever style I find effective to
> communicate, I will also
> debunk you jerks and incompetent enemies of rationality whenever I feel like
> and see fit.  For now just go fuck yourself.

You seem to have me confused with someone else. However I am now
additionally curious as to what you think the word "plonk" means.

[toc] | [prev] | [next] | [standalone]


#32772

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2017-03-15 08:12 -0700
Message-ID<9ca378b8-7115-47f5-af98-3b86da1a5d9f@googlegroups.com>
In reply to#32768
Julio Di Egidio wrote:

> OK, I'll say it once more and more explicitly: it is NOT vague at all, not
> per chance I said "precisely", it's fucking proper software engineering as
> you would hardly find anywhere nowadays.  Of course, it might not interest
> you, or even many.  Not a problem if you don't make it a problem.

Triggered much? 

If you want to be precise, define and expand on what you mean otherwise you shouldn't be surprised when others misunderstand you or disagree and press you on it.

To enumerate your statements:

#1 "the code must be readable, not 'writable'"
#2 "every keystroke saved now costs 1 more day every day in terms of technical dept."

While I might agree with you on #1 in most cases. I disagree in principle on #2 and I think you need to expand on that.

For example:

function fib(n) {
  if(n < 2)
    return n;
  
  var f0 = 0, f1 = 1, f;
  
  for(var i = 1; i < n; i++) {
    f = f0 + f1;
    f0 = f1;
    f1 = f
  }
  return f;
}

/* vs */

var fib = (n) => {
  var f = (n0, n1, step) => step == n ? n1 : f(n1, n0 + n1, step + 1);
  return f(0,1,1)
}

How would that fall into your categorization?

[toc] | [prev] | [next] | [standalone]


#32764

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2017-03-15 05:45 -0700
Message-ID<0a45c28b-4bab-48dc-8e38-a2bf21d7adee@googlegroups.com>
In reply to#32752
On Tuesday, March 14, 2017 at 10:39:34 PM UTC-5, Andrew Poulos wrote:
> I have this string
>    dd:dd:dd,ddd
> where the d's are digits and I'm using this to match it
>    match(/^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9][0-9][0-9]/);
> 
> Now I find that after the comma there may be from 0 to 3 digits.
> 
> How can I modify the expression to handle that?

If there are 0 digits at the end, is it ok to have a comma? I'm guessing not:

var re = /^(?:\d{2}:){2}\d{2}(?:,\d{1,3})?$/

[toc] | [prev] | [next] | [standalone]


#32776

FromDr J R Stockton <J.R.Stockton@physics.org>
Date2017-03-15 11:54 -0700
Message-ID<26369440-804b-490e-b458-1c50b35c043f@googlegroups.com>
In reply to#32752
On Wednesday, March 15, 2017 at 3:39:34 AM UTC, Andrew Poulos wrote:
> I have this string
>    dd:dd:dd,ddd
> where the d's are digits and I'm using this to match it
>    match(/^[0-9][0-9]:[0-9][0-9]:[0-9][0-9],[0-9][0-9][0-9]/);
> 
> Now I find that after the comma there may be from 0 to 3 digits.
> 
> How can I modify the expression to handle that?

This will tell you whether the string is right (tested)

     Ans = /^\d\d:\d\d:\d\d,\d?\d?\d?$/.test(Str)

and you can use the RegExp with Str.match(Reg).

If that sort of string interests you, it might be well for you to
read my JavaScript pages, especially the Date ones, via
<http://web.archive.org/web/20150514050046/http://
www.merlyn.demon.co.uk/contents.htm>.

ANNOUNCE : it looks as if my favoured E-mail software can no longer
connect to the Internet (because of the Other End), so I may be
reduced to using Google, as here. :-{{


-- 
  (c) John Stockton, near London, UK.  Using Google, no spell-check. |
 Mail: J.R.""""""""@physics.org                                      |

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.javascript


csiph-web