WPF: Check if there are validation errors

I worked on a wpf window containing some controls that were required and that validated the format of the entered data. Once the user pressed a button I wanted to check if there was any validation error and notify the user with an error message. This is how to do it:

Helper class:

Tags:

InnoDB Engine not available in MySQL

I had an empty standard installation of MySQL but somehow I could not create a database using the InnoDB engine. The engine was just not activated (you can check that with the

Tags:

C# Dijkstra

Implementation

Uses the HeapPriorityQueue.
Code on Github

Tags:

C# PriorityQueue with fast Update operation

Implementation

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

Tags:

C# PriorityQueue

Implementation

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

Tags:

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.

Tags:

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

Tags:

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:

Tags:

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
    IS
    BEGIN
      NULL;
    END;
    /
  • 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

@script.sql

Tags:

Pages

Subscribe to uhlme.ch RSS