It took me about 21 minutes of coding and the CPU time was negligible, roughly 0.01 seconds. Of course, most of the coding time was spent assembling the data and wandering up a blind alley but that's all "billable hours".
On 4/9/07, ramacd <[EMAIL PROTECTED]> wrote:
Hi Devon; Yes, the CPU time metric is still aggravatingly present. IME, APL have had nothing to be ashamed about since 1990, J essentially for its entire existence. I also reject the "written once, executed many times" rationale. Software that is worth writing gets improved in minutes, with perhaps a few dozen executions before it gets those improvements. BTW, I roughly recall 5" for coding, and 0.9" for execution, but that's just me. >: ... ------------------------------------------------------------------------ |\/| Randy A MacDonald | APL: If you can say it, it's done.. (ram) |/\| [EMAIL PROTECTED] | |\ | | The only real problem with APL is that BSc(Math) UNBF'83 | it is "still ahead of its time." Sapere Aude | - Morten Kromberg Natural Born APL'er | Demo website: http://156.34.64.78/ -----------------------------------------------------(INTP)----{ gnat }- ----- Original Message ----- From: "Devon McCormick" <[EMAIL PROTECTED]> To: "Programming forum" <[email protected]> Sent: Monday, April 09, 2007 6:28 PM Subject: Re: [Jprogramming] index error on load (but works in console) > I just solved this and posted a come-on for my usual rant about these > sort of problems: what was the total time to reach a solution, coding plus > execution time? > > As is common in these sort of articles, there are multiple iterations to > solving > the problem but the main concern at each iteration is CPU time. This > emphasis > frequently puts J at an apparent disadvantage. We should not let the > dialogue > continue to be framed in terms of CPU time to the neglect of total time to > solution. > > On 4/8/07, Tracy Harms <[EMAIL PROTECTED]> wrote: > > > > I've been working on the puzzle from Dr. Dobbs that > > Randy MacDonald announced here: > > http://www.jsoftware.com/pipermail/chat/2007-April/000467.html > > > > I'm still not ready for full-fledged spoilers, but I > > am asking for help getting past one particular error > > condition. The problem is that an index error is > > reported when I try to load the script, but it seems > > fine when I run it in the J console. > > > > My approach to solving the puzzle is: > > > > reportstates same_chars same_tallies 4 comb 50 > > > > I've only developed this as deep as verb same_tallies, > > which is: > > > > same_tallies =: ((tally_leftpairs = tally_rightpairs) > > y.) # y. > > > > Here are the component verbs: > > > > tally_leftpairs =: 3 : '+/"1 (0 1 {"1 ((i.#y.) { y.)) > > { tallies' > > tally_rightpairs =: 3 : '+/"1 (2 3 {"1 ((i.#y.) { y.)) > > { tallies' > > > > Now I'll show testing from a J session, ending with an > > error on attempt to load the same verb that functioned > > perfectly when entered in the console: > > > > twocomb =: 0 1 11 14 ,: 4 5 6 20 > > twocomb > > 0 1 11 14 > > 4 5 6 20 > > twocomb { states > > +----------+--------+-----------+-------------+ > > |Alabama |Alaska |Idaho |Iowa | > > +----------+--------+-----------+-------------+ > > |California|Colorado|Connecticut|Massachusetts| > > +----------+--------+-----------+-------------+ > > twocomb { tallies > > 7 6 5 4 > > 10 8 11 13 > > (0 1 {"1 ((i.#twocomb) { twocomb)) { tallies > > 7 6 > > 10 8 > > (2 3 {"1 ((i.#twocomb) { twocomb)) { tallies > > 5 4 > > 11 13 > > +/"1 (0 1 {"1 ((i.#twocomb) { twocomb)) { tallies > > 13 18 > > +/"1 (2 3 {"1 ((i.#twocomb) { twocomb)) { tallies > > 9 24 > > load 'c:\j504\user\miscellany\statespzl2.ijs' > > |index error: tally_rightpairs > > | +/"1(2 3 {"1((i.#y.){y.)){tallies > > > > No error was signaled for the line before it, which > > differed only in the values of the pairing noun: > > > > tally_leftpairs =: 3 : '+/"1 (0 1 {"1 ((i.#y.) { y.)) > > { tallies' > > tally_rightpairs =: 3 : '+/"1 (2 3 {"1 ((i.#y.) { y.)) > > { tallies' > > > > I'm at a loss as to what needs to be fixed, here. > > > > -- > > Tracy B. Harms > > > > It is the central thesis of this book that the descriptive > > and analytic power of an adequate programming language amply > > repays the considerable effort required for its mastery. > > Kenneth E. Iverson > > A Programming Language, 1962 > > > > > > > > > > ____________________________________________________________________________ ________ > > It's here! Your new message! > > Get new email alerts with the free Yahoo! Toolbar. > > http://tools.search.yahoo.com/toolbar/features/mail/ > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > > -- > Devon McCormick, CFA > ^me^ at acm. > org is my > preferred e-mail > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
-- Devon McCormick, CFA ^me^ at acm. org is my preferred e-mail ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
