Categories

LaTeX Beamer Diepen style

When I was a PhD student I had to give some presentations. I think I tried once to use Powerpoint to give a presentation filled with mathematical equations before I decided that this was not going to work ;)

After some other packages, I finally found LaTeX-Beamer. For the majority of the presentations the default styles provided with LaTeX-Beamer were sufficient, but every now and then I wanted to have a bit more, do I dare to say it, powerpoint like theme ;)

I wanted to have background image over which an white transparent layer would be put, on which the text would appear. I created a latex-beamer style for this and a sample output of this diepen style is given in the two pictures below:

Screenshot showing example title page of diepen style

Screenshot showing example title page of diepen style

Screenshot of normal sheet in diepen style

Screenshot of normal sheet in diepen style

The picture that is on the background can be changed into any picture you choose, although I found that in most cases the result is the best when the used image is not too bright.

To use the style, you must first download the source, unpack it to a directory of your choice in the texmf directory (or your local texmf directory) and make sure that you have run the texhash command under linux or the windows equivalent such that pdflatex is able to find the style files.

After you have done this, you can use it by placing the following command in the preamble of your beamer file:

1
\usetheme{diepen}

The following options are available:

  • backgroundimagefile. The filename (without extension) of the image to use as background (e.g.
    1
    
    \usetheme[backgroundimagefile=schiphol-tower]{diepen}

    to use schiphol-tower image as background)

  • opacity. A float value denoting the opacity of the white overlay on all sheets except the title page (e.g.
    1
    
    \usetheme[opacity=0.78]{diepen}

    to have opacity of 78%).

  • useblacktitletext. Is a boolean and if present the color of the text on the titlepage will be black instead of white
    1
    
    \usetheme[useblacktitletext]{diepen}

    . This option sometimes is useful for background images that are rather light in color

If you have any questions about this diepen style, please let me know.

Sometimes shit happens ;)

For the last couple of days an increasing number of people were mentioning that they had problems with synce in Ubuntu. After running synce-pls they received the following error:

** (process:6884): WARNING **: synce_info_from_hal: Failed to obtain property pda.pocketpc.iface_address for device /org/freedesktop/Hal/devices/net_80_00_60_0f_e8_00: org.freedesktop.Hal.NoSuchProperty: No property pda.pocketpc.iface_address on device with id /org/freedesktop/Hal/devices/net_80_00_60_0f_e8_00
process 6884: arguments to dbus_move_error() were incorrect, assertion “(dest) == NULL || !dbus_error_is_set ((dest))” failed in file dbus-errors.c line 278.
This is normally a bug in some application using the D-Bus library.

** (process:6884): CRITICAL **: synce_info_from_hal: Failed to obtain property pda.pocketpc.platform for device /org/freedesktop/Hal/devices/net_80_00_60_0f_e8_00: org.freedesktop.Hal.NoSuchProperty: No property pda.pocketpc.iface_address on device with id /org/freedesktop/Hal/devices/net_80_00_60_0f_e8_00
** Message: Odccm is not running, ignoring
synce-pls: Could not find configuration at path ‘(Default)’

It turned out to be a small error in the libraries that somehow made it into the launchpad repository. Sometimes Murphy just happens to pay a visit ;)

The problem should be fixed soon, when new packages are uploaded to the repository.

So if you are running Ubuntu and seeing the exact error above, please be patient for some days and try often to see whether there are updates :)

City trip to Dublin

Last weekend I went for a city trip to Dublin together with my wife. Of course we had to visit two things that Dublin is famous for: the Guiness brewery and the Jameson distillery ;)

At the Jameson distillery you have a guided tour that shows you the process of whiskey making. At the start of the tour, they ask for some volunteers, but we did not yet know for what that would be. I was chosen as one of the volunteers, and at the end of the tour it was clear what the task was: a whiskey tasting event :) We had three shots of whiskey, one Jameson, one Jack Daniels, and one Jimmy Walker and at the end we had to answer the question which of these three was the best ;) To prove that I gave the right answer I got the following certificate:

Jameson whiskey tasting certificate

Jameson whiskey tasting certificate

I have to say that this tour was really good fun.

The tour at the Guiness brewery was completely different, you could just walk through the complete museum by yourself, and at the end of the tour there was the complementary pint of Guiness in the Gravity bar, which is on the 7th floor with an amazing view over Dublin.

If you are planning to go to Dublin, I can recommend the above two activities :)

Little Operations Research Joke

When following some different blogs about Operations Research the other day, I found the following very nice OR joke on the ThinkOR blog:

At the end of his course on mathematical methods in optimization, the professor sternly looks at his students and says: “There is one final piece of advice I’m going to give you now: Whatever you have learned in my course – never ever try to apply it to your personal lives!” 

 

“Why?” the students ask.

 

“Well, some years ago, I observed my wife preparing breakfast, and I noticed that she wasted a lot of time walking back and forth in the kitchen. So, I went to work, optimized the whole procedure, and told my wife about it.”

 

“And what happened?!”

 

“Before I applied my expert knowledge, my wife needed about half an hour to prepare breakfast for the two of us. And now, it takes me less than fifteen minutes…” 

 

Explaining what is Operations Research

Towards the end of my studies, I started to work in the field of Operations Research. After that, my PhD topic was also in the field of Operations Research. Currently I work for paragon, which is the developer of AIMMS and as can be seen on the website of our company, we strive to enable people to apply OR successfully.

Now there always was the problem that I have to explain to other people what exactly Operations Research is. The other day I found the perfect post about this on the blog of Michael Trick, who in turn got this from the first OR post on the blog of Jim Orlin.

After reading the comments, I have to say that I like the explanations I found in the comments, like “practical math”. But I fully agree with the modified definition given by Michael Trick: “The science of better decision making.

Also, I really enjoyed the following algorithm that Jim Orlin gave that helps me explain what exactly OR is:

Algorithm for describing operations research to a friend or colleague.

 

Step 1. Find out a system about which the other person is both interested and knowledgeable. (e.g, sports, entertainment, communication, travel, or anything relating to a person’s job.

 

Step 2. Develop a plausible scenario based on the system in Step 1; e.g., scheduling sports teams, designing wireless phone systems to provide for the best possible reception, or designing queuing systems at Disneyworld. (I have found that it is very useful to give an example that addresses a problem at the other person’s work that he or she just told you was important.)

 

Step 3. Explain how operations research can be used to find an excellent solution for the scenario in Step 2 or provide very useful information for the scenario in Step 2.

Preventing the “Whoops, here you have the attachment” second email with outlook

Who has never encountered the following problem:

You want to send somebody an email with an attachment. You create the message, hit send and the second you let go of the send button, you think “%$@!%!^, I forgot to attach the file”

One of my colleagues had a possible work around for this problem: prevent outlook from sending messages directly when you hit send, but have outlook send all messages in the outbox every given number of minutes. This way, on average you have some time to figure out you forgot to attach something :)

I have to say that I did not like this work around that much, so I started looking on the internet what I can find as other means to tackle this problem. I found aBlog with some VBA macros that will give an additional warning when it appears you forgot an attachment while sending the email.

The author of the original article did have one other complaint, and that was that he was getting a security warning every time the macro was run. This can be solved in two ways: you can either set the security level for macros in Outlook to Low (i.e. every macro can be executed, bad bad idea ;) ). The other way is to self-sign your VBA project, for which you can also find instructions on the internet.

One other thing that I did not like about the code as presented on ablog, is that it does not try to be clever about false positives: If I send an email to somebody with the word attach in it, and that person replies to my email, this reply contains the word attach (because of my original message). If you now reply to this reply again, the macro will detect the word “attach” from the original message, and trigger a warning when you try to send the email. I don’t want to be bothered with warning messages if they are most probably not needed, so the macro almost fit my needs, but not 100% yet :)

To overcome this last problem, I have modified the original code just a little bit. Because I hope that somebody else might have some advantage with this modification, I have put it below:

Option Explicit
 
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
  If Item.Class = Outlook.olMail Then
    If Item.Attachments.count = 0 Then
      If SearchForAttachWords(Item.Body) Then
        Dim userReply As VBA.VbMsgBoxResult
 
        userReply = VBA.MsgBox("It appears you are sending the email without attachments while " & _
                           "the body/subject contains possible references to an attachment." & _
                           VBA.vbnewline & "Do you want to send the message without attachments?", _
                           VBA.vbYesNo + VBA.vbDefaultButton2 + VBA.vbQuestion + VBA.vbSystemModal, _
                           "Possibly missing attachment...")
 
        If userReply = VBA.vbNo Then
          Cancel = True
        End If
 
      End If
    End If
  End If
End Sub
 
Function SearchForAttachWords(ByVal s As String) As Boolean
  Dim positionMailTo As Long
 
  positionMailTo = VBA.InStr(1, s, "mailto:", VBA.vbTextCompare)
  If positionMailTo = 0 Then
    positionMailTo = VBA.InStr(1, s, "From:", VBA.vbTextCompare)
    If positionMailTo = 0 Then
      positionMailTo = VBA.Len(s)
    End If
  End If
 
  Dim v As Variant
 
  For Each v In Array("attach", "enclosed", "bijgevoegd", "bijlage")
    Dim tempPos As Long
    tempPos = VBA.InStr(1, s, v, VBA.vbTextCompare)
 
    'Only interested in the keywords when they are before mailto:,
    'which would be the original message we are replying to

    If (tempPos <> 0) And (tempPos < positionMailTo) Then
      SearchForAttachWords = True
      Exit Function
    End If
  Next
End Function

To get everything working, copy the above to your clipboard, fire up outlook and press ALT-F11 to get to the visual basic editor. In the visual basic editor, go to the ThisOutlookSession which can be found under Project1->Microsoft Outlook Objects. After you copied this and you don’t want to be annoyed with security warnings of outlook, please follow the earlier mentioned link regarding signing the project with a self-signed certificate.

Some comments regarding the above code:

  • I prefix all functions and values with their respective origin (e.g. VBA.InStr(…), VBA.MsgBox(…), and VBA.vbYesNo, etc ). The reason for this is that at my work, I have outlook 2007 installed on my computer. I have created quite a bunch of macros that are now distributed via copying the VbaProject.otm file. Unfortunately, when other users have outlook 2002 or outlook 2003, they get error messages about things that cannot be found when I do not prefix everything. After the prefixing, there are no problems at all.
  • bijgevoegd / bijlage are the dutch words for “attached” and “attachment”. Of course if you want to have the warning trigger on other words, you can put the additional words on this line.

Please let me know if you have any additions to the macro that I did not think of yet, or drop me a note in case the macro has saved you from some embarrassing resend after you just sent a message without attachment ;)

Facebook panel for Xperia X1

Recently I got a new phone: the Sony Ericsson Xperia X1. Before this I had pretty much every phone of the MDA series of T-Mobile (the branded version of the HTC phones). From the first windows mobile phone I got I have always had the ones with a QWERTY keyboard. I found this to be very useful when I am typing emails or surfing the internet. So when my contract was ending, I decided that again I wanted to have a phone with a QWERTY keyboard and fortunately t-mobile just released their branded X1 :)

One of the new things of the X1 is the panel display, where you have the 9 different panels to access different kind of tasks easily. This new function was something I did not really use. One thing I still was missing for windows mobile was a good native client for Facebook. My wife has a blackberry from her work and there is a very nice facebook client for the blackberry. It struck me as a bit odd that no really good client yet existed for Windows Mobile. I even got to the point of thinking how difficult it would be to start programming a simple client myself…..

Luckily, this last bit was not needed and I finally found a use for the panels. When looking at the sony ericsson X1 page, I found that there was a new facebook panel, which appears to be working quite well. It sure beats using the mobile portal m.facebook.com :)

Waiting for more interesting applications, either as a panel for the X1, or just windows mobile applications in general.

The lost screencast of synce-kpm in action

Due to the crash, I lost all my posts. One of the posts was showing a screencast of synce-kpm in action.

For the people that could not see it anymore and just for making my blog complete with the screencast again, here it is:

The life after my PhD years :)

It has been quite some time since my last post already again. During my PhD years I really got used to the fact that I had loads and loads of spare time besides work. The main reason for this was that I was living about 15 minutes biking away from the university.

Unfortunately, at the moment I have a lot less time to work for example on SynCE or other things. There are two main reasons for this:

  • At the moment I have a commuting time of about 1.5 hours (one-way…. another 1.5 hours in the evening going back)
  • All the spare time that I have at the moment is spent on looking for a house

Whenever the second reason has been solved (i.e. we found a house), automatically the first one reason will disappear also :) Currently still in the process of searching though :)

One other major difference in my current working life, compared to my life at the university, is that I am forced to use Microsoft Windows, while at the university I was running Linux fulltime… Although I am customizing my windows computer in such a way that I can start working faster and faster with it, often I get reminded to why I was working with linux all of the time (and still am at home): weird things sometimes happen with the microsoft products…

Although I am not the biggest fan of Microsoft products, I do have to admit that Outlook (despite some weird issues) is a rather nice program. Fortunately, for all the things that Outlook cannot do, you have the option of writing the required functionality yourself in the extremely powerfull macro language provided. During my high school years I did quite some VBA programming to create al sorts of nice things for Microsoft Word.

I already created some nice additional functionality for outlook, some of which I will put online later on  (when I have some time, but hopefully before I found the house :) ). One of the nicest features I added is the possibility of checking each message you send for possibly missing attachments. If you are sending an email that contains the words “attach”, “enclosed”, “bijgevoegd” (=attached in dutch :) ) and the message does NOT contain any attachments, you still get the option of cancelling the send and attach any file you forgot to attach. Though I did see that similar macros already existed, I have tried to make my macro a bit smarter to prevent false positives from happening (i.e. the macro thinks you forgot an attachement, but this was not the case). I will try to put this enhanced version online either this afternoon or this weekend.

Since at the company I work for not everybody is having the same outlook version, but most people were interested in using this macro, I ran into the stupid issues of deploying outlook macros. My current macro set is working for outlook 2002, outlook 2003, and outlook 2007 without any modifications. The users only have to copy the latest vbaproject.otm file from the network drive to get all the latest functionality. I even do a check whenever outlook starts whether the version of the macro the user currently has is the latest. If not, after a confirmation of the user, outlook is closed and the two folders where the user has to copy the vbaproject.otm to and from are opened. I wished I could do this part automatically also, but so far I have not found a possibility for this (i.e. updating the vbaproject file while outlook does not have to closed).

If anybody has a good idea on how to do this last thing, please let me know.

Finally, finished!!! :)

After just a bit over 4 years, last wednesday there was the grand finale of my time as a PhD student: the defense of my thesis, entitled: “Column Generation Algorithms for Machine Scheduling and Integrated Airport Planning”

First there was the dressing up, not only for me, but also for my two paranimfs (My dad on the left and my brother on the right).

Outside the Academiegebouw

Outside the Academiegebouw

Here everything was still relaxing, not too much pressure. After this we got inside and I had to wait in a little room till the start, when the ‘pedel’ would get me.

After I got to the room, there is the defense of my thesis, which lasts exactly one academic hour (i.e. 45 minutes :) ). During this time I must answer questions from the opposition (while my both paranimfs have the comfortable job of just sitting down for 45 minutes ;) )

Defending

Defending

Defending

Defending

After the 45 minutes, the pedel comes into the room with the message “Hora est” (it is time). After that the opposition goes back to a separate room where they will discuss whether I am worthy of the title. After this meeting, they come back and below is the picture when I receive the degree certificate out of the hands of my promotor Jan van Leeuwen:

Receiving the degree certificate

Receiving the degree certificate

And, after this all is finished, I go downstairs to a different room where people have the chance to congratulate me with the newly acquired degree :)

Congratulations

Congratulations

So from this moment on I am entitled to call myself dr. Diepen :)

And before I forget, last monday, just two days before my defense, the friendly gate planners at Amsterdam Airport Schiphol gave me an awesome present: A two hour visit to the tower at Schiphol!!! Since I already had been once on the platform with the gate planners, the tower was the only ‘great’ place at Schiphol I did not visit. I have to say, the view over Schiphol from 67 meters up is in one word: AWESOME!!!

I did have my camera with, but unfortunately it is not allowed to put these online. So you will just have to take my word for it, it is really nice :)