Javascript: Functions: Remove from string & get url variable

Two handy functions that I had to use recently.

<
//Remove from string


function remove(s, t) {


i = s.indexOf(t);


r = “”;


if (i == -1) return
s;


r += s.substring(0, i) + remove(s.substring(i + t.length), t);


return r;


}



//Get querystring value


function getQuerystring(key, default_) {


if (default_ == null)
default_ = “”;


key = key.replace(/[[]/, “\[“).replace(/[]]/,
“\]”);


var regex = new
RegExp(“[\?&]” + key + “=([^&#]*)”);


var qs = regex.exec(window.location.href);


if (qs == null)


return default_;


else


return qs[1];


}

// –>

Oxite on Codeplex

http://www.codeplex.com/oxite

The team behind Microsoft’s Channel 8/9/10 developer sites has released a new blog/CMS engine named Oxite to Codeplex. Oxite was originally developed for the company’s MIX Online site and, as one might expect, it uses the typical Windows stack of ASP.NET, ASP.NET MVC, and SQL Server. Citing a lack of large-scale ASP.NET MVC samples, Redmond has published the core code under its OSI-approved, permissive open source license, Ms-PL, giving any developer the right to incorporate Oxite into their own blogging or CMS software.

Bothunter

In keeping with all things interesting FreeBSD I recently came across Bothunter.

http://www.bothunter.net/

BotHunter is a passive network monitoring tool designed to recognize the communication patterns of malware-infected computers within your network perimeter. Using an advanced infection-dialog-based event correlation engine (patent pending), BotHunter represents the most in-depth network-based malware infection diagnosis system available today.”

BotHunter is available free for both experimental operational use and to help stimulate research in understanding the life cycle of malware infections.”

It works across a rather broad range of systems, including FreeBSD, and is worth checkingout.

Linux – tested on Fedora, Red Hat Enterprise Linux, Debian, and SuSE distributions
FreeBSD – tested on Product Release 7.0
Mac OS X – tested on Tiger and Leopard, Mac OS 10.4 and 10.5
Windows XP – a self-installing Win32 executable is available and will install all necessary supporting packages
Live-CD – a self-booting ISO image of BotHunter operating on Ubuntu Linux

SmartTools.Charts

Jan Tielens posted a rather nice example for charting with Silverlight in SharePoint 2007 over at: http://weblogs.asp.net/jan/archive/2008/12/04/3d-silverlight-charts-in-sharepoint-smarttools-charts.aspx

In essence he created a component that contains a web part that can show charts rendered by making use of the open source Silverlight control created by Visifire


SmartTools.Charts from Jan Tielens on Vimeo.