Huge Pine USB to Serial Ports Driver

June 17th, 2009

Looking for the Huge Pine USB to Serial Ports driver?

Setup_For_HugePine.exe

Install, then connect your USB device and chose to automatically search for driver.

Bookmark and Share

Optimizing/faster String Concatenation in VBA

June 9th, 2009

There are numerous links about Visual Basic string concatenation, one particular is Microsoft’s How To Improve String Concatenation Performance. But the article is overwritten for the point it is trying to make, so I will share a simplified example.

Lets say we want to perform the following concatenation:

Dim i As Long
Dim s As String
For i = 1 To 100000000
	s = "A" & i & "B"
Next i

This takes approximately 6000 ticks. The faster approach, yet more complex functionality would be as follows:

Dim sourceLength As Long
sourceLength = 1
Dim source As String
s = "A B"

Dim i As Long
Dim s As String
For i = 1 To 100000000
	source = CStr(i)
	If Len(source) > sourceLength Then
		sourceLength = Len(source)
		s = "A" & Space$(sourceLength) & "B"
	End If
	Mid$(s, 2, sourceLength) = source
Next i

Which takes approximately 3700 ticks, a saving of nearly 40%.

Bookmark and Share

Altrex Light Skinz – the worst product

May 29th, 2009

I would like to share my experience with Altrex Light Skinz, a product when applied will allegedly protect a car’s headlights from rocks and stones.

As I planned to drive from Perth to Melbourne, I was after some headlight protection for the Hyundai Tucson. I purchased Altrex Light Skinz due to their claim of providing better protection than the common plastic clip-on equivalent, claiming ’simple and easy to fit’, claiming ‘completely invisible once fitted’ and being about half the price ($40 AUS) of the common plastic clip-on equivalent.

I cleaned the headlight glass before applying to make sure it was free of any dirt, as per instructions. Given that the Hyundai Tucson has curved headlights I let the glass heat up with the headlights for a little while, also as per instructions.

Here are some before shots of the Hyundai Tucson’s right and left headlights.
Light Skinz Right BeforeLight Skinz Left Before

And now some after shots after applying Altrex Light Skinz on the right and left headlights.
Light Skinz Right AfterLight Skinz Left After

Even after following these instructions, Altrex Light Skinz are not ’simple and easy to fit’ and are definitely not ‘completely invisible once fitted’. I am going to quote their FAQ with actual information based on my experience. Hopefully, this port will prevent people unsure of Altrex Light Skinz from wasting their money.

How easy are they to fit? Will I be able to fit them myself?
They are not easy to fit; you will be able to fit them yourself but will not be happy with the results.

How can I fit Altrex Light Skinz to a curved headlight? Are Altrex Light Skinz and Body Skinz easy to fit?
No and No. It just doesn’t make sense that a flat skin will fit over a curved headlight. Try getting a piece of paper and fitting it around a ball, how many crinkles do you get?
You can cut a “V-shape” but then you have a slit down one side.
You can cut the template into 2 pieces but then you have 2 slits down the side.

Can I remove Altrex Light Skinz and Body Skinz later if I decide to?
No. on removal of Altrex Light Skinz you will be left with a sticky glue to remove which is insoluble in soapy/hot water.
You will be able to remove all the glue by slowly peeling it from the edges working towards the centre with using your thumb.

Why are Altrex Light Skinz better than the old acrylic-style headlight protectors?
Light Skinz are not completely invisible once fitted. If you think you will be able to apply Light Skinz without leaving a crease, bubble, or smudges, then think again.

How can I ensure a perfect fit for my Altrex Skinz Protection?
You won’t be able to.

If I don’t put them on straight, can I take them off to adjust?
No, If you remove the Light Skinz to adjust the glue will be smudged and on reapplying your smudge will be permanent.
If they are not correctly fitted the first time, too bad.

What can I do about air bubbles?
And yes there will be air bubbles, and given it is also under Frequently Asked Questions must be a frequent problem.
The instructions suggest pricking the air bubble with a needle. Using this technique will only remove the air in the air bubble not the bubble itself.

Bookmark and Share

Fake/Counterfeit Canon NB-4L batteries

April 16th, 2009

I thought I would share my experience regarding fake Canon NB-4L batteries. Let me start by saying I own a Canon IXUS 55, with the girlfriend owning a Canon IXUS 40 both using the Canon NB-4L Battery. I have purchased two spare batteries from eBay, with one of the purchased batteries looking to be fake.  The following photos show the four batteries with the differences circled in red and reasons for this belief.

Firstly, a front photo of the four batteries, the lower right battery is the fake. Circled in red is a single linear indent on the fake battery whilst the real batteries have two linear indents. The text on the fake is also quite blurry.

Front photo of the four batteries, the lower right battery is the fake

Secondly, a back photo of the four batteries, the lower right battery is again the fake and again the single indent can be observed on the fake. Circled in red is the caution text which again is blurry. It can be observed that the words on each battery are different, and hence I believe is not a good indication to its authenticity.

Back photo of the four batteries, the lower right battery is again the fake

Lastly, a isometric view of the four batteries, the lower battery is the fake. Circled in red is a little rectangle, with the genuine batteries having a rectangle piece of plastic stuck on while missing on the fake battery. This would have been to save on manufacturing costs.

Isometric view of the four batteries, the lower battery is the fake

There are other differences, but those above are the most obvious. Click on the above images to display high resolution photos.

Bookmark and Share

thydzik Google Map v1.4.7 – inline Wordpress Google Maps

April 15th, 2009

I have released an updated version of thydzik Google Map which allows for colored and variable text markers, see the example below.

Unfortunatley, it now requires FreeType being compiled into PHP. If FreeType is not installed only the default marker and markers A-Z will be useable, with anything else being replaced with the default marker.

Download the latest from the WordPress Plugin Directory.

Bookmark and Share

Dynamic Google Maps markers/icons with PHP

March 26th, 2009

I am a avid fan of Google’s Map API, have even have created my own WordPress Google Maps plug-in (thydzikGoogleMap), but one feature that I find lacking are customisable markers, with the need to include an image file for every customisable marker, now if you want a selection of colours and labels this creates a huge image database.

Google has gone in the write step their MapIconMaker allowing very customisable markers using the Charts API marker output. But why not take this a step further and add dynamically generated text as well.

Hence, I provide a little demo of some PHP code that does this that I quickly whipped up. Here are some example markers:
DefaultAZ110PQ69%BEΩ$
(Have a look at the image name)

Now that gets a little boring, how about some color:
DefaultAZ110PQ69%BEΩ$
(Again, have a look at the image name)

Unfortunately, not all symbols work (not sure why, even though they are in the font) and if the symbol doesn’t work it will default to the default bullet (this is done with a modified font file).

Also there may be an issue with alignment. All main characters 0-9 and A-Z; I have added manual offsets, this could be improved.

You will need to download the modified arial font and host it in the same directory.

Update: it looks like in Internet Explorer the transparencies are incorrectly displayed, this is not the case when displayed on a Google Map.

Have a look at the PHP source code below:

<?php
 $color = $_GET['color'];
 if (!$color) {$color = "ff776b";} //default google map color
 $color = str_replace("#", "", $color);
 $string = $_GET['text'];

 //some smarts to prevent hotlinking
 if (!stristr($_SERVER['HTTP_REFERER'], "thydzik.com")) {
 $string = chr(169);
 }
 $font = 'arial';

 //unfortunately we still must do some offsetting
 switch (ord(substr($string,0,1))) {
 case 49: //1
 $offset = -2;
 break;
 case 55: //7
 $offset = -1;
 break;
 case 65: //A
 $offset = 1;
 break;
 case 74: //J
 $offset = -1;
 break;
 case 84: //T
 $offset = 1;
 break;
 case 99: //c
 $offset = -1;
 break;
 case 106: //j
 $offset = 1;
 break;
 }
 if (strlen($string) == 1) {
 $fontsize = 10.5;
 } else if (strlen($string) == 2) {
 $fontsize = 9;
 } else {
 $fontsize = 10.5;
 $offset = 0; //reset offset
 $string = chr(149);
 }

 $bbox = imagettfbbox($fontsize, 0, $font, $string);
 $width = $bbox[2] - $bbox[0] + 1;
 $height = $bbox[1] - $bbox[7] + 1;

 $image_name = "http://chart.apis.google.com/chart?cht=mm&chs=20x34&chco=$color,$color,000000&ext=.png";
 $im = imagecreatefrompng($image_name);
 imageAlphaBlending($im, true);
 imageSaveAlpha($im, true);
 $black = imagecolorallocate($im, 0, 0, 0);

 imagettftext($im, $fontsize, 0, 11 - $width/2 + $offset, 9 + $height/2, $black, $font, $string);

 header("Content-type: image/png");
 imagepng($im);
 imagedestroy($im);
?>
Bookmark and Share

thydzik Google Map version 1.4.6.1

March 13th, 2009

Latest offering has cleaned up JavaScript, improved error handling, improved RoboGEO handling of XML, but main features are.

  • Icons now support letters ‘A’ to ‘Z’.
  • Non clickable markers if no ‘html’ element is present.

In the below example Marker Z is not clickable.

Download the latest from the WordPress repository.

Bookmark and Share

SigmaTel High Definition Audio Codec driver for Windows XP

February 5th, 2009

Looking for the following Windows XP driver; SigmaTel High Definition Audio Codec?

This driver goes by the following Vendor ID 8384, Device ID 7661 (ven_8384&dev_7661), used in the Sony Vaio laptop series, particularly the VGN-FE30B.

This driver will also fix the following driver problem Device Cannot Start (Code 10).

SigmaTel Audio Driver v5.10.5067.0

Bookmark and Share