Not a blog about the science or practice of travel through books, but perhaps rather about science, practice and travel through books.

Archive for the ‘computing’ Category

The Git hashes

I started thinking about the SHA-1 hashes used in Git today. The hashes are 160 bits long, and are usually represented by 40 character hex strings. Why 40?

If one character represents x bits, the character set must include 2x distinct characters. And with 2x distinct characters (or numerals), we have a base-2x system. With just two distinct characters (A and B, say), one character represents one bit, x = 1, and we have a base-2 system. With four distinct characters (1,2,3,4, say), we have a base-4 system, and one character represents two bits since 22 = 4.

One hex character (or hexadecimal), is a character in a base-16 system (hexa – 6, decimal – 10), so a full set must include 16 distinct characters, and each character represent 4 bits. Most often, the set are taken to consist of the numerals 0-9 plus the six letters A-F. This makes a hex string easy to read and use for human beings.

The number n of x bit characters needed to store a 160 bit hash is found by solving 2160 = (2x)n, or n = 160/x. The number of hexadecimals needed are therefore n = 160/4 = 40.

On the other hand the byte character represents 8 bits, which means a full set must include 28 = 256 different characters. A byte string would therefore only be 160/8 = 20 characters long, but most byte character sets include characters that are not human readable, such as control characters. A character set of 256 human readable characters using some of the richer alphabets than the basic Latin one would be possible, but then come issues with transferability.

What about something inbetween? A 5 bit string would only be 160/5 = 32 characters long, and would need 2^5=32 unique characters, a base-32 system. That could be the 26 letters A-Z plus 6 numerals. It could still be  case-insensitive and easy readable, yet 8 characters shorter. Nevermind…

Advertisements

Blog comments on academic publications

Many Norwegian universities today have their own open access repositories. The University of Bergen has BORA (shared with HiB and NHH, the University of Oslo has DUO, NTNU uses DIVA – and there exists a search engine to search though all of them (I’d never heard of it before though..): Nora. While this is good, the large majority of the work produced are never published in these repositories. Vox Publica reports that only 33 of 9868 peer-reviewed articles produced in 2006 are available!

One reason is that they are all based on an opt-in model. It’s therefore interesting that Harvard University decided that all scholarly publications by employees at the university must be made available online in an open access repository. The proposal uses the opt-out model instead, where all articles must be submitted to the repository and scholars who don’t wish their work to be openly available must apply for a waiver. I would love Norwegian universities to follow suit! NTNU has already taken a small step in the right direction, by deciding that all master’s and phd theses will follow the opt-out model.

In the future, open access might lower the barrier between academic publications and the “informal web”. Maybe blog comments on academic publications one day will be a common phenomena?

Where is Turkey going?

Don’t block the blog

It may seem like banning internet sites is in the wind. Now Turkey do it too. To weeks ago, the creationist Adnan Oktar filed a court order where he claimed that a number of blogs on WordPress were libellous to him and that the whole site should be banned. And he won!

An interesting point is that the order was carried out almost immediately, because there’s in practice only one broadband-firm in Turkey. This shows the need for several internet providers in a country – and for responsible internet providers. My internet provider here in Sweden, Bredband2, clearly states that they won’t give away personal details or accept to bee cencored.We might take that for granted here, but why should we? Every internet provider should state this.

Wordpress.com blocked

Who needs their own music?

Share musicI got a surprise the first time I opened iTunes while connected to the internet at my new room in Lund. A feature in iTunes is that it searches for shared music on the local network. Back in Bergen, local network meant the house I lived in, with three other appartments and no other iTunes-users. Here local network means, well, I don’t know if it’s just this block or all the blocks, but at least there’s always around 10 shared libraries available. It’s really interesting to browse around and I’ve actually discovered some new artists this way. But of course the title is a bit misleading.. I do need my own music too!