Notice: Undefined index: HTTP_ACCEPT in /var/local/cache/midgard/midgard/31-100-217-0.php(66) : eval()'d code on line 11

Blog: Archive

2009-01-01 - 2009-12-31

USB finger, more details

Posted on 2009-03-10 19:44:53 UTC to.

As many of you might have already heard from me or various places on the net after my motorcycle accident last year
I got myself a prosthetic USB finger .

After last night when my friend Bergie blogged about this many have contacted me through email and asking if it is true or how can I work while my finger is in the USB or Is it attached straight to my bone, etc.
So I think it is best I'll try to explain some of these here now.

First of all it is not attached permanently in to my body, it is removable prosthetic which has USB memorystick inside it.

 


Secondly when I'm using the USB, I just leave my finger inside the slot and pick it up after I'm ready.

Currently I have Billix , CouchDBX and Ajatus installed inside it.
I'm planning to use the other prosthetic as a shell for the next version, which will have removable fingertip and RFID tag.

I hope this helps some people to better understand what this all is about. 

More pictures on my Flickr photo set.

Mobilephone browser detecting from PHP

Posted on 2009-04-17 07:07:34 UTC to .

While ago friend of me asked for a script to detect if site is browsed with mobile device.
There are lot of these around on the net and here is my contribution to that list.

Hopefully someone else find this usefull also:

 

public function is_mobile($include_iphone_and_ipod=true)
{
$mobile_browser = 0;
$user_agent = $this->get_value('_SERVER', 'HTTP_USER_AGENT');

if (preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone)/i', strtolower($user_agent))) {
$mobile_browser++;
}

if (! $include_iphone_and_ipod) {
if (preg_match('/(iphone|ipod)/i', strtolower($user_agent))) {
$mobile_browser--;
}
}

if ( (strpos(strtolower($this->get_value('_SERVER', 'HTTP_ACCEPT')),'application/vnd.wap.xhtml+xml')>0)
|| (( $this->has_value('_SERVER', 'HTTP_X_WAP_PROFILE')
|| $this->has_value('_SERVER', 'HTTP_PROFILE'))))
{
$mobile_browser++;
}

$mobile_ua = strtolower(substr($user_agent, 0, 4));
$mobile_agents = array(
'w3c ','acs-','alav','alca','amoi','audi','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','oper','palm','pana','pant','phil','play','port','prox',
'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 ( $this->has_value('_SERVER', 'ALL_HTTP')
&& strpos(strtolower($this->get_value('_SERVER', 'ALL_HTTP')), 'OperaMini') > 0)
{
$mobile_browser++;
}

if (strpos(strtolower($user_agent), 'windows') > 0) {
$mobile_browser = 0;
}

if ($mobile_browser > 0) {
return true;
}

return false;
}

Back