Generate readable log from svn repository
Nov 20th
If you want to see, what you have already done for a certain project of your repository, SVN offers you the ability to export the log as a XML-File.
svn log -v --xml https://server.org/svn/project
This will show the log directly in your console. If you prefer the output as a file append
> outfile.xml
If you’d like to have a more human readable output, you can use the following xsl, to transform it to a readable html table:
<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <h2>SVN Log</h2> <table border="1"> <xsl:for-each select="log/logentry"> <xsl:if test="author='USERNAME'"> <tr> <td><xsl:value-of select="date"/></td> <td><xsl:value-of select="author"/></td> <td><xsl:value-of select="msg"/></td> </tr> </xsl:if> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>
Change USERNAME to your svn username and save it to svnstyle.xsl for example.
Now you can use the following command to export and transform the export-xml directly to readable html via:
svn log -v --xml https://server.org/svn/project | xsltproc svnstyle.xsl - > ~/Desktop/svnlog.html
This uses the XSLT-Processor xsltproc, which seams to be preinstalled on a Mac OS X system. But you can replace it with any XSLT-Processor of your choice
The svn command may require username and password – so you may get asked for turing the process.
You can specify a username and password with the parameters –username USERNAME and –password PASSWORD.
But think of the little security issue.
Malicious UIDatePicker
Nov 12th
I used the UIDatePicker a few times already. Mostly in german Apps. I have never had any problems setting the minimum or maximum date properties.
Yesterday we figured out a strange behavior. The App always quit with a “SIGABRT” and the information
-[UIDateTableCell date]: unrecognized selector sent to instance *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIDateTableCell date]: unrecognized selector sent to instance

at following line
self.datePicker.minimumDate = [NSDate date];
And it only crashes if the datePickerMode is UIDatePickerModeDateAndTime
self.datePicker.datePickerMode = UIDatePickerModeDateAndTime;
First try, use the setter Method instead of Dot-notation:
[self.datePicker setMinimumDate:[NSDate date]];
same effect.
As you can’t always rely on the simulator, we tried the code on the device. -> No crash!
First thought: A further Simulator discrepancy.
Tried it on a different Mac in Simulator -> NO CRASH!
So what was the difference between the two systems?
Same XCode Version
Same OS X Version
…
Different System Language!
Changed the language of the device to Language EN, Region US and voila, the App crashes at the expected line.
After a long google session without any hint, we tried some rearrangement of code and put the setting of the pickers date before the setting of the minimumDate.
self.datePicker.minimumDate = [NSDate date]; self.datePicker.date = [NSDate date]:
to
self.datePicker.date = [NSDate date]: self.datePicker.minimumDate = [NSDate date];
Guess what! Now the App runs fine even on the EN_US Simulator and Device!
So you will say: “it’s obvious you must set the pickers date before you can set a minimum date”.
Hm good point, but:
- the API tells you, that even if you omit setting the date explicitly “the default is the date when the UIDatePicker object is created“, so the date property is never nil.
- if the Picker is shown in “german” style the App won’t crash.
If your Picker is created by a nib-File as a IBOutlet, the date can be set in Interface Builder.
A second solution
set the Mode of the Picker in Interface Builder initially to “Date & Time”.

In your code you can change the Mode afterwards via datePickerMode.
self.datePicker.datePickerMode = UIDatePickerModeDate;
But Attention:
Setting the Mode in Interface Builder to “Date & Time” initially will cause the Picker to ignore a minuteInterval programmatically set in code.
So set “Date & Time” in IB -> self.datePicker.minuteInterval = 15; has no effect.
set “Date” -> self.datePicker.minuteInterval = 15; will be recognized (if you also set the Mode to Date & Time programmatically) – but you have to set also date to avoid crashing.
So have fun.
MediaWiki with Google Code Prettify
Oct 27th
To add Googles prettify.js for syntax highlighting to MediaWiki follow the instructions below:
- Download google code prettify
- Rename the containing src folder to code-prettify
- Upload the code-prettify folder (not only the content!) to your MediaWiki installation to the folder “skins”.
-
Edit the file MonoBook.php (if you use another skin, edit the corresponding file) and add the following lines anywhere within the <head>-Element.
<script type="text/javascript" src="<?php $this->text('stylepath') ?>/code-prettify/prettify.js"></script> -
Find the <body>-Element. Usually you will find the following line in the opening tag of the <body>-Element:
<?php if($this->data['body_onload']) { ?> onload="<?php $this->text('body_onload') ?>;"<?php ?>change it to:
<?php if($this->data['body_onload']) { ?> onload="<?php $this->text('body_onload') ?>;prettyPrint();"<?php } else { ?> onload="prettyPrint();" <?php } ?>
Inspired by Richard Nichols How-to: Add Code Syntax Highlighting to MediaWiki