Search

Friday, September 19, 2008

Hex to int VS int to hex

public class Try
{
public static void main(String[] args)
{
System.out.println(Integer.toHexString(4500));
System.out.println(Integer.parseInt(Integer.toString(1194), 16));
}
};

Sunday, September 14, 2008

javascript remove array item



function removeVal(arr, valToRemove){
// Normalize to a string like !val!!val!!val!
var s = '!' + arr.join('!!') + '!';
// Remove targeted values with delimiters
s = s.replace(new RegExp('!' + valToRemove + '!', 'g'), '');
// Remove delimiter added to end in step 1
s = s.replace(/^!/, '');
// Remove delimiter added to start in step 1
s = s.replace(/!$/, '');
// Convert to array
return s.split('!!');
}

function test(){
var arr = [2,1,2,2,5,7,12,15,21,2]; // Check case with end vals
var s = arr.toString();
arr = removeVal(arr, 2)
alert(s + '\n' + arr.toString());
}




source : http://webdevel.blogspot.com

Saturday, September 13, 2008

javascript search string


<html>
<body>

<script type="text/javascript">

var str="Hello world!";

document.write(str.search("world") + "
");
document.write(str.search("World") + "
");
document.write(str.search("woorld") + "
");

</script>

</body>
</html>




If string for search certain in source in search string it return index of position

Friday, September 5, 2008

join

join function is easy to use concate string from array.

example

<php
$array = array('lastname', 'email', 'phone');
$comma_separated = join(",", $array);

echo
$comma_separated; // lastname,email,phone

?>


(php4, php5);

Tuesday, September 2, 2008

PHP Framework comparison

Framework PHP4 PHP5 MVC Multiple DB's ORM DB Objects Templates Caching Validation Ajax Auth Module Modules EDP
Akelos Akelos Support PHP4 Akelos Support PHP5 Akelos Support MVC Akelos Support Multiple DB Akelos Support ORM Akelos Support DB Objects Akelos Support Templates Akelos Support Caching Akelos Support Validation Akelos Support Ajax Akelos Support Auth Module Akelos Support Modules -
ash.MVC - ash.MVC Support PHP5 ash.MVC Support MVC - - ash.MVC Support DB Objects ash.MVC Support Templates - ash.MVC Support Validation - ash.MVC Support Auth Module ash.MVC Support Modules -
CakePHP CakePHP Support PHP4 CakePHP Support PHP5 CakePHP Support MVC CakePHP Support Multiple DB CakePHP Support ORM CakePHP Support DB Objects - CakePHP Support Caching CakePHP Support Validation CakePHP Support Ajax CakePHP Support Auth Module CakePHP Support Modules -
CodeIgniter CodeIgniter Support PHP4 CodeIgniter Support PHP5 CodeIgniter Support MVC CodeIgniter Support Multiple DB - CodeIgniter Support DB Objects CodeIgniter Support Templates CodeIgniter Support Caching CodeIgniter Support Validation - - - -
DIY - DIY Support PHP5 DIY Support MVC - DIY Support ORM DIY Support DB Objects DIY Support Templates DIY Support Caching - DIY Support Ajax - - -
eZ Components - eZ Components Support PHP5 - eZ Components Support Multiple DB - eZ Components Support DB Objects eZ Components Support Templates eZ Components Support Caching eZ Components Support Validation - - - -
Fusebox Fusebox Support PHP4 Fusebox Support PHP5 Fusebox Support MVC Fusebox Support Multiple DB - - - Fusebox Support Caching - Fusebox Support Ajax - Fusebox Support Modules -
PHP on TRAX - PHP on TRAX Support PHP5 PHP on TRAX Support MVC PHP on TRAX Support Multiple DB PHP on TRAX Support ORM PHP on TRAX Support DB Objects - - PHP on TRAX Support Validation PHP on TRAX Support Ajax - PHP on TRAX Support Modules -
PHPDevShell - PHPDevShell Support PHP5 - - - - PHPDevShell Support Templates - - PHPDevShell Support Ajax PHPDevShell Support Auth Module PHPDevShell Support Modules -
PhpOpenbiz - PhpOpenbiz Support PHP5 PhpOpenbiz Support MVC PhpOpenbiz Support Multiple DB PhpOpenbiz Support ORM PhpOpenbiz Support DB Objects PhpOpenbiz Support Templates - PhpOpenbiz Support Validation PhpOpenbiz Support Ajax PhpOpenbiz Support Auth Module - -
Prado
- Prado Support PHP5 Prado Support MVC Prado Support Multiple DB Prado Support ORM Prado Support DB Objects Prado Support Templates Prado Support Caching Prado Support Validation Prado Support Ajax Prado Support Auth Module Prado Support Modules Prado Support EDP
QPHP QPHP Support PHP4 QPHP Support PHP5 QPHP Support MVC QPHP Support Multiple DB - QPHP Support DB Objects QPHP Support Templates - QPHP Support Validation QPHP Support Ajax QPHP Support Auth Module QPHP Support Modules QPHP Support EDP
Seagull Seagull Support PHP4 Seagull Support PHP5 Seagull Support MVC Seagull Support Multiple DB Seagull Support ORM Seagull Support DB Objects Seagull Support Templates Seagull Support Caching Seagull Support Validation - Seagull Support Auth Module - -
Symfony Project - Symfony Project Support PHP5 Symfony Project Support MVC Symfony Project Support Multiple DB Symfony Project Support ORM Symfony Project Support DB Objects - Symfony Project Support Caching Symfony Project Support Validation Symfony Project Support Ajax Symfony Project Support Auth Module Symfony Project Support Modules -
WACT WACT Support PHP4 WACT Support PHP5 WACT Support MVC WACT Support Multiple DB - WACT Support DB Objects WACT Support Templates - WACT Support Validation - - WACT Support Modules -
WASP - WASP Support PHP5 WASP Support MVC - - WASP Support DB Objects WASP Support Templates - WASP Support Validation WASP Support Ajax WASP Support Auth Module WASP Support Modules -
Zend - Zend Support PHP5 Zend Support MVC Zend Support Multiple DB Zend Support ORM Zend Support DB Objects - Zend Support Caching Zend Support Validation - Zend Support Auth Module Zend Support Modules -
ZooP ZooP Support PHP4 ZooP Support PHP5 ZooP Support MVC ZooP Support Multiple DB - ZooP Support DB Objects ZooP Support Templates ZooP Support Caching ZooP Support Validation ZooP Support Ajax ZooP Support Auth Module - -

  • MVC: Indicates whether the framework comes with inbuilt support for a Model-View-Controller setup.
  • Multiple DB's: Indicates whether the framework supports multiple databases without having to change anything.
  • ORM: Indicates whether the framework supports an object-record mapper, usually an implementation of ActiveRecord.
  • DB Objects: Indicates whether the framework includes other database objects, like a TableGateWay.
  • Templates: Indicates whether the framework has an inbuilt template engine.
  • Caching: Indicates whether the framework includes a caching object or some way other way of caching.
  • Validation: Indicates whether the framework has an inbuilt validation or filtering component.
  • Ajax: Indicates whether the framework comes with inbuilt support for Ajax.
  • Auth Module: Indicates whether the framework has an inbuilt module for handling user authentication.
  • Modules: Indicates whether the framework has other modules, like an RSS feed parser, PDF module or anything else (useful).
  • EDP: Event Driven Programming.New!

source : http://www.phpframeworks.com/