Category: Programming
-
Ultimate Google Maps XML JavaScript function
I believe I have come up with the most versatile Google Maps function. Parameters are Dev ID name (devid), XML location (xml), zoom and map type (zoom). To use it you will need to do the following; Script header: DIV in the body: XML in the following form: And the JavaScript code: Example map tgooglemap(example.xml)
-
Simple Ping function VBScript
I was after a ping function that met the following constraints; Didn’t use GetObject. Didn’t display any command (cmd) prompt. Didn’t use a temporary file. Here is what I found; I was looking at a way to timeout the above ping function after 1 second using threading, but this didn’t quite make it so simple.…
-
Decimal to Binary functions in Visual Basic
Here are functions to perform decimal to/from binary conversion. CBin – converts a decimal integer to binary string. CDeci – converts a binary string to decimal integer. CBinS16 – converts a decimal signed integer to 16 bit binary string. CdecS16 – converts a 16 bit binary string to decimal signed integer.
-
SQL Server Quickest way to Insert Multiple Rows with VB
Having to parse huge amounts of data from xml files to an SQL Server database, I needed to greatly optimise my code. Here are some tests to insert 10000 rows into table TABLETESTER. First, using the standard INSERT INTO without specifying column names. TickCount of 70547. Specifying the column names is actually marginally faster. TickCount…
-
Visual Basic 6 – quickest way to find first/last character in string
When you are parsing large amounts of data, the way you code string matching can make a huge difference. In one case I needed to find if a string was contained within quotes, here are the test results from quickest to slowest. The test situation was to find if the last character in the string…
-
Base64/sexatrigesimal encoding/decoding in VBA/VB6/Visual Basic
Here is an implementation of Base 36 enconding/decoding functions is VB6.
-
eventquery.vbs – ERROR: Unable to execute the query for the…
If you received this error when trying to execute eventquery.vbs the cause is an overflow of events past 32,767 (the maximum capacity of a VB6 Integer). There is a very simple fix for this which is to change the data type from an Integer to a Long (which has a maximum capacity of 2,147,483,647). In…
-
PHP Factorial and Combination functions
A quick post on two functions for PHP that provide factorial and combination support.
-
Longest Common Subsequence implemented in VBA (Visual Basic for Applications)
From Wikipedia, The longest common subsequence (LCS) problem is to find the longest subsequence common to all sequences in a set of sequences (often just two). The following is a VBA implementation of this problem. The following functions are included; String functions; longestCommonSubsequence – calculate an LCS array. backTraceUp and backTraceLeft – trace back either…