Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Re: Re: (Golf) Nearest Neighbors

by thospel (Hermit)
on Oct 27, 2003 at 19:34 UTC ( #302487=note: print w/replies, xml ) Need Help??

in reply to Re: Re: (Golf) Nearest Neighbors
in thread (Golf) Nearest Neighbors

Ah, I should think a bit more before submitting. Here is a 44 (and I should also mention it only works for smallish natural numbers, all different and at least 2 arguments):

sub nn{$a|=2x$_.3for@_;$b.=2until$a=~/3$b(3)/;@a=@-}

The need for the assign is a perlbug, otherwise it would be 41

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://302487]
[Corion]: Oh yay. The (external, not guided by me) programmers have chosen Moose+DBIx::Class for some implementation, and now seem to do 1+n SELECT statements for each row, as is usual when using ORMs.
[Corion]: So maybe I should investigate how to plug in a cache in front of DBIx::Class so I can do a ->selectall_hashre f and then satisfy the "sub"-selects from that cached single SELECT statement ...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2017-09-25 10:59 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (279 votes). Check out past polls.