VBA macro for creating picture credit slides in PowerPoint 2010

When creating presentations the Presentation Zen way, you end up using lots and lots of pictures. If you use pictures that are published under a Creative Commons license you may need to mention the names of the original authors/photographers. I do so by showing a slide show with all pictures and the corresponding authors’ names and picture URLs at the end of my presentations like the one shown in the following screenshot.

PowerPoint Credit Slideshow

Creating a slide show like that for hundreds of pictures can be a real pain. Therefore, I wrote a VBA script (macro) for PowerPoint that creates a basic credit slide show like the one in the screenshot above automatically. All you need to do to be able to use the macro is this:

  • Save the authors’ credit information in a simple text file of the following format in the same directory as your presentation: BlueFlower: doug88888 - http://www.flickr.com/photos/doug88888/3086318277/ YellowFlowers: Thomas Hawk - http://www.flickr.com/photos/thomashawk/11708783/ PinkFlower: Ba Thanh Dinh - http://www.flickr.com/photos/xuki/3116026788/ Wasp: aussiegall - http://www.flickr.com/photos/aussiegall/2208863802/
  • Don’t embed the pictures into your presentation, link them.
  • Save the pictures in a separate subdirectory, e.g. Pictures.
  • Name the pictures according to the titles used in the text file (e.g. BlueFlower.jpg).
  • Run the macro GeneratePictureCredits().

The credit slides may need some manual editing, e.g. if the pictures have an odd site ratio or the URLs are very long, but most of the boring work will be done for you.

Download

You can download a sample presentation including the pictures, the credit text file and the VBA macros here: PowerPoint Picture Credit Slideshow Macro (pptx).

The latest version of the macro itself can always be found here: PowerPoint Picture Credit Slideshow Macro (txt).

PowerPoint Flowers

Duales Studium Wirtschaftsinformatik 2011 in Vechta

Mein Arbeitgeber bietet im kommenden Jahr 2011 wieder einen Ausbildungsplatz für eine/n duale/n Studenten/in (ok, ich spare mir die Geschlechterunterscheidung jetzt einfach mal) im Bereich Wirtschaftsinformatik an. Wer Lust hat, bei mir als Ausbilder 3 Jahre in einem erst vor wenigen Wochen eingeweihten Neubau in Vechta in die Lehre zu gehen, kann sich ab sofort bei uns bewerben. Hier gibt es weitere Informationen und die E-Mail-Adresse bzw. Anschrift:
Stellenangebote – ALTE OLDENBURGER.

Logo ALTE OLDENBURGER

Die ALTE OLDENBURGER bietet das duale Studium in Zusammenarbeit mit der BA Emsland an und der Ausbildungsberuf ist der Fachinformatiker Anwendungsentwicklung.

Logo BA Emsland

Außerdem bieten wir noch weitere Ausbildungsplätze zum Kaufmann für Versicherungen und Finanzen und das duale Studium im Bereich Betriebswirtschaftslehre (BWL) in Kooperation mit der FHWT an.

Weiterführende Links

Enable Remote Desktop Connections on a remote PC

Sometimes you need to logon to a remote PC via RDP but the PC is not configured to allow remote connections. Instead of walking over to the machine and setting the needed configuration manually, you could enable RDP connections on the remote PC using regedit as follows:

  1. start regedit and connect to the remote PC’s registry (you need admin rights on the remote machine)
  2. set the value of key fDenyTSConnections under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server to 0
  3. delete the following keys under HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\TermService\Parameters if they are set:
    • Certificate
    • X509 Certificate
    • X509 Certificate ID
  4. reboot the remote machine: shutdown -r -f -t 0 -m \\pcname

Links

Resize and rotate all images in a Word 2010 document

Just a little snippet to resize and rotate all images in a Word 2010 document. I needed it to create a table with multiple images per row/column from some dragged and dropped images.
Option Explicit Sub ResizeAndRotateAllImages() Const ROTATION = 90 Const HEIGHT = 7 Dim n As Integer For n = 1 To ActiveDocument.InlineShapes.Count With ActiveDocument.InlineShapes(1) .ScaleHeight = HEIGHT .ConvertToShape End With Next n For n = 1 To ActiveDocument.Shapes.Count With ActiveDocument.Shapes(1) .IncrementRotation (ROTATION) .ConvertToInlineShape End With Next n End Sub

Apparently, you have to convert the inserted images from InlineShape to Shape and back as both types provide different methods (e.g. only Shape offers IncrementRotation).

Master of Engineering (M.Eng.)

Mein Abschluss ist zwar schon etwas her, aber am 22.07. fand die offizielle Abschlussveranstaltung der Fakultät efi (Elektro-, Feinwerk- und Informationstechnik) der Georg-Simon-Ohm-Hochschule Nürnberg statt. Dort wurde ich als bester Absolvent meines Jahrgangs geehrt (und zufällig bin ich sogar in der Fotogalerie der Ohm-Hochschule zu sehen).

Zwei kleine Artikel zu meinem Abschluss gab es heute auch in den lokalen Tageszeitungen zu sehen:

M.Eng. Stefan Macke Diepholzer Kreisblatt 05.08.2010
Quelle: Diepholzer Kreisblatt 05.08.2010


M.Eng. Stefan Macke Oldenburgische Volkszeitung 05.08.2010
Quelle: Oldenburgische Volkszeitung 05.08.2010

Wie es in den Artikeln schon angedeutet wird, hätte ich das sicherlich nicht ohne die Unterstützung meines Arbeitgebers geschafft, der ALTE OLDENBURGER. Also versichert euch gefälligst alle bei uns! 😉

Zotero plugin for DokuWiki

For managing my literature sources for reference lists I use Zotero and I really like it. It is a plugin for Firefox and supports synchronizing the database and the attachments to an online server. The only thing that was missing was a way to cite my sources from inside my DokuWiki. I wanted to be able to add citations to my texts like I do in LaTeX.

For this reason I created a plugin for DokuWiki that allows me to cite sources from my online Zotero database by using the syntax known from LaTeX. The plugin reads my reference list from the Zotero website and caches it on a local wiki page. After that I can cite a source simply by adding \cite{ShortName}. Take a look at my wiki (e.g. Programming Hints) for some examples.

DokuWiki Zotero Plugin 02
DokuWiki Zotero Plugin 01

For this to work, every source needs to have a short name as I did not want the cite key to be the Zotero ID but rather a more meaningful name. Almost every Zotero entry type has the field “short name” assigned to it so I used that for this purpose.

Here is an example of the steps to perform to be able to cite a Zotero source:

  1. I add a new entry to my Zotero database, e.g. Robert Martin: Clean Code (2008) and assign the short name Martin2008 to it.

    DokuWiki Zotero Plugin 04
  2. I synchronize my Zotero database with the Zotero server (because the plugin reads the data from the Zotero website).
  3. I write some text in my wiki and add \cite[p.123]{Martin2008}.
  4. I preview or save the current wiki page and the plugin tries to find the cited reference in its local cache and displays it. If the entry is not already in the cache, it automatically loads my newest Zotero sources from the website, caches them, and displays the cited source afterwards.

For the initial import of all my Zotero entries I added a script that parses the complete reference list on the Zotero website.

DokuWiki Zotero Plugin 03

Download

The plugin can be downloaded here: Download DokuWiki Zotero plugin or installed via the plugin manager.

Also see the DokuWiki Plugins page: zotero plugin.

Please see Install.txt for a short installation guide.

TYPO3: How to enable links to local files in RTE

Today I needed to link to a local file on a network share from a page in TYPO3. This link did not start with the usual http:// but instead with file:///. The problem was, that the rich text editor (RTE) in the backend of TYPO3 always prepends “invalid” links with http:// and I ended up with http://file:///path-to-network-share, which of course did not work correctly.

I tried editing the RTE parse function in TYPOScript but that did not solve my problem. So, after a while of searching the internet I found the answer: append rtekeep="1" to the link like in the following example. This tells the RTE to leave the link untouched.

<a href="file:///path-to-network-share" rtekeep="1">Link to file</a>

(via tuga.at)

Using PHP to query Zotero’s REST API

Today I tried to query Zotero’s REST API with PHP to retrieve a list of my bibliography items for further processing. The basics are pretty easy setup using phpZotero and following this guide: Mashup Guide :: Zotero REST API: early developments.

However, I ran into some problems as the user id could be read by getUserId() but getUserItems() returned an empty item list. I found the solution after analyzing the request URLs: the user id is read using HTTP while all the other functions use HTTPS. So I simply added these two lines to httpRequest() to avoid checking the server certificate: curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

Furthermore, the name of the parameter for the API key is not apiKey but key. So the URL pointing to my bibliography items has to be https://api.zotero.org/users/{USERID}/items/?key={APIKEY} (you don’t need username). Although the API key is passed to phpZotero’s constructor, the class doesn’t use it in any of its HTTP calls, so I added this line to zoteroRequest():
$request .= '?key=' . $this->apiKey;

After theses small changes my items could be read successfully.

PowerShell 2.0: Windows Update KB968930 cannot be installed on Windows XP

Our WSUS server provided my computer with Microsoft Windows Update KB968930 (Windows Management Framework and PowerShell 2.0) but it could not be installed (without giving any helpful error message). After searching the web for quite some time, I found this solution to be working in my case:

  1. Deinstall PowerShell 1.0: Control Panel → Show Windows Updates → Windows PowerShell 1.0 → Remove
  2. Reboot the computer
  3. Install Windows Remote Management
  4. Install PowerShell 2.0
  5. Test installation: Start → Run → powershell → $PSVersionTable:
    PowerShell 2.0
  6. Get rid of the “New updates available” message in the system tray: Start → Run → wuauclt /detectnow

How often are functions returning an array for PHP’s foreach statement called?

Today I was asked a question regarding PHP’s foreach statement: If the array through wich a script iterates is generated by a function, how often is this function called? In this example, will getArray() be called only once or three times?

$c = 0; function getArray() { global $c; echo (++$c) . ". call to " . __FUNCTION__ . "\n"; return array(1, 2, 3); } foreach (getArray() as $e) { echo "ForEach: " . $e . "\n"; }

I didn’t know the answer myself, although I presumed the function gets called only once. Interestingly, the PHP Manual doesn’t say a word about this question.

So, what’s the answer? The function gets called only once, as I suspected. Here’s the output of the code above:

1. call to getArray
ForEach: 1
ForEach: 2
ForEach: 3