Canonical Voices

Posts tagged with 'other'

niemeyer

House decoration by Epson

I bought an Epson multi-functional printer last weekend, and now I have a big and expensive furniture for the house.

This is what one gets into when buying an Epson printer:

Well-priced printers: Printers tend to be subsidized, except for countries such as Brazil, where one has to shell the equivalent of 510 USD for an entry-level printer (the XP-702, for example).

Extremely expensive cartridges: The full set of cartridges for the XP-702, one cartridge with pigmented ink and four smaller cartridges with dye ink, costs the equivalent of 100 USD in Brazil, and together contain about 30ml of ink. The XP-600, that comes with the same model of cartridges (but incompatible, see below), costs 99USD on Amazon, and you get a printer for free.

Trashing of ink: Printers are extremely hungry for ink. An Epson printer, when first turned on, will eat a significant percentage of its initial cartridge just to load itself up. It’ll also trash a good amount of ink whenever one has to unclog its printing heads.

Clogging heads: Printing heads do get clogged. The first printer actually had to be replaced for a new one, because the pigmented black ink wasn’t working properly. The recommendation to avoid clogging heads is to print more often.

Official cartridges are incompatible: Every cartridge comes with a chip. Physically equivalent cartridges cannot be used across equivalent models that are branded differently, because the printer will refuse to recognize the cartridge. Physically equivalent printers have different models so that different regions are forced to use different cartridges.

Cartridges are not refillable: That same cartridge chip has an internal counter that goes down whenever the printer uses ink. When the counter gets to zero, the cartridge is not usable anymore, even if it still has ink in it! That chip also means it’s much harder to find alternative ink, because the alternative solution must have a working chip in it, made exactly to that one model of printer.

No new ink? No printer, no scanner: After the new printer has been replaced due to the clogged head, the replacement printer won’t turn on anymore, because it recognizes that the cartridges have been used before, even if they still have ink. A brand new set of cartridges are necessary to turn it on.

No color ink? No printer either: If any one of the cartridges is considered out of ink (see points above), the printer stops working altogether until the cartridge is replaced for a new one, even if you want to print that black-and-white document you want to deliver today.

That’s a very offensive way to handle consumers. Right now I have an expensive decorative piece that doesn’t work unless I feed it with gold. Instead of doing that, I’ll buy another printer. Not from Epson.

Read more
Gustavo Niemeyer

The Easter mgo release

It wasn’t just the bunny that was active over the holidays. The r2012.04.08 release of the mgo MongoDB driver for Go has just been tagged. This release is supposed to be entirely compatible with the last release, and there are some nice improvements and a few important bug fixes, so upgrading is recommended.

For the impatient, here is a quick summary of the changes performed:

  • Bug in Limit method fixed
  • Overflow in marshaling of time.Time fixed
  • omitempty support for time.Time fields
  • Better slave selection
  • Hard per-server connection limit
  • Improved performance of query error checking
  • Sort method arguments simplified
  • Added Session.Fsync, FsyncLock, and FsyncUnlock methods
  • Added Query.Snapshot method

If you want more details about any of these, keep reading.

Bug in Limit method fixed

The Limit method was fixed. It was improperly causing the data to be returned in a single chunk from the server, which would mean less documents being processed if the data retrieved went over 4MB. Thanks to Jeff Wendling for reporting the issue.

Overflow in marshaling of time.Time fixed

The marshaling of time.Time was overflowing due to the use of UnixNano, which means certain times would be marshaled as an arbitrarily wrong time. The zero time is an important case that was mishandled, for example. If there’s a chance your application may be affected, you may look for this date in the database to confirm:

1754-08-30 22:43:41.128654848 +0000 UTC

If you find it, that’s actually a zero time.

The problem was fixed and such times will now be marshaled correctly. Thanks to Mikael for reporting the issue on the mgo-users mailing list.

omitempty support for time.Time fields

The omitempty bson tag flag is now supported for time.Time values as well. If used, the time is only marshalled into the bson document if IsZero is false. For example:

type Person struct {
        Birthday time.Time `bson:”,omitempty”`
}

Better slave selection

The slave selection algorithm was changed so that mgo will now pick the server for which it has the least number of connections open at the moment, rather than being a random selection. More improvements in this area will come soon.

Hard per-server connection limit

There’s now a hard limit for the number of concurrent connections to a single server. If that limit is reached, the client will block waiting for connections to be released.

The default limit is currently 4096 connections per server for each mgo client, but this logic will be improved in the near future as well to take into account the number of connections currently available at the server side.

Note that this is a fire protection mechanism. This limit is not supposed to be touched under normal operation. If you have higher needs right now, please get in touch.

The development of this feature was sponsored by Iron.io.

Improved performance of query error checking

The logic that verified query results for errors was on the expensive side for large documents, as pointed out by Nils Hasenbanck in the mailing list. This has been significantly improved.

Sort method arguments simplified

The Sort method now takes a list of field names as arguments rather than a document. Field names may be potentially prefixed by – (minus) to sort in descending order.

For example, what would previously be written as:

query := c.Find(q).Sort(bson.M{“a”: 1, “b”: -1})

Is now written as:

query := c.Find(q).Sort(“a”, “-b”)

The previous format is still supported right now for compatibility reasons, but it is deprecated and will eventually be dropped entirely.

More details at:

http://godoc.labix.org/mgo#Query.Sort

Added Session.Fsync, FsyncLock, and FsyncUnlock methods

The new Session Fsync method requests a synchronous or asynchronous flush of in-memory changes to disk, while the FsyncLock and FsyncUnlock methods do the opposite: they handle a lock at the server side that blocks any follow up write requests (and read requests too, see the documentation). This is useful, for example, to perform backups reliably.

See the documentation of these methods for more details:

http://godoc.labix.org/mgo#Session.Fsync
http://godoc.labix.org/mgo#Session.FsyncLock
http://godoc.labix.org/mgo#Session.FsyncUnlock

Added Query.Snapshot method

The new helper method wraps the snapshot command. More details in the documentation:

http://godoc.labix.org/mgo#Query.Snapshot

Read more
Gustavo Niemeyer

Smart Package Manager 1.0

After 4.5 years in development, Smart has been branded as 1.0. A big Thank You to everyone who contributed along the years.

Read more