unicode question

Bengt Richter bokr at oz.net
Mon Nov 29 17:14:42 EST 2004


On Tue, 23 Nov 2004 20:37:04 +0100, =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= <martin at v.loewis.de> wrote:

>Steve Holden wrote:
>> Am I the only person who found it scary that Bengt could apparently 
>> casually drop on a polynomial the would decode to " Löwis"?
Well, don't give me too much credit, though I admit enjoying a little unearned
flattered-ego buzz ;-) But it's not a big deal if you had recently implemented
an automatic lambda-printer-outer to solve for a polynomial function f such that
f(0)==k0, f(1)==k1, .. f(n)==kn. For a single number k0 that will be lambda x: k0
and for two numbers k0, k1 will be lambda x: k0 + x*(k1-k0) etc. It's a matter of
solving some simultaneous equations for the coefficient values, which I had done
in response to a previous thread. For that, I happened to have had some experience
from the '60s writing variations on an equation solver (back when we congratulated
ourselves on getting all (software-implemented) floating point ops other than divide
to execute in under a millisecond ;-) Here I was using an exact decimal module I happened
to have (also built in response to previous thread discussion ;-), so I didn't even have
to look for maximum abs pivot elements in the matrix for this one. And it didn't have to be fast.
So it was kind of a fun exercise. But anyway, it was all ready to go at this point, so
all I had to was do was run coeffsx.py with the character ord values as args on the command line.
The opportunity to use it in a fun way to fake casual wizardry was just dumb luck ;-)

>
>I'm not scared, but honored, of course.
>
A bit late responding, but I couldn't think of a clever followup to that ;-)
But Just to play fair,

print ''.join([chr((lambda x: (
    -6244372133*x**31 +3013910052086*x**30 -695396351572920*x**29
    +102105752307741620*x**28 -10715303804974659632*x**27 +855734314951919397204*x**26
    -54067713339116101354860*x**25 +2774121296568607137441900*x**24
    -117725625258165396333623970*x**23 +4187405270602160539007125440*x**22
    -126060225187601954901807327900*x**21 +3234908736910295469078183101700*x**20
    -71121878980966418114205095297640*x**19 +1344268902923717571167117226451980*x**18
    -21886601404074660751245403749948900*x**17 +307180698948793841846368910776059300*x**16
    -3714719218772170154406066269371644945*x**15 +38641327091060849304069885597725238090*x**14
    -344757809926306996671359721670334393500*x**13 +2627069115710241704477921121071756668600*x**12
    -16998869426095431823754237370045113150352*x**11 +92697362475995606001274610327169882407584*x**10
    -421837211162827653880286870838716820642880*x**9 +1581695033356657201434736494281105646218880*x**8
    -4805817748883837636614530805204695373091328*x**7 +11572394080794032785251889126742747327087616*x**6
    -21417820944419013080374525134500006003159040*x**5 +29141767437911436346798089144038222112768000*x**4
    -27186086428826094346108431447644781404160000*x**3 +15339943556592952236643053124047771402240000*x**2
    -3882253738078295379102517100266822041600000*x +230239482316981838896315760640000000)
    /2740946218059307605908520960000000
    )(x)) for x in xrange(32)])

Not-ready-to-be-mythologized-though-plenty-flatterable-ly y'rs

Regards,
Bengt Richter



More information about the Python-list mailing list