Slices and dices

31.08.2010 19:33

Somehow this little corner of Python successfully evaded my discovery until now. Did you know there's a slice object that describes how an array is sliced? It can be passed in most places where a start:stop construct would go.

For instance:

>>> b = range(10)
>>> b[2:4]
[2, 3]
>>> a = slice(2,4)
>>> b[a]
[2, 3]

But more importantly, also:

>>> from operator import itemgetter
>>> f = itemgetter(slice(2,4))
>>> f(range(10))
[2, 3]

Which somewhat expands the usefulness of itemgetter in combination with itertools functions for efficient inner loops.

Interestingly, start:stop doesn't actually construct a slice object, so this:

>>> a = 2:4

is a syntax error. Funny. As far as I know this is the only place where Python's everything-is-an-object philosophy breaks. I would expect this to create an object just like a comma transparently generates a tuple.

Posted by Tomaž | Categories: Code | Comments »

Lucid Lynx automatic updates

29.08.2010 11:22

In case anyone else will find this helpful: my mum's laptop stopped receiving automatic update notifications after upgrade to Ubuntu 10.4. After digging through the lengthy pipeline that sits between an updated package available on an Ubuntu mirror and a window popping up on the screen the fix was trivial: somewhere during the upgrade process the /etc/cron.daily/apt script lost its execute permission bit. So to fix only run:

$ sudo chmod 755 /etc/cron.daily/apt

Oh, and there's a bug open on Launchpad, of course: #390319. However it's quite impossible to find it unless you know exactly what you are looking for. Search for "automatic updates not working" or something similar just gives you hundreds of forum threads full of clueless people blindly guessing at solutions to this and similar problems.

Posted by Tomaž | Categories: Code | Comments »

Unexpected failure mode

23.08.2010 20:55

Remember the explosive disassembly of a halogen light on my table? The light bulb I replaced the exploded one with also failed in an interesting, unexpected, although silent way.

Interesting failure mode of a halogen light bulb

It appears that the entire, intact filament got detached from the base. Not something you usually see in a burned-out bulb. It's the filament itself that breaks first in most cases.

Any engineers from Philips here? Consider this a bug report.

Posted by Tomaž | Categories: Life | Comments »

HP NMOS-III

13.08.2010 18:43

Last week when I wrote about the Hewlett Packard 9000 I stumbled upon the High-Density Interconnect handbook. I got intrigued by a caption mentioning "stacked transistors" in relation to the HP FOCUS microprocessor that the 9000 series used. I went and dug a little deeper to see if I could find out what was meant by that phrase.

At that time HP was using the NMOS-III fabrication process, which was the successor to the NMOS-II. This was a 1 μm, two-metal layer process designed specifically for their new 32-bit 500.000 transistor FOCUS microprocessor.

I found a pretty detailed description of the technology in the HP Journal. The August 1983 issue is dedicated to the VLSI process while September 1987 deals with higher-level microprocessor architecture. Both are an interesting read for anyone that is into vintage integrated circuit technology.

Illustration of the NMOS-III process (from HP Journal, August 1983)

For instance, unlike CMOS circuits of today NMOS digital circuits had relatively large output impedance and drew a large quiescent current. First property became apparent when chips where unable to drive long PCB traces. This was especially problematic for the system's 18 MHz clock which had to be distributed throughout the computer. So they made a dedicated clock generator chip with gigantic output transistors (55 mm gate width!) and mounted everything on finistrates - special printed circuit boards with wire bonded dies, very small vias and very high-quality Teflon dielectric - all to decrease trace inductance as much as possible. Finistrates also helped solve the heating problem by having a thick copper core which conducted heat away from the components.

Remember the "self healing" RAM they mention in that advert? That was achieved with special polysilicon fuses which allowed the RAM chip to isolate defective parts by melting a part of the interconnect. Oh, and RAM used a four-transistor dynamic cell, unlike one-transistor commonly used today.

Fascinating stuff. Especially considering this was all published in a journal and not kept as a closely kept company secret.

However I didn't find what I was looking for. There is no mention of transistor stacking. On thing is clear though: NMOS-III process certainly did not have any provisions for vertical stacking of transistors (which is rare even today). So that caption most probably referred to some kind of circuit topology.

Posted by Tomaž | Categories: Digital | Comments »

Lenticular stickers

09.08.2010 21:06

Some time ago the office laser printer ran out of juice. When the replacement toner arrived I found the packaging more interesting than the black powdery stuff inside. It appears some serious effort went into making sure these really are genuine cartridges.

What caught my eye were the really nice security holograms, or more correctly, lenticular prints. I just had to take a few home for further study.

Sticker with lenticular print on a piece of cardboard

First I wanted to try how hard it is to remove one of these from the cardboard box in one piece. Note how it has cuts in it to make that harder.

It turns out its really simple - just put it in a glass of water for a few minutes and it basically floats off.

Sticker with lenticular print from a HP toner cartridge

So while recycling stickers may be simple, replicating them is probably pretty hard. These things are wonderful examples of some pretty high-resolution printing.

First you have a microprint that rivals that of banknotes. And then there's the lenticular print which works in vertical as well as horizontal direction. The hemispherical lenses are so small that they are invisible to the naked eye and appear as a smooth matte surface. There's no visible pixelation or signs of image interlace. Compared to the usual examples of this technology, these stickers really stand out.

Here's a video demonstration of how good they look:

Makes me think that if you have the technology to counterfeit HP toner you can probably go straight to printing money and skip the middle-man.

Posted by Tomaž | Categories: Life | Comments »

One diode patent

05.08.2010 21:07

Everybody is talking about software patents and how big USA sue-me-sue-you companies are acquiring them in bulk for the most trivial methods and algorithms. Here's something that made me think that perhaps the "One click shopping" problem isn't limited to just the world of software.

Cut-out from Charging Specification for VL Series

This is a cut-out from Panasonic's Charging Specification for VL Series for their rechargeable Vanadium-Lithium batteries:

Notice the little notes below the schematics saying "Patent acquired"?

A couple of things don't make sense here. First, these circuits are so simple that most electronics engineers would probably came up with them given the specifications. There are a few circuits in that document that are actually more complicated than these and aren't marked as patented.

Secondly, why patent these in the first place? Isn't the goal of the manufacturer of batteries to sell as many as possible? Scaring potential costumers with potential for patent infringement in their products seems like bad practice. Is it just to prevent a rival from patenting it first?

Then again, after some searching on Google patent search I was unable to actually find the patent application for these.

Posted by Tomaž | Categories: Analog | Comments »

27 years later

02.08.2010 19:29

Recently I came across this vintage advertisement for a Hewlett Packard 9000 computer at the (virtual) HP Computer Museum:

Hewlett Packard 9000 advertisement

The ad is quite an interesting read. For instance it mentions that the computer's integrated circuits used NMOS technology, which provided for copious amounts of heat, which in turn required a special PCB.

It's also interesting to compare it with this modern advertisement that happens to be on my table at the moment:

Microway advertisement

I can't help but think that the HP advertisement tries to help you make an informed decision while the new ad blinds you with bulleted lists full of trademarked names and buzz words. HP says they use a memory controller that can correct 32 bad memory locations, not that they have a SuperSelfHealMemTech™. Also it seems like HP advertised these computers to people that will actually use them (note how they mention finite element analysis, systems of equations, etc.) not some IT management that is only looking for a good deal on gigabytes per monetary unit.

Oh and HP 9000 name was more recently recycled for a series of printers. How sad is that?

Update: Figure 1 in the HDI Handbook I linked above says "HP FOCUS chip ... NMOS III (stacked transistors). What is "stacked transistors" referring to here? I can find no mentions of HP NMOS III process using any kind of vertical transistor stacking like ST-CMOS.

Posted by Tomaž | Categories: Digital | Comments »