# Easy Iterations

“I want to put rice grains on each square of a chess board. But not doubling them every square as in the legend of Sissa, but rather just a random amount between 1 and 100 on each square. We will identify the square by an (r, c) index”

Well, that sounds easy, right?

```import random
from pprint import pprint

board = {}
for row in range(8):
for col in range(8):
board[(row, col)] = random.randint(1, 100)
pprint(board)
```

Aaaand we’re done for the night. Bye now!

Still here? Worried about the double-indent? Me too! Obviously it’s not a big deal in a case like this, but when you’re iterating over for levels and then you get two nested if-statements… too much!

First, let’s take a look at the home-brewn solution, which in many cases will be just fine, because it’s highly readable: rolling out your own iterator!

```import random
from pprint import pprint

def chess_board_squares():
for row in range(8):
for col in range(8):
yield row, col

board = {}
for row, col in chess_board_squares():
board[(row, col)] = random.randint(1, 100)
pprint(board)
```

And that’s how iterators work! Instead of a return statement, you use a yield statement instead which doesn’t exit the function, but rather temporarily “jumps out,” only to continue when the next “for” is called.

This solution “works” because we have created a custom iterator function that precisely describes what it’s doing: giving you all the chess board squares. It’s easy to go overboard and write a generic multi-iterator function, but that would be counterproductive. Because that’s why there’s an itertools library!

```import random
import itertools
from pprint import pprint

board = {}
for row, col in itertools.product(range(8), range(8)):
board[(row, col)] = random.randint(1, 100)

pprint(board)```

The product function returns a cartesian product between the listed iterators. If our chess board was ten rows deep and six columns wide, we’d call it like this:

`for row, col in itertools.product(range(10), range(6)):`

The “homegrown” solution is fine, because it’s slightly less cryptic than “product.” Just don’t build your own generic iterator for an arbitrary amount of iterable ranges; because someone already did that for you!

Advertisements

# Python 2 or Python 3?

It shouldn’t even be a question at this point! I’ve been using Python 3 for quite a while now, and I’m very happy with it. Personally, P3 deals with the little quirks like integer division, and exposing iterators instead of lists when dealing with dictionaries and the range function (without having to use “ugly” code).

Most of the Python 3-advertising talks at PyCon that is being held this weekend lauded the fact that performance-wise it is so much better. Raymond Hettinger even boasted in one of his talks that 3.6 is probably the first Python 3 release that is better than Python 2.7!

But what does that mean, better?

Nearly everyone will tell you how much less the memory footprint is, and how much better the performance is. And that’s great when you manage enterprise applications or webservices; I don’t. I just use Python to make my daily life easier.

I’ve tried switching to Python 3 a couple of times before “it stuck.” Every time I switched I felt that it was important to be prepared for the future, and not be left having to switch over with tons of code waiting to be upgraded.

The first time was around Python 3.1. Bad mistake! By the time Python 3.4 was out things were much better though, and I’m a happy Python 3 camper by now. But it wasn’t performance that convinced me; it was libraries.

Because that’s the one thing that most Python 3 evangelists are not telling you. Practically nothing worked the first time I tried. The standard library, of course. But external libraries were quite a different story. Reportlab? No go. WxPython? No go. And so on.

Today is quite different as practically everything seems to be working with Python 3. If it’s not made for Python 3, it’s at least compatible with it.

If you’re still on 2.7, this might be a good moment to consider switching!

# The Parker Vector

### Memory Review: the Parker Vector

I’m calling this a memory review since it is based on memory, not on actually holding the pen in my grubby paws. For a simple reason: I don’t have the pen anymore.

The Parker Vector. A cheap entry-level fountain pen.

The most obvious case: the Parker Vector. Grammar school started me off on fountain pens. Sadly I forgot what model or even brand they were. I suspect Bruynzeel but that’s just a hunch. Could as well be Lamy or Pelikan. The pens had a ridiculous long pointy cap, making them look a bit like a desk pen or a dip pen. Except that it was the cap looking like that, not the barrel.

As I had no problem chewing this plastic pen to pieces,  I remember that my next “fancy” pen was a full metal Parker ballpoint. Not the obiquitous Jotter, but the slightly more upscale “25.” I never cared too much about Parker ballpoints, especially not at a young age but boy did it get me off the pen-chewing habit.

Wanting to go back to fountain pens, as a schoolboy, I ended up getting a Vector. Back in the day for me Parker was synonymous with “Quality” and I did not doubt that this pen, probably costing me an amazing ƒ15 or something like that, would deliver the ultimate in writing perfection.

In its defense, I don’t think this pen ever let me down. Sure, it ran dry from time to time, but that had more to do with abuse (cleaning? what cleaning?) than anything else. I did learn to hate the Parker cartridges. Unlike international cartridges that fit two in a barrel, you’d have to do with a single cartridge. Which did have a “spare” section that could be activated by tapping it (in case you ran out of ink) but the shaky ride to school on the back of my bike would take care of that.

And well, are Parker cartridges expensive… The local office supply store sold noname-ink in little boxes of 25 or 50 cartridges for maybe ƒ5, and if memory serves me right you’d only get one box of five Parker cartridges for that. Maybe not, but that’s how it felt back in the day.

Anyway, after years of non-cleaning abuse I’m pretty sure the pen got permanently clogged and swapped out for more upscale pens. I don’t really have any good memories to this pen, but to be honest, for the money it was a pretty decent pen. If only it used standard international cartridges…

# Paper: the other factor when writing

An often overlooked element in writing: paper. Especially when you’re used to using ballpoints. Ballpoints seem the thrive on bad paper. The rougher the fibers, the better! Anyone who has ever tried their hands at a puzzle in the newspaper knows what I’m talking about. And if I do have to write on cheap fibrous paper, a ballpoint will be my first choice.

It’s different with a fountain pen. Yes, the fountain pen, smooth writer, is eager to deliver ink. Give it paper that soaks up the ink and things get ugly. Instead, you want smooth, coated paper. Not too smooth—try writing on the cover of a glossy magazine to find out what that means.

Don’t go blindly for expensive paper either though. Moleskine notebooks are trendy and freakishly expensive, but don’t get remarks too well on the FP Geeks website; the paper is too thin. At the other side of the spectrum, I got some \$5 notebooks at Staples that did very well.

You can’t go wrong with brands like Rhodia and Clairfontaine, and apparently Leuchtturm 1911 is also very good. Personally I have good experiences with “Markins by CR Gibson” notebooks, but far less with Eccolo. Experiment, don’t be afraid to get hurt, and try out a lot!

# Ink fill mechanisms

One of the fascinating things about a fountain pen is the way it is filled. The history of the fountain pen is mainly the history of the filling mechanism. If you’ve ever worked with ink or paint you can see why: failure of the pen, either when carrying, using, or filling, is a nasty business.
Even today there are a handful of different mechanisms on the market. Which, when you think about, tells you one thing: there’s no such thing as The Perfect Mechanism. Why is it so hard? Because some of the design criteria are at odds with each other:

• The mechanism should have a high ink capacity
• It should be reliable even after years of using it
• Refilling should not result in bringing your clothes to the drycleaner and scrubbing your hands like a surgeon

If it weren’t for the capacity, the solution would be simple: cartridges. But if you use a fountain pen, you generally use it and the pen running dry all the time becomes very, very annoying. Besides that, cartridges never offer the wide choice in ink as bottled ink does.

THe most common ways to fill a fountain pen

### Cartridges

If it weren’t for the very limited capacity, limited choice, and relatively high price, everyone would love cartridges, because they are perfect in any other way. Maintenance becomes a matter of dunking the section in a cup of water once in a while, and that’s it.

Converter mounted on a cartridge-pen

Of course, you can use a converter. And that is almost perfect. The converter mechanism is easy to clean, and if it ever started to leak, or became stuck, it can be replaced. But the less-than-1ml ink capacity is a huge, huge turnoff for fanatic users.

### Sac/Bladder

This is one of the oldest mechanism. The ink is stored in a rubber or silicone bladder. By squeezing the bladder the air is pushed out, and by releasing it, its volume returns to original size, creating underpressure that is used to suck in ink through the nib.

You will hardly ever encounter these pens under that name because a myriad of mechanism to do the squeezing without removing the barrel sprung up. One of the most popular was the lever filler, where a little lever on the side of the pen was pushed out (squeezing the bladder) and released to fill up the pen.

Limited capacity and a tendency of the bladder to dry out and crack over time makes these pens a relative rare sight these days.

### Piston

By far the most popular filling method of the more upscale pens is the piston filling mechanism. The reservoir is a straight tube with a piston in it. The piston is connected to a rod which in turn is connected to the knob at the end of the pen. The rod actually consists of two parts with threads; the outer part rotates with the knob, the inner part doesn’t and thus moves up and down the reservoir. From there it’s the same story: move the piston to the bottom to expell all the air, move it back up, and the resulting vacuum sucks in the ink.

The mechanism requires some maintenance (which is usually not easy to do for the owner): the piston seal requires lubrication once in a while, as does the piston mechanism. Aside from that, piston filling is nearly perfect: much larger ink capacity than cartridges, converters and sacs, and easy to fill the pen up (without having to take it apart).

The downsides: Due to the extension mechanism the piston can never travel further up the barrel than halfway.  Although the ink capacity of piston fillers is in many cases respectable, it is still limited unless the barrel has astronomical proportions.

### Vacuum

The vacuum filler has a reservoir that, like that of a piston filler, is straight, but it tapers out near the section. A thin rod connects the piston which in normal position is near the section. To fill the pen, the piston is pulled up all the way to the top of the barrel. A one-way valve releases the pressure that gets built up above the piston. Then, the piston is pushed down again, creating a vacuum behind the piston while pushing the air out of the pen in front of it. Once the piston reaches the bottom of the barrel and enters the tapered section, the vacuum is “released” and ink is sucked into the pen.

The mechanism is elegant, and unlike the piston filler, the barrel gets used almost all the way to store ink. The downside is that the main part of the reservoir has a smaller diameter (because it needs room to taper out near the section of the pen) and that the rod attached to the piston takes up (a very little) bit of space as well.

Add to it, that the mechanism is simpler to operate (no rotating parts) but requires two vacuum seals. One where the rod passes through, and the piston of course. On top of that, the piston seal needs to be constructed in such a way that it only seals off when pushed down, and not up. All that makes the vacuum filler a more expensive mechanism; its main benefit, larger capacity, can be simply offset on a piston filler by increasing the barrel size.

### Eye dropper

The oldest fill mechanism is seeing a bit of a revival: the eye-dropper. Simple screw off the barrel, and fill it with ink. The easiest way to do that without making a tremendous mess is with an eye dropper (hence the name), or a syringe.

Eye-droppers have huge capacities. But filling the pen is potentially messy, and the threads on the section need to be greased before screwing the barrel back on to prevent leaking. It’s not a miracle that other methods have sprung up over time!

Why the revival? Because a significant amount of modern fountain pen users are passionate fountain pen lovers who do not mind a little bit of inconvenience, and the eye dropper has an ink capacity that is simply unrivalled. Pens are usually not sold as eye-droppers but any cartridge-pen is a candidate.

Not every pen can be “converted” to an eye-dropper though. Ink is highly corrosive (which is why nibs are plated with corrosion resistant metals like gold or nickel) which means that metal barrels are out of the question. Also, some pens have the cap screwing on the section, not the barrel. From time to time, when you unscrew the cap, you end up unscrewing th barrel instead. Not a big deal with a cartridge pen. But with an eye-dropper…

So there you have it. Various filling mechanisms, and a reason for collectors to buy certain pens, because they want to have a pen that uses a special filling method. For daily use, piston fillers and converters are by far the most popular choice.

# My oldest fountain pen (that I own)

After finding my old fixpencil I discovered that I only had about 2.5cm (1 inch) of lead left. Searching for 2mm leads online (trust me you do not want to buy them at Staples, unless you really want to get rid of your money) lead me to fountain pens. At that point I thought “I should really start writing with a fountain pen again.” Some searching turned up an old pen. And ink. Victory! This was a freebie from the Postbank, in the USA better known as ING.

Open a savings account, get a cheap pen…

This pen has been reviewed by fountain pen reviewer/god Stephen Brown, who pretty much has the same opinion about the pen as I do: it looks great, and for a pen that was given away for free it’s fairly well made. Of course, it writes horribly, and one of my biggest beefs was the fact that you couldn’t push a spare cartridge in the barrel (which makes using a converter also impossible).

At one point I asked my mom to send me some cartridges (they are freakishly expensive here in the USA). What I did learn was that your ink does matter. The pen wrote horribly bad with brandless “Bruna” (a large chain of magazine/office supply stores) cartridges and worked a lot better when I filled up a modified converter (to make it fit in the barrel) with 15 year old Parker Quink. Still, not the best pen around but it fixed my “need… fountain… pen…” needs until the much, much better Nemosine Singularity arrived.

I had two much better pens. A Diplomat Attaché. It used cartridges and it started leaking when capped, significantly reducing my enthusiasm for that pen. And a Pelikan piston filler. No idea what model, maybe an M150 or M200? I actually had two Pelikans; in both cases the clip broke off very quickly, and the piston mechanism jammed within two years. Of course, little did I know about cleaning pens and emptying them during the summer when I was not using them… It’s ironic that a \$5 swag pen got me back, not the more exclusive brand pens.

# My oldest writing instrument

I have always like fountain pens. I just haven’t written with them for a while. How did I get back into the groove? One thing leading to another… The older I get, the more habits I seem to pick up from my father. One of those habits: “the one writing tool that always works… is a pencil.
HA! You didn’t expact that, did you? But bear with me. When I was in college I had to draw. A lot. It comes with mechanical engineering. And unlike some other studies at our college, *cough* construction *cough*, mechanical engineers tend to be really, really finicky about their drawing. I guess it has to do with the fact that in construction you’re happy when things are within 2″ if your specificationsm, where in mechanics you’re going to be upset if something is not within specified tolerances, which is usual .5 mm to .1 mm (an inch is 25.4 mm)
So, drawing with pencil we did. And again, not with what you’d think: “Well, if precision is desired, you are probably drawing with a .5 mm mechanical pencil.” And again, no. Not precise enough. We’d use a 2 mm mechanical pencil, and sharpen the tip on a piece of wood with some sandpaper stapled to it. Sharp as a nail, quite literally since we’d be using 2H (that’s #4 for you Yanks) leads as well. The pencil holder used was recommended by school—reliable, cheap and very, very uncharming.
Then, at an art store, I saw the Caran d’Ache Fixpencil. It looked simple, elegant, and with its roughened tip, very friendly to use. And it was enourmous out of budget for a college student. Luckily, when I encountered it, my birthday was coming up (I think) and one of my beloved sisters gave it to me.

The Caran d’Ache Fixpencil—a nearly 100 year old design classic

Now that I wanted to write more with pencil I started looking for that old fixpencil again. I have a beautiful 0.5 mm mechanical pencil made by Staedler (one of my favorite brands for writing utensils) with a rubber grip, indicator of hardness of the fillings, etc. But, quite frankly, 0.5 mm mechanical pencils just don’t write very smoothly. So I dug up the good ole’ fixpencil and… bliss!
Later I learned a few things that I did not know about the fixpencil. For instance, that there’s a sharpener in the red cap on the back, or that it was one of the first mechanical pencils on the market and the design has, since 1929, basically not changed. My quest of finding decently priced 2mm leads got me back in using fountain pens… but that’s a different story.

# It’s not the material

Wheter it is bikes, skis, amplifiers, fountain pens or cameras, enthusiasts always obsess over the material. Not surprisingly, because better material means better quality, right? Well… partially. But not quite all the way.

### The aluminium bike

When I grew up, bikes were made of steel. Steel comes in many gradations, the lowest being FE360 or as we were taught in college, “PBS” which is a Dutch abbreviation that can be politely translated as “UGS” or “Urinals grade steel.”

Back in those days, when men were Men and we walked every day to school, barefeet, in snowstorms, and we liked it, the more expensive racing bikes were made out of the exotic light-weight aluminium. Of course, those bikes were more expensive, but they were stiffer yet smoother, etc.

Over time, aluminium trickled down the production line to cheaper bikes. Nowadays, it is known as a material that is cheap and durable, but also known for “a harsh ride.” Have the physical properties of the material changed over time? No. What changed was with how much care the product was made.

The big misconception is that it is the material that makes the difference. “Made from expensive materials. Must be better.” No, since it is manufactured with more care, the product is more expensive. And at that higher price, you might as well use more expensive materials that make it even better. But the material follows the quality, not the other way around.

Is gold a better material for pen nibs than steel? Not really. And in the end the tip that is touching the paper is different material anyway. But, if you’re making a \$200 nib you might as well gold plate it for an additional \$20 and give your customers a reason your high-quality nib is so expensive. Even though the material has little influence on price, and is actually inconsequential for quality.

# Fountain pen anatomy

Knowing your pen is a lot easier when you know how to name the parts. Of course everyone will know what “the rear part” is but naming it properly barrel will make it so much easier.

The parts of a fountain pen

These are the parts that practically any pen has. Is it necessary for a pen to have a clip on the cap? No, but good luck finding one that doesn’t.

The nib is the business end of the pen, made out of metal. It’s sometimes called the tip or point. Some call the metal part the point, and refer to the small rounded tip at the end of it as the nib. But in general “nib” refers to the whole part. Nibs are usually made of steel, sometimes coated with expensive materials (mainly for esthetic reasons, they hardly write any better) and the tip is made of a very hard wear-resistant material. This used to be the rare metal Iridium. Nibs with a special-material tip are thus referred to as “Iridum tipped” even though nowadays other materials are used.

The feed is the plastic part underneath the nib, made out of plastic or ebonite. The feed has a couple of channels to transfer the ink to the nib, as well as ribs that are used to store ink. The ribs fill up if ink is pushed out of the reservoir to prevent leaking, and flush empty when the pen demand more ink than the reservoir can deliver. By balancing supply and demand the feed limits leaking and skipping.

Nib and feed fit into the section, the lower part of the pen that is used to hold it. Sections usually have a shape and texture to make holding the pen easier.

The rear part (or top, when writing with it) is the barrel. The barrel houses the ink reservoir, and in some cases is the ink reservoir.

There are a couple of terms that the drawing doesn’t reveal. Posting is sticking the cap on the barrel. This is done simply to not lose to cap, or to make the pen bigger. In some cases it makes the pen too big, in other cases it’s a necessity to be able to hold a small pen in your hand in the first place. Not every pen can be posted; sometimes the cap doesn’t fit on the barrel, or is too loose for comfort.

Most pens will have a center band at the bottom of the cap, or between the section and the barrel, or both. The center band doesn’t have a technical function and is purely for decoration.

In some cases, the transition from barrel to section is smooth, and in some cases there’s a strong change in diameter. This is a called a step.  Although a small step is sometimes appreciated—it provides a mark for your fingers as to where to hold the pen—a large step is generally disliked.

The one thing the drawing does not reveal is how the ink is stored inside the barrel. There are various systems in use, each of them balancing convenience, reliability and capacity. But that’s for another post.

# Ink terminology

For a quick run through all kinds of terminology with visual examples, I refer to Brian Goulet’s FP101 on Youtube. To spare you watching a 12 minute video, here are a few terms that you will come across frequently when it comes to judging ink, paper and pens.

### Dry Time

This may seem a vague term. When is ink truly “dry?” That is actually easily to determine: when it no longer smears when you rub over what has just been written. However, that of course depends on a lot of other factors as well: how much ink was laid down by the pen, how absorbant the paper is, etc.

For that reason, drying time should always be seen in context to other inks, and as a relative measure (assuming whoever is listing ink drying times uses the same paper and pen for each measurement).

### Feathering

The one thing a fountain pen excels at is at laying down a clear, crisp stroke. Thus, getting a cloudy, fuzze stroke is the bane of every fountain pen lover. That effect is called “feathering.”

Feathering demonstrated on a napkin, sketching paper, and smooth writing paper

There are three factors in feathering:

• The pen. A “wet” nib which lays down a lot of ink is certainly a factor in feathering.
• The ink. Certain inks are thicker and “dryer” than others, and more resistant to feathering.
• The paper. The biggest factor in feathering. Write on a napkin and your writing will feather, no matter what ink or pen you’re using. Other paper geared towards fountain pens (as Clairfontaine paper, bottom) will simply not feather at all. And thick sketching paper will show some feathering, depending on ink and pen used.

### Bleedthrough

Bleedthrouh can be thought of as “feathering in depth.” If the ink saturates so deeply into the paper that it shows up on the other side of the page, then it’s called bleedthrough.

### Showthrough/Ghosting

Even when ink doesn’t bleed through, it can still be visible from the other side (especially when it’s a dark ink). This is called showthrough or ghosting.

### Saturation and shading

Saturation indicates if the ink completely covers the paper, or that it lets some of the underlying print shine through. Shading refers to variation in saturation, caused either by writing slower, or by retracing strokes.

Shading and/or low saturation or not neccesarily bad; in fact, shading is an often appreciated characteristic of ink.

### Reviewing

Now you know a little bit better how to review the performance of your pen, ink and paper. Remember that it’s not just the pen; ink and paper are a very important factor as well!