Category Archives: Web Development

Convert dot net invaders to html5

Convert dot net invaders to html5

UPDATE: Playable

UPDATE: Code Link

So, I wrote a dot net invaders clone and thought that I would try my hand at converting it into an html5 version using canvas, and the same cruddy graphics in the first version. The point of this blog, however, is not about graphics but instead of development. I hacked my way through a simple conversion at the start implementing some of the techniques I presented usage of in the render framework post. Then things turned ugly when I tried to implement inheritance. I was able to actually implement what I desired at first, but found some issues when creating multiple items using the same class seemed to use the same instance for a member object. This was undesireable, but I simply created a new “object” in the “constructor” with the same name and everything worked marvelously.

Continue reading

A Simple Javascript Canvas Render Framework

A Simple Javscript Canvas Render Framework

It is possible to do a great number of things in many different languages, and due to the popularity of the some of the particular features of javascript, it is also possible to do these in javascript. The trick is to figure out what is needed in terms of state, and logic, and provide a looping mechanism to make things happen on a regular basis. The particular thing that I am talking about here is rendering a frame – or essentially drawing a picture.

Continue reading

Mootools Animations without Tween or Morph

Mootools Animations without Tween or Morph

So I found that Tween and Morph did not do what I wanted, and that it would be pretty simple to cook a batch of javascript animation up in no time. The secret to animation is the LOOP. With javascript, you may set up a direct loop, but that would be less then adequate as far as I am concerned. The idea is that you render something, and put a little delay in there to have the render realized.

Continue reading

The System Library ‘GD’ is not registered

The System Library ‘GD’ is not registered

So… It appears that I am not the only one who ran into this issue, and not actually having run into it directly myself, it was a little tricky to get to the root of the problem. In case you have no idea what I am talking about, I am talking about Miva Merchant and libGD configuration. Specifically when you upgrade Miva Merchant there can be an issue.

Continue reading

Halloween is coming – Halloween javascript

Halloween is coming

Halloween is fast approaching with us being over half the month through. Check out this little javascript which animates three ghost images in the screen swooping them and fading them out. This script is simple enough to understand and implement for yourself or by a beginner developer. Of course the image assets would need to be on your site as well. Follow this link to have a quick look. This script is easily probably of the simpler scripts I have seen and check back from now to halloween for more.

Javascript and PHP Size Based Styles

Javascript and PHP Size Based Styles

So you want to support different screen resolutions do you? Well, it is possible too much difficulty by creating a multiplexer for CSS files. This solution I am speaking about involves creating several style sheets for popular screen resolution groups and a cookie to save the information and redirecting when the cookie is not set. This solution should be handled with care as cookies are not always supported and could create and endless redirect.

Continue reading

PHP SNI Switch for HTTPS WINXP IE

PHP SNI Switch for HTTPS WINXP IE

A possible solution to an Error page for HTTPS SNI in WinXP Internet Explorer

Although this is not the best way to treat this situation, it is possible to have a switch for the Internet Explorer XP Browser in order to treat it specifically when hosting multiple sites with one ip and https. For those of you looking for the answer:

Continue reading

Html Form Editing Embed Form Elements

Html Form Editing Embed Form Elements

We have a demo up at http://www.swhistlesoft.com/demo/edithtmlforms/ which you may of course take a look at. There are some bugs and we will be posting a more complete demo in the near future. You can also check out other demos by going to:

http://www.swhistlesoft.com/demo/demolist

As we update and add demos, this list will be automatically updated.

MySQL Singleton Class to allow easy and clean access to common mysql commands

The MySQL Database class is implemented using the singleton design pattern. This design pattern allows for only one single instance of the object. This one instance can then be obtained through a static method. This provides a convenience in that you can get your database object from anywhere in your code.
Continue reading

Database PHP Session Handling

Database PHP Session Handling

As you should be aware the HTTP protocol, as used for serving web pages, is completely stateless. This means that after the server has received a request, processed it and sent a response, the process which dealt with that request dies. Anything that the process had in its memory therefore dies with it, so when a subsequent request is received from the same client it is unable to refer to its memory about anything that happened previously.
Continue reading

A JQuery Print Library that fixes the IE7 Shrink-to-Fit issue

There is an option in most browsers called “Shrink-to-Fit”. This is a page setup configuration that, if turned on, will attempt to scale the web page in size to make it fit on the selected paper size you are printing to. The scaling mechanism also attempts to scale it to a size that will fit on the least amount of pages. Although this does make sense when you are trying to print an actual web page, it can be a nightmare for web application developers who are trying to control the print job. For example, say your web application produces a Invoice for a customer. As a developer you want to try to control the layout of the invoice so you probably have a print.css file and you already have taken into account the page layout specific for a print job.
Continue reading

Where to find sos.dll

Where to find sos.dll

If you are looking where to find sos.dll, please check the following locations before you download windebug tools:

C:\Windows\Microsoft.NET\Framework\v2.0.50727
C:\Windows\Microsoft.NET\Framework\v4.0.30319

For Details on why this may be missing in other framework versions see:

This post

Continue reading

Adding events to iframe javascript

Technically it is possible to add events to an iframe but there are some caveats especially in terms of browser compatibility. for starters what I have found is that you can use the window object if you are trying to attach to events such as blur, drop, and mouse or keypress.

	ifrme = document.getElementById ( 'ifrme');
	if ( typeof ( ifrme.contentDocument ) != "undefined" ){
		var win = ifrme.contentWindow||iframe.defaultView;
		var doc = win.document;
		win.addEventListener ( "blur",function(){
			alert ( "blur");
		},false);
	}

More to come soon

JQuery UI Draggable – data(…)options is null or not an object in IE7

I was working on a project that allows the users to create a list of names in their account. They could then take a name from the global list and drag it to a recipients list to send a mass email to everyone in that list. To accomplish this task and make it look good I decided to go with the great JQuery UI library’s (draggable and sortable to b specific).

Continue reading

Disappearing JSTree when using Themeroller

I am currently working on a project that utilizes a MySQL Nested Folder database design and a JQuery component called JSTree. The implementation actually works great. The system allows users to create “folders” for content and provides the ability to Drag and Drop to move folders, create new folders and sub-folders, etc.

After entering the testing phase of the project we discovered that the folder tree view, powered by JSTree, was not working. The tree would load on the page and then disappear. I spent a solid 12 hours trying to debug what the issue was because it works flawlessly in IE8, IE9, Fire Fox, Chrome, Safari, and Opera. This problem seemed to be isolated to IE7 only. I flipped flopped between potential causes several times — could it be a Javascript issue? could it be a CSS issue? could it be both?

Continue reading

Javascript Character Classes

I have put together the beginnings of a javascript character class script. The idea was to create a testing platform and the build the character class handler at the same time. Starting off as a need to build a scanner/parser I was looking for some functions to give me IsDigit, IsAlpha, IsDigitAlpha and other similar functions.
Continue reading

Javascript Object Oriented Ideas

Good article on Javascript Object Oriented Ideas

If you are looking to do some “strange” things with javascript Object Oriented programming, then check out: this article. There is a lot of information on creating things like static functions, singletons, private/public functions and properties. These object oriented ideas are not 100% the same as in other languages but the results are as close to the real thing as you may need.

Bing Maps Static Maps API

Before Getting Started make sure to obtain an API key from: http://msdn.microsoft.com/en-us/library/ff428642.aspx

If you wished you could retreive Bing Maps static images for a specific location, your wait is over. I am not sure when the Bing Maps Static API offering became available but I do know that it works. The API is broken up into  several sections to make it easier to find what you are looking for.


The first section of the entire Bing Maps Static API properly named “Bing Maps REST Services API” is the Locations API which may be used to retreive information based on a location such as street address. The format of the returned data may be in JSON or XML and may be controlled with the Output Parameters found in the Common Parameters and Types. To test it out, put the following in your brower address bar:

http://dev.virtualearth.net/REST/v1/Locations/CA/Ontario/M5V2T6/Toronto/301 Front St W?key=

and add your own key to the end of the line

When the browser returns you should by default get a json string similar to the following:

{
    "authenticationResultCode":"ValidCredentials",
	"brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",
	"copyright":"Copyright © 2011 Microsoft and its suppliers. All rights reserved... ( see actuall result )",
	"resourceSets":[{
	    "estimatedTotal":1,
		"resources":[{
		    "__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",
			"bbox":[43.640018282429324,-79.3961907073811,43.647743717570677,-79.381957292618893],
			"name":"301 Front St W, Toronto, ON, M5V2T6",
			"point":{
                "type":"Point",
				"coordinates":[43.643881,-79.389074]
		    },
			"address":{
			    "addressLine":"301 Front St W",
				"adminDistrict":"ON",
				"countryRegion":"Canada",
				"formattedAddress":"301 Front St W, Toronto, ON, M5V2T6",
				"locality":"Toronto",
				"postalCode":"M5V2T6"
			},
			"confidence":"High",
			"entityType":"Address"
		}]
	}],
	"statusCode":200,
	"statusDescription":"OK",
	"traceId":"...(See Actuall Result)"
}