inicio mail me! sindicaci;ón

Archive for November, 2006

NDOC for .NET 2.0 Documentation

If you’re looking for clean MSDN-like documentation tool for .NET, NDOC is way to go. Unfortunately development for the tool stopped in Feb 2005. There are a few commercial products as well, but I really was not impressed after playing with a few trials.

The latest release of NDOC version 1.3.1 is only compatible up to .NET 1.1. Microsoft appears to have a new tool for .NET documentation called Sandcastle but after spending an hour of trying to get it setup, time to move on.

I finally found someone who wrote a version compatible with .NET 2.0, NDOC 2.0 Alpha. Despite being an Alpha version, the tool works great, was very familiar and did the job, all for less then 1MB of download.

Screenshot of the application.

Screenshot of output MSDN Chm Help file.

PHP Detect Mobile Browser script

Below is a useful script I used for detecting mobile browsers.

// Detects if browser is mobile or not
$mobile_browser = '0';
if(preg_match('/(up.browser|up.link|windows   ce|iemobile|mmp|symbian|smartphone|midp|wap|phone|vodafone|o2|pocket|mobile|pda|psp)/i',strtolower($_SERVER['HTTP_USER_AGENT']))){
 $mobile_browser++;
}
if(((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'text/vnd.wap.wml')>0) or (strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml')>0)) or ((((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE']) or isset($_SERVER['X-OperaMini-Features']) or isset($_SERVER['UA-pixels'])))))){
 $mobile_browser++;
}
$mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'],0,4));
$mobile_agents = array('acs-','alav','alca','amoi','audi','aste','avan','benq','bird','blac','blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno','ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-','maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-','newt','noki','opwv','palm','pana','pant','pdxg','phil','play','pluc','port','prox','qtek','qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar','sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-','tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp','wapr','webc','winw','winw','xda','xda-');
if(in_array($mobile_ua,$mobile_agents)){
 $mobile_browser++;
}
if($mobile_browser>0){
 //mobile site
}else{
 //not mobile site
 header( 'Location: http://www.web_address.com/' ) ;
}