C# Dijkstra


Uses the HeapPriorityQueue.
Code on Github


C# PriorityQueue with fast Update operation


Uses a heap for fast retrieval of the smallest element as well as a dictionary for a fast access to an element which is already in the data strucutre. This priority queue is not too bad for implementing a Dijkstra (a fibonacci heap would be perfect...).
Code on Github


C# PriorityQueue


It is a simple implementation of a priority queue which is based on a SortedDictionary. This makes the implementation quite small.
Code on Github


Oracle: Exporting/Importing tables containing CLOB data

Exporting the table using SQLWorkbench

Imagine you have a table images with a character column filename and a clob column image_data

First you need to install the SQL-Workbench. Install does just mean to extract the archive in that case.

The following command exports the table into a textfile. It does also generate the loader file which can be used with sqlldr. The CLOB data is exported as files with the name image_data_0, image_data_1, ... and will be in the same directory. Those files are referenced in the textfile.


Adjust Exif time of pictures

Sometimes after you come home from holidays you realize that you forgot to adjust the time of your digital camera. So all pictures might have a wrong date and/or time in the exif header. Fortunately it is pretty easy to fix that with linux:

jhead -ta10:11 *

=> Adds 10 hours and 11 minutes to the exif datetime of all files (that have exif headers) in the current folder

jhead -ta-10:11 *

=> Subtracts 10 hours and 11 minutes from the exif datetime of all files (that have exif headers) in the current folder


C# WPF Databinding

Databinding in General

If it doesn't work check:

  • You can just bind to a property. Check that you are not binding on a field

Databinding for ContextMenus in General

ContextMenus in WPF are somehow special. They exist outside the visual tree of the parent control and therefore they are unable to find for example the root element by name. In the following example the binding doesn't work:

C# Disable JavaScript error in WebBrowser control

When using the WebBrowser control and loading a html page it is possible that a message appears that there is a javascript error. This is especially the case if the webpage has been saved from the web and is then displayed on a computer which is offline. Unfortunately there is no property on the browser control which can be used to suppress this kind of error. It is however possible to inject a script tag in the header of an loaded html-file which does catch all errors. Therefore no message will be displayed. You can use the following snippet:


Oracle Collection of Useful Stuff

General pitfalls

  • Every statements should be ended with ;
  • Create Procedure statements shall be ended with a ; and a / on the next line like:
    create or replace
    PROCEDURE ExampleProc
  • Identifiers shall have a maximum of 30 characters, otherwise the code using them fails

Output text from within a script

PROMPT "text"

Execute content of another file



Mount dm-crypt/LUKS encrypted filesystem and rewrite Grub Bootloader

If Linux (after an update) doesn't boot up anymore it might be necessary to boot into the installation using some distribution which can be booted from a cd/usb-drive (p. x. Ubuntu). The first step would then be to load the encrypted installation and maybe to rewrite the grub bootloader. The following commands can be used to do so:

cryptsetup luksOpen /dev/sda1 dm-0 mount /dev/mapper/dm-0 /mnt/temp
grub-install -- root-directory /dev/sda


Repair defect video files

I have a DS1511+ which supports DLNA/UPnP and acts as a server. On the other side I have a blueray player Sony BDP-S480 as receiver. This setup enables me to watch movies from the Diskstation on the television. But sometimes it would start playing a movie but after a while it would just stop. I check some files and found out that they were defect. Here are some commands that can be used to fix them:


Subscribe to uhlme.ch RSS