This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Written by Jeffrey Katcher under contract to Network Appliance. | |
Copyright (C) 1997-2001 | |
Network Appliance, Inc. | |
This code has been successfully compiled and run by Network | |
Appliance on various platforms, including Solaris 2 on an Ultra-170, | |
and Windows NT on a Compaq ProLiant. However, this PostMark source | |
code is distributed under the Artistic License appended to the end | |
of this file. As such, no support is provided. However, please report | |
any errors to the author, Jeffrey Katcher <[email protected]>, or to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class HashableWeakRef<T> : IEquatable<HashableWeakRef<T>> where T : class | |
{ | |
private int hash; | |
private WeakReference weakRef; | |
public T Target { get { return (T) weakRef.Target; } } | |
public HashableWeakRef(T target) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* IE 7-9 don't trigger the onchange event when the user uses autocomplete. | |
* Extend the jQuery change event to fill in that trigger. | |
*/ | |
(function($) { | |
// Keep the old change function around for later | |
var oldchange = $.fn.change; | |
$.fn.change = function(handler) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tests the ipAddress string and returns whether it's unicast or multicast. | |
function getNetworkMode(ipAddress) { | |
if(ipAddress.contains(':')) { | |
// IPv6 | |
if(/^ff\w{2}:/i.test(ipAddress)) | |
return "Multicast"; | |
return "Unicast"; | |
} |