Archive

Archive for the ‘Techie’ Category

Javascript call to close ModalPopupExtender

November 5th, 2009

The AJAX.Net ModalPopupExtender comes with the property ‘CancelControlID’, but what if you want to add multiple cancel controls, or trigger the Modal Popup to close based upon an event?

Simple, you can use the following javascript to fire the close event manually.

$find('ModalPopupExtender_Full_Control_ID').hide();

There, I said it was simple didn’t I?

Techie , , ,

Clientside Repositioning a Modal Popup Extender

October 13th, 2009

When using the built in Modal Popup Extender for Ajax .Net, if you add any data or controls dynamically, you will notice that the Modal Popup has become unaligned or has breached it’s original size. Changing the size through CSS and Javascript is simple, however the position of the Modal Popup cannot be achieved in the same way.

To reposition the Modal Popup alignment, simply call the following function within your javascript. This will force the popup to recenter itself within the page.

$find('ModalPopupID')._layout();

Also, for people’s information, there are different properties for the automatic repositioning of the Modal Popup. These probably are never of use, unless you want to prevent the Modal Popup from realigning automatically.

Reposition Mode:

  • None
  • RepositionOnWindowResize
  • RepositionOnWindowResizeAndScroll
  • RepositionOnWindowScroll

Techie , , ,

New high quality zoom function on fish4flies

July 31st, 2009

Just a quick note. I’ve just released a new version of my fly fishing shop, which enables you to see an even higher res version of all files within the library.

Look at some of these stunning flies for example, just move your mouse over the image to get the zoomed in high res version (some flies take a while to load, but I am working on this)

Personal, Techie

SQL Replication with Port Numbers

January 14th, 2009

Recently I attempted to setup a replication service with SQL server 2008, bound to an alternative port. The publication was setup fine, however when attempting to subscribe to the publication from a remote network, I was coming up with the following error.

Cannot connect to Server_Name,xxxx

Sql Server replication requires the actual server name to make a connection to the server. Connections through a server alias, IP address, or any other alternate name are not supported. Specify the actual server name, ‘Server_Name‘. (Replication.Utilites)

To begin with I thought it was because I was entering the IP address/domain of the remote server; Publications weirdly require the connecting hostname to be the name of the servers computer name, what I can only assume is to tighten security maybe. I initially resolved this by adding the ip and computer name to the ‘hosts’ file located ‘%WINDIR%\system32\drivers\etc\hosts’, however I later found that the error was still occurring.

I looked at the error more closely, and saw that it was showing the server name used in the connection, and also what the server name should be at the end of the message, the difference between these two was the port number. Removing the port number and setting the publication server to the default binding demonstrated that this was indeed the problem, that you cannot establish a subscription by including a connection to a port via appending ‘,1234′ to the hostname.

Solution

Initially this seems to be a rather evil restriction in replication, preventing you to subscribe to publications bound to a non-default port number, however SQL Server does enable aliases to be set. To do this follow the following instructions:

  1. Load up ‘Sql Server Configuration Manager’
  2. Expand ‘SQL Native Client 10.0 Configuration’ (or whichever SQL version you have), and select ‘Aliases’
  3. Right click and select ‘New Alias…’
  4. Under ‘Alias Name’ enter the computer name of the server where the publication is hosted
  5. Fill in the ‘Port No’ and ‘Server’ with the ip address or domain name

This enables you to simply type the alias within the connection details emitting the need to supply a port number.

Techie

Programmer Dvorak

December 29th, 2008

Dvorak is an optimized keyboard layout designed to help reduce the movement of the users fingers resulting in increased typing speed and a reduced strain on the fingers preventing repetitive strain injury.

Computer keyboards do not have the constraints QWERTY typewriters once had, therefore Dvorak was made in 1936 by Dr August Dvorak in order to be the most effective layout. Typewriters had to have a layout as such that when a typist was typing quickly, the hammers wouldn’t jam, thus common keys were at opposite sides of the keyboard.

I started using Dvorak as my primary keyboard layout in 2003, and learned it on a qwerty keyboard without rearranging the keys to force myself straight into touch typing (which is still how I type today). However, as a programmer, I have noticed some very awkward combinations when doing anything other then what typewriters were originally designed for, ie not typing words.

First off, you notice it is not optimized for the web. Typing ‘.’ with the ‘www.’ and ‘.com’, ‘.co.uk’ and ‘@’ symbol is a little awkward, but is still not worth worrying about. Cut, Copy and Paste, ‘x’, ‘c’, ‘v’ are all over the place, so having cut and paste as ‘x’ and ‘v’ become a little meaningless, and you do start to get concerned over pressing ‘ctrl-w’ instead of ‘ctrl-v’ by mistake, which is close window, followed by a lot of annoying retyping or navigation in a browser.

Secondly, as a coder, you notice that certain symbol combinations are actually slow to type, and permanently needs the shift key to be pressed/released causing mega slowness. (However is that much different from qwerty?)

Programmer Dvorak helps the second point, converting the top number row to be primarily symbols, with numbers avalible with the shift key, ordered in odds on the left, evens on the right (the originally Dvorak layout). This is available as an additional driver for windows, linux and mac.

Techie