I was not thinking about sorted or not sorted some months ago when I did
this.
As it happens the data has always been sorted until now so it did not
matter.
I was puzzled what was happening that the end result of many stages seemed
to be out of sync.
It took me a while to realize what mistake I had made.

That is why it mattered that one operation out of many combining data from
various sources was sorted and the others was not.

I should have realized earlier what I was doing wrong but it took me a few
hours to discover what I was doing wrong. I did not even suspect that this
was what caused the failure.

The routines close to this had not given me any problems for months now.
I was not really looking into the script where this was.

The blunder was all mine.

I just found this a bit funny to make such a silly mistake and not discover
it straight away.



2007/4/11, Roger Hui <[EMAIL PROTECTED]>:

I am puzzled:

   nn=: /:~ ~. ACNR

is supposed to be sorted.  The monad /:~ sorts
and the monad ~. finds the nub.  Why were you
surprised?  The line

   UNIACNR=: (~:ACNR )#ACNR

can be written more concisely as:

   UNIACNR=: ~.ACNR



----- Original Message -----
From: Björn Helgason <[EMAIL PROTECTED]>
Date: Wednesday, April 11, 2007 10:20 am
Subject: [Jprogramming] programming blunder

> NB. I spent most of the day chasing a phantom and I had no idea
> what was
> going on
>
> NB. I had a set of numbers I needed to block together, count and
> use to get
> at other info to calculate together
>
> ACNR=:,".>l# "1 GOGNDCM
>
> NB. used it to decrease the database as well
>
> MINNIGOGN=: (~:ACNR )# MINNIGOGN
>
> NB. way down in the script
> .....
>
> NB. I needed to get the unique numbers to work with
>
> nn=:/:~~.ACNR
>
> NB. this worked fine for a while until yesterday the results
> looked a bit
> strange
> NB. took me awhile to discover that the data I was now working on -
> from
> 1448 files and several hours of processing - that
> NB. this nn was SORTED!  - the rest of the data was not
> NB. innocent little line I was not even looking at while tracing the
> application
> NB. the name not very telling either but as it had worked from the
> time I
> was testing it a while back I was not even thinking about it
>
> NB. the solution is pretty obvious once I realized what I had done
> UNIACNR=: (~:ACNR )#ACNR
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm




--
Björn Helgason, Verkfræðingur
Fugl&Fiskur ehf, Þerneyjarsund 23, Box 127
801 Grímsnes ,t-póst: [EMAIL PROTECTED]
Skype: gosiminn, gsm: +3546985532
Landslags og skrúðgarðagerð, gröfuþjónusta
http://groups.google.com/group/J-Programming


Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans

góður kennari getur stigið á tær án þess að glansinn fari af skónum
         /|_      .-----------------------------------.
        ,'  .\  /  | Með léttri lund verður        |
    ,--'    _,'   | Dagurinn í dag                     |
   /       /       | Enn betri en gærdagurinn  |
  (   -.  |        `-----------------------------------'
  |     ) |        (\_ _/)
 (`-.  '--.)       (='.'=)
  `. )----'        (")_(")
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to