Archives for the 'Software engineering' Category
Excel NORMDIST Function in VB6
I was converting formulae in Excel to VB6 when I hit a stumbling block: there is no equivalent NORMDIST function in VB6. Fortunately someone had written a NormDist function in C# so it was just a matter of translating C# to VB6. As far as my testing goes it seems to be accurate within seven […]
ActiveWidgets Grid 1.0.2
My client, who is, amongst other things, a freelance civil engineer and a VB6 programmer, asked me to create a web-based version of his standalone Windows application. He wanted nothing less than an exact replica.
How to do a VB6-style ListView in HTML? I searched Google and found ActiveWidgets. Beautiful, they have a Javascript ListView (they […]
IE Progress Bar Loading Forever for Iframe
IE’s progress bar sometimes makes it seem that the page is loading forever when you load a page in an iframe. The following is a workaround for it:
Create a blank.html file in the root web directory. This file need not contain anything.
Create an invisible iframe in your page by setting frameborder=”0″ and style=”height: 0; width: […]
Coding against the DB
If you have to embed SQL in your code, this is how to do it in C#.
Highlights:
the using statement, which is like try-finally
@-quoted string literals
Parameters.AddWithValue(parameterName, value) (new in .NET Framework 2.0)
Coming from an ASP/PHP-MySQL background, it’s great to not have to escape special SQL characters or to enclose varchar values within single quotes.
using System.Data;
using System.Data.SqlClient;
using […]
Polymorphism Explained
Polymorphism is the ability of an object to represent more than one type.
The MSDN Library explains polymorphism quite well. Emphasis mine.
PLAIN TEXT
C#:
public class A
{
// code
}
public class B : A
{
// code
}
"In the example above, class B is effectively both B and A. When you access a B object, you can use [...]