Archive for November, 2007

Notes on 70-528 Web-based Client Developement

||XML|| XML-element collection is 1-based. XML-attribute collection is 0-based. When accessing nodes in a XML-document, first create a DocumentElement like so: [code language=c#] // create document XmlDocument doc = new XmlDocument(); doc.LoadXml(\"10\"); // create document-element to get access to the root element XmlNode node = doc.DocumentElement; node.RemoveChild(node.FirstChild); ||Database (SQL)|| SqlBulkCopy only works when the destination [...]

More »

Setting default working directory in Erlang shell under Windows

When you are using Erlang on Windows, use the following snippet to automatically set your working directory every time the Erlang shell starts. io:format(\”Consulting .erlang in ~p~n\”, [element(2, file:get_cwd())]). %% Edit directory where you store your projects c:cd(\”d:/projects/programming/erlang\”). io:format(\”Now in ~p~n\”, [element(2, file:get_cwd())]).

More »

A word from our sponsors

More »

The breakpoint will not currently be hit. No executable code is associated with this line.

This one bugs me now! Googling this error gets quite a few results, alas none of which solve my specific situation.||History|| Untill this afternoon debugging worked fine on my developement laptop. Just now, after setting a new breakpoint and hitting F5, I get the above error. While building the project (F5), the _Output_ window started [...]

More »

A first chance exception of type ‘System.FormatException’ occurred in mscorlib.dll

I got this message in the _Output_ window of Visual Studio 2005 when debugging my web project. The initial problem was that my breakpoint no longer got hit, see the related article about that._A first chance exception_ usually points to a debugger level error. Because there is no stacktrace info about the origin of the [...]

More »

Datatypes in Erlang

A short overview of available datatypes in Erlang.[note title=Please note] This is not ment to be a comprehensive list, it mearly serves as a reminder for me. [/note] Variable names _must_ start with a capital. ||Integers|| 1>X = 10. 10 ||Floating numbers|| 1>Y = 10.0. 10.000 ||Strings|| 1>Name = \”Hello\”. \”Hello\” Strings are shorthands for [...]

More »

My first Erlang module

A module in Erlang is comparable to a class in C# or java. Here is my first, very basic, module. It calculates the area of a rectange and a circle. -module(geometry). -export([area/1]). area({rectange, W, H}) -> W * H; area({circle, R}) -> 3.14159 * R * R. So what happens here? The first line defines [...]

More »

Recursively copy files and directories (vb)

Just came across this handy snippet. C# translation should be simple enough. Happy coding![code language=vb] ''' ''' Copies the files. ''' ''' The source. ''' The destination. Private Sub CopyFiles(ByVal source As DirectoryInfo, ByVal destination As DirectoryInfo) Dim nextDestination As DirectoryInfo If Not Directory.Exists(destination.FullName) Then Directory.CreateDirectory(destination.FullName) End If ' copy files For Each fi As [...]

More »