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 ‘Uncategorized’ Category

Auto-logoff (windows) users at midnight

Users forget to logoff and computers get locked. Meeting locked computers at the library in the morning has been, I must admit, a small irritation to me. Why not get rid of the irritation, should be possible to write a small script to logout users automatically, shouldn’t it?

When I first googled this, I was a bit surprised not to find complete answers straight ahead, perhaps I didn’t use the “right” search terms, but nevertheless I thought I should document what I did.  Since I’m not really a sysadmin, I didn’t even know what tools to use initially. I was glad to find Task Scheduler, which provides all kinds of options for scheduling. I went with “Create Basic Task…” and followed the quite straight-forward steps, selecting “Start a program”, then “shutdown.exe” as the program/script with arguments “-f -l” to force logoff (after a little bit of googling I admit :)).

Skjermbilde 2013-07-31 kl. 21.11.37

At this point I tried clicking Run, but nothing happened…

Skjermbilde 2013-07-31 kl. 21.05.37

Under the History pane, I was told that “Task Scheduler successfully completed task ‘\autologoff’ , instance ‘[…]’, action ‘[…]’ with return code 1”, which means it failed (the phrasing “successfully completed task” is silly in that matter). Return code 0 means success. From googling I came across a really weird solution for a related problem (seems to have been a bug in Task Scheduler that has later been fixed). Well, I tried using “-f -r” to reboot instead and to my surprise that worked… Hm…?

I should mention that at this point I was logged in using an impersonal account, not my admin account, and that’s when I looked into the properties of the task and found “When running the task, use the following account” under “General”, filled with my own admin user. Moment of enlightenment; of course that was not going to logoff someone else.  Well, how to run the task as the currently logged in user then? Googling did only add to the confusion.

At this point I turned to GPOs. I created a new scheduled task and to my big surprise the field was now filled with “%LogonDomain%\%LoginUser%” – which is the magic to make it run as the currently logged-in user.

Skjermbilde_2013-07-31_kl._21.36.46

I did a test and it worked – hooray! I’ve learn

Advertisements

Fighting with APIs I: Wos and Scopus

Reading about the Web of Science innovation challenge, I was inspired to check out the API which the challenge is all about, since honestly I didn’t know WoS had a API. But absolutely no information about it was available without registering as a “Solver”. So I registered, just to discover that I would only obtain access to the API for the duration of the challenge, and “for the sole purpose of participating in the InnoCentive Challenge”. Oh Goodness.

I found another place to register, but:

We are currently processing your request, and will contact you within two business days with a response

So I had a look at Scopus. Turns out they have an API too. But according to their content policies:

The client application needs to honor the HTML rendering imposed by the JavaScript API, such as styling and branding of the results, and the links leading back to Scopus records.

I don’t remember exactly when I gave up, but I did. I will probably try again another day.

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…

Pause for poesi 2/3: Sehnsucht

Nur wer die Sehnsucht kennt
Weiß, was ich leide!
Allein und abgetrennt
Von aller Freude,
Seh ich ans Firmament
Nach jener Seite.

Ach! der mich liebt und kennt,
Ist in der Weite.
Es schwindelt mir, es brennt
Mein Eingeweide.
Nur wer die Sehnsucht kennt
Weiß, was ich leide!

Johann Wolfgang von Goethe

Barbara Bonney & Geoffrey Parsons – Schubert : “Nur wer die Sehnsucht kennt” D877/4

–––

Die Scheibe friert, der Wind ist rauh,
Der nächt’ge Himmel rein und blau.
Ich sitz’ in meinem Kämmerlein
Und schau’ ins reine Blau hinein.
Mir fehlt etwas, das fühl’ ich gut,
Mir fehlt mein Lieb, das treue Blut;
Und will ich in die Sterne seh’n,
Muß stets das Aug’ mir übergeh’n.
Mein Lieb, wo weilst du nur so fern,
Mein schöner Stern, mein Augenstern?
Du weißt, dich lieb’ und brauch’ ich ja,
Die Träne tritt mir wieder nah.
Da quält’ ich mich so manchen Tag,
Weil mir kein Lied gelingen mag,
Weil’s nimmer sich erzwingen läßt
Und frei hinsäuselt wie der West.
Wie mild mich’s wieder g’rad’ durchglüht!
Sieh’ nur, das ist ja schon ein Lied!
Wenn mich mein Los vom Liebchen warf,
Dann fühl’ ich, daß ich singen darf.

Johann Gabriel Seidl

Michael Gees – Sehnsucht D879

Skeptics and True Believers

Book coverOf course I’m a skeptic. To study or do science you have to be, since science is based on organised skepticism, in which truth is not a static, absolute quantity, but an evolving one. Yet I’ve been cautious about labeling myself as “skeptic” in public. Why? Because I’ve often had problems identifying with self-proclaimed skeptics, those whose goal in life seems to be to debunk other people’s myths, tell other people how wrong they are in their believes, expulse mystery from nature and preach science in an almost missionary way. I don’t say we don’t need myth-bunkers, we absolutely do, but for me skepticism is mainly about questioning my own truths, what I take for granted.

So I was glad when I came over this book, Skeptics and True Believers, by Chet Raymo, a self-proclaimed skeptic that I could identify very well with. What I love about Raymo is that, being a physicist and skepticist, still admit that he’s a human being with the normal needs for mystery and awe and a longing for God. As he writes, “Finding the proper balance between yearning and learning can keep us occupied for a lifetime. […] Yearning without learning is seeing the face of Jesus in a gassy nebula. Learning without yearning is seeing only the gas.” [pp. 59-61] While some enthusiastic skeptics like Richard Dawkins tend to almost attack the reader, Raymo goes into something more like a critical dialogue, which I find to be more in the spirit of a true skeptic. 

He starts the book by defining two intellectual postures to be used throughout the whole book: Skeptic and True Believer. This may seem a bit silly at first, especially as they are written out capitalized all the time, but it’s nevertheless quite useful for distinguishing an intellectual position from the person taking on that position.

I very much enjoyed his chapters on knowledge and perceptions, and his discussion on “fairy” and “double-helix DNA” as two different mental constructs, both removed from immediate sensation. While a fairy is just a “little person with dragonfly wings”, DNA is a two metre long double-helix curled up inside every living cell much like a knitting yarn, yet nevertheless able to copy itself almost perfectly all the time without entangling in a single big knot! So with DNA being far more  far-fetched and difficult to imagine than fairies, with DNA being much “farther away” from our immediate sensations, why do we accept DNA as being more “real” than fairies? The key is that DNA is part of a web of interconnected constructs related to immediate sensation in the form of experimental results. Removing the construct “DNA” makes sensations go unexplained, while removing the construct “fairy” makes no sensations go unexplained.

Citing the British writer and cartographer Tim Robinson, “Miracles are explainable; it is the explanations that are miraculous.”

Finally, I love the following metaphor, as Raymo first used in his book, Honey from the Stone:

Let this, then, be the ground of my faith: All that we know, now and forever, all scientific knowledge that we have of this world, or will ever have, is an island in the sea [of mystery]… We live in our partial knowledge as the Dutch live on polders claimed from the sea. We dike and fill. We dredge up soil from the bed of mystery and build ourselves room to grow. And still the mystery surrounds us. It laps at our shores. It permeates the land. Scratch the surface of knowledge and mystery bubbles up like a spring. And occasionally, at certain disquieting moments in history (Aristarchus, Galileo, Planck, Einstein), a tempest of mystery comes rolling in from the sea and overwhelms our efforts, reclaims knowledge that has been built up by the years of patient work, and forces us to retreat to the surest, most secure core of what we know, where we huddle in fear and trembling until the storm subsides, and then we start building again, throwing up dikes, pumping, filling, extending the perimeter of our knowledge and our security.

If we accept that knowledge is a finite island in a sea of inexhaustible mystery, then two corollaries follow: (1) The growth of the island does not diminish the sea’s infinitude, and (2) the growth of the island increases the length of the shore along which we encounter mystery.

The free particle

With no external forces acting upon me, will I simply continue along my linear trajectory, not getting to know any of the complex patterns that is life? Am I just a free particle, or can I change myself by my own force? The act of lifting yourself seems incomprehensible, out of reach of my understanding, yet within the borders of hope.

Patent stupidities

100 years ago the Wright brothers were granted a patent for a flying machine – a patent that turned out to include almost every man-made vehicle that could fly. A few years earlier Guglielmo Marconi was granted a patent on radio waves. It’s needless to say how these patents obstructed further research and development. Regarding the airplane-patent, the US government made a short process in 1917, with the World War I underway. Marconi’s patent on radio waves was claimed invalid by the US Supreme Court in 1943.

Unfortunately we doesn’t seem to have learned much from the last century’s patent stupidities. Until recently, it was not possible to patent living organisms, which were regarded as discoveries of nature and therefore unpatentable. In 1980, however, this all changed. The US Supreme Cour ruled that a living organism, a bacterium that could digest oil, could be patented. Today we have lots of patents on life: on plants, animals, genes and smaller parts of DNA.

Patents on medicines is another sad story, causing the deaths of poor people each day. Those who defend pharmaceutical patents, argue that the research of new medicines is so expensive that the pharmaceutical companies need their patents to survive. The question to ask here is if patenting is the only way to raise money for medical research? Today it’s already the public sector that pays for the bulk of drugs used in Europe, thanks to various systems for universal medical coverage. So today it’s (at least in most European countries) already the government who pay for most of the medical research (by buying patented medicines). What if the government instead could fund the pharmaceutical research directly, with the clause that the results must be made freely available? This idea is promoted by the swedish Pirate Party.