Question about `list.insert`

Chris Angelico rosuav at gmail.com
Thu Feb 6 22:45:58 EST 2014


On Fri, Feb 7, 2014 at 2:29 PM, Rustom Mody <rustompmody at gmail.com> wrote:
> On Friday, February 7, 2014 8:44:43 AM UTC+5:30, Chris Angelico wrote:
>> On Fri, Feb 7, 2014 at 2:00 PM, Roy Smith  wrote:
>> >  Dave Angel wrote:
>> >> list does not promise better than O(1) behavior
>> > I'm not aware of any list implementations, in any language, that
>> > promises better than O(1) behavior for any operations.  Perhaps there is
>> > O(j), where you just imagine the operation was performed?
>
>> I have a printer that executes in O(1/N) time, where N is the number
>> of marbles the sysadmin (me!) has lost. The less sanity I have, the
>> more printouts it produces. And the less printouts it produces, the
>> more marbles I lose trying to figure out WHY? WHY? WHY?!?
>
> Heh! Nice to know I have company!
>
> Thought I was the only one who lost hair at the printer's
> free-paper-munificience

See, here's the deal. I have a nice, modern, CUPS-based printer. It
supports all the modern protocols (IPP, JetDirect, whatever), and when
I point one of my Linux boxes in its direction and say "Print", a
sheet of paper comes out in fairly short order. Nice, right? Okay, now
let's mix in the problem ingredients.

We have an ancient accounting package, supporting a rather old and
winding-down business. It's not worth upgrading to a newer version of
the program (that costs money), and certainly not worth migrating to a
completely different program (that takes time), because the business
just isn't operating at that level any more. It's a Windows 16-bit
application.

The physical hardware is decently modern, and is running Debian Jessie
(the latest, not even stable yet, because I wanted something else
relating to scanning - that's a separate point). Debian is running
VirtualBox, and inside the VM is running OS/2 (eComStation). OS/2 will
run the old accounting package in a Win-OS/2 session.

Now, OS/2 will talk to the printer. I can fire up DeScribe Word
Processor, type in some text, hit Print, and a sheet of paper comes
out with a representation of that text. The recent versions of OS/2
are quite good at that. But Windows? Windows? Oh no. It won't be that
courteous. No, it claims to have printed the document, and everything
I can see suggests that the data has passed through on its way to the
printer, but no paper comes out. My best guess is that there's some
flaw in the PostScript engine in Windows, because I can generate
output successfully by a complex dance involving freezing the
printer's output, printing from Windows, printing an unrelated
document (anything at all) from OS/2, and then releasing all the
printed data at once.

Current suggestions awaiting experimentation including slaughtering a
black goat at midnight, waving a rubber chicken, and throwing salt
over my shoulder in the direction of the full moon.

ChrisA



More information about the Python-list mailing list