Why you need at least two computers these days

At least if your are a Windows user you probably need two computers these days. In the morning after I have turned it on and wanna start working with it my computer usually becomes in-responsive for several minutes while updating the virus scanner, running virus scans and especially when the installer kicks in to install updates.
The disk light goes on and the system is basically freezing. No matter how powerful your computer is, Windows turn it into a slow creature. The disk seems to become the bottleneck while virus scanner and installer read tons of data and other applications almost get no time slice to do anything.
Time to grab a coffee, or use your second computer to get things done, hopefully one with may be Linux installed. I decided to leave my computer alone while it is doing all its morning routine. True multitasking apparently doesn’t work under Windows if a single application or two can force it to be completely under their control.
On my private desktop computer with Windows 7 installed yesterday I changed the settings in Windows Update Center from "Automatic installs" to "Automatic downloads, but prompt me for install". This should allow me to decide when the install actually will run and thus give me as a user the power to first get my things done before letting the computer do its sanitary work. Let’s see how this works out in the future.

( I actually wrote this blog posting on my second computer while waiting for my primary work computer to become usable again Zwinkerndes Smiley )

Some people always talk

Every morning when my wife and I are having breakfast we see two woman from the neighborhood walking their dogs. When they pass by our house it is always the same woman talking while the other one is listening. Every single day !
Many years ago I had a boss who was talking forever. When he called me into his office I always knew it would take 2 hours and during these 2 hours he would be talking and I would be listening. In rare situations when I made it to talk I saw him yawning after a short while. His eyes seemed to turn to his inner part, it looked like his brain was shutting off.
Shouldn’t communication between people consist of a somewhat balanced amount of talking and listening ? Why do some people always talk ?

The risk of solar energy. Let’s see what will happen on Match 20th.


I never thought about this so far, but living with solar energy does come with some risk too. A big risk will be the eclipse of the sun coming up on March 20th, when between 9:30 and 12:00 in the morning here in Germany up to 82 % of the sun will be covered by a shadow. For our energy providers this means that at the beginning energy production will decrease by 12.000 MW, so other power plants will have to jump in quickly to cover that. Continuous energy supply is a must have for many big industries in Germany.

A bigger risk will be the 19.000 MW suddenly streaming into our net some hours later ( when sun shines much more than in the morning ), coming from the 1 million solar collectors availabe in Germany. 19.000 MW, that would be the output of 14 large nuclear plants !

Hopefully weather won’t be too nice at that days, a cloudy sky could help much to mitigate the problem.

After this challenging test the next will come up in 2048, when the next solar eclipse of this magnitude will show up.

Let’s keep fingers crossed. Hopefully it will be like the year 2000 problem where finally nothing serious happened.

Source "Wir sind angespannt": Sonnenfinsternis birgt Blackout-Gefahr" ( heise.de )

2014 in review

The WordPress.com stats helper monkeys prepared a 2014 annual report for this blog.

Here’s an excerpt:

The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 24,000 times in 2014. If it were a concert at Sydney Opera House, it would take about 9 sold-out performances for that many people to see it.

Click here to see the complete report.

How to keep track of changes in multiple columns in a MS Excel spreadsheet

In a question to my blog article “How to keep track of changes in a MS Excel spreadsheet” I have been asked whether the code I showed there could be changed to monitor multiple columns in a spreadsheet.

Of course it can. The new code I am showing below handles an arbitrary number of columns, with the following assumptions / pre-requisites:

  • Column label in row 1
  • Row identifier (id) in column 1 of each row

I have changed my example from the previous article and added an additional column to my list of products: ‘Vendor’, here is an example:

Let’s change Price of Product C to $ 1301,00 and Vendor to ‘Company B’. Here is how the new Change History looks like:

Column B now shows which columns was changed and column C the new value, as usually together with a time stamp. Column A identifies for what product ( my ‘id’ column in this example ) the change occurred.

And here is the new code:

Private Sub Worksheet_Change(ByVal Target As Range)
 Dim AuditRecord As Range
 ' This is our change history ...
 Set AuditRecord = Worksheets("ChangeHistory").Range("A1:B65000")
 r = 0
 ' Now find the end of the Change History to start appending to ...
    r = r + 1
 Loop Until IsEmpty(AuditRecord.Cells(r, 1))
 ' For each cell modified ...
 For Each c In Target
   Row = c.Row
   Col = c.Column
   Value = c.Value
   ' ... update Change History with value and time stamp of modification
   AuditRecord.Cells(r, 1) = Worksheets("Products").Cells(1, 1) & " " & Worksheets("Products").Cells(Row, 1)
   AuditRecord.Cells(r, 2) = Worksheets("Products").Cells(1, Col)
   AuditRecord.Cells(r, 3) = Value
   AuditRecord.Cells(r, 4).NumberFormat = "dd mm yyyy hh:mm:ss"
   AuditRecord.Cells(r, 4).Value = Now
   r = r + 1
Next End Sub

Risk and hope

What science tells us is not that you are guaranteed to die because of smoking. It tells us about an increased risk to get a disease or die because of smoking.
When you deal with risk you also deal with hope. What is true for the average person hasn’t have to be true for a single individual like you.

Why do scientists who know about the risk of smoking smoke ? Especially scientists are probably good in dealing with risks and probabilities.

If you are an optimistic person anyway you always would say: yes, I see the risk, but I will be on the lucky side.

Is that the reason we don’t do risk management in our projects ? Because we prefer to hope than to plan accordingly ? Hoping definitely is cheaper.
It’s kind of gambling. When it comes to smoking, it is kind of gambling  with your life.
I personally wouldn’t do this. I always try to minimize risks, when I can. Well … not always. Otherwise I wouldn’t have done some glacier crossing and climbing on rocky mountains during my last vacation. Well, at least we hired a mountain guide to do so, so we took some risk, but then worked on minimizing it.

That picture doesn’t show me, but our mountain guide. Anyway, I had to go the same way.
You actually always take risks. Your entire life is risky, more or less. Even if you stay at home. Most people die there.
But it is easy for me when it comes to smoking: I never figured out what people like about this and never had any interest in smoking. Except may be a water pipe once or twice a year after a diner in my garden.

IPython and lxml

I have been playing a bit with ipython and lxml these days.

IPython is a powerful and interactive shell for Python. It supports browser based notebooks with support for code, text ( actually html markup ), mathematical expressions, inline plots and other rich media. Nice intro here:

Another nice demo what you can do with ipython actually is the pandas demo video here.

Several additional packages need to be installed first to really be able to use all these features, like pandas, mathplotlib or numpy. A good idea it is to install the entire scipy stack, as described here.

I did the installation first on my windows thinkpad and later on on a Mint Linux box.

This is some work to get thru, like bumping into missing dependencies and installing those first, or try several installation methods in case of problems. Sometimes it is better to take a compiled binary, sometimes using pip install, sometimes fetching a source code package and going from there.

I finally succeeded on both my machines. Next step was to figure out how to run an ipython notebook server, because using ipython notebooks in a browser is the most efficient and fun way to work with ipython. For Windows there are useful instructions here, on my Linux Mint machine it worked very differently, working instructions I finally found here.

After that I developed my first notebook using lxml, called GetTableFromWikipedia, which basically goes out on a wikipedia page ( im my case the one about Chemical Elements ) and fetch a table from there ( in my case table # 10 with a list of chemical elements ), retrieves that table using lxml and xpath code and converts it to csv.

The nice thing about ipython is that you can write code into cells and then just re-run those cells to see results immediately in the browser. This makes it very efficient and convenient to develop code by simply trying, or to do a lot “prototyping” — which sounds more professional.

Having an ipython notebook server running locally on your machine is certainly a must for developing a notebook. But how to share notebooks with others ? I found http://nbviewer.ipython.org allowing to share notebooks with the public. You have to store your notebook somewhere in the cloud and pass the URL to the nbviewer. I uploaded my notebook to one of my dropbox folder and here we go: have a look ! Unfortunately it is not possible to actually run the notebook with nbviewer ( nbviewer basically converts a notebook to html  ).

My notebook of course works with other tables too, like the List of rivers longer than 1000 km, published in this wikipedia article as table # 5.


Get every new post delivered to your Inbox.