La empresa Kentico software anunció una muy interesante iniciativa llamada “Tree for Bugs”. Según explican en un comunicado de prensa, van a plantar un arbol por cada bug que tenga su software. Bien por la ecología y tambien por la estrategia de marketing que han tenido. Personalmente como programador, podria colaborar con miles de bugs desinteresadamente.
Kentico Software, the Web content management system vendor, today announced it will plant a tree for every bug found in the latest version of Kentico CMS for ASP.NET. The company also promises to fix all reported bugs within 7 days.
Nashua, NH (PRWEB) August 30, 2009 — Kentico Software will plant a tree for every bug in Kentico CMS 4.1 reported by clients and it al”We are very confident about the quality of our Web Content Management platform. Although we can hardly eliminate all bugs, our goal is to minimize their number and fix them within 7 business days, so that we can provide a stable and reliable solution to our clients,” explains Petr Palas, Kentico CEO. “We want to encourage our clients to report all bugs they encounter. And we decided to give back something that everyone on the planet will benefit from – new trees,” he adds.
“We are very confident about the quality of our Web Content Management platform. Although we can hardly eliminate all bugs, our goal is to minimize their number and fix them within 7 business days, so that we can provide a stable and reliable solution to our clients,” explains Petr Palas, Kentico CEO. “We want to encourage our clients to report all bugs they encounter. And we decided to give back something that everyone on the planet will benefit from – new trees,” he adds.
“Kentico is great to work with; it’s a reliable and stable CMS that has been developed using best practice techniques and is thoroughly tested.” said Andy Dale, Senior Web Developer at Last Exit, the leading interactive agency in London, U.K. “As version 4.1, it is a mature product with the features and a level support that has helped us to deliver a wide range of successful websites.”
The company will publish photos of the planted trees in December. They will plant at least 100 trees, although they expect that the number of reported bugs will be much lower. All information about the initiative is available at http://trees.kentico.com.
Buscando información sobre algún IDE para programar en Python, llegue a wingware.com, un editor que me ha gustado mucho. Soy muy nuevo en el mundo Python, quizás sea un IDE muy conocido, pero bueno, les dejo el link para los que lo quieran probar.
El viejo y querido FCKEditor ha mutado en CKEditor, con un cambio estético y nuevas funcionalidades. He probado la nueva version y funciona muy bien, además que el diseño es muy bonito. Pero la mala noticia es que ahora es bajo licencia comercial! y no es nada barato…
Hace un par de días necesitaba para un proyecto, que determinados clientes puedan acceder a las bases de datos del servidor, desde si mini panel en el sitio web. Encontre esta clase que me ayudo bastante.
/**
* Name: cPanel Database Class
* Version: 1.0
* Author: The HungryCoder
* Contact: thehungrycoder@gmail.com
* Homepage: www.hungrycoder.xenexbd.com
*/
class cpanel_db {
protected $cpdomain;
protected $cpuser;
protected $cppass;
protected $cptheme;
private $error;
public $callresult;
function __construct($cpdomain,$cpuser,$cppass,$cptheme='x3'){
$this->cpdomain = $cpdomain;
$this->cpuser = $cpuser;
$this->cppass = $cppass;
$this->cptheme = $cptheme;
}
private function callUrl($urlsuffix){
if(empty($urlsuffix)) return $this->error('URL is empty');
$url = "http://".$this->cpdomain.":2082/frontend/".$this->cptheme.$urlsuffix;
$this->callresult=''; //reset
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "$this->cpuser:$this->cppass");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($ch, CURLOPT_VERBOSE , 1 );
$this->callresult = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
return $info;
}
/**
* Create Database
*
* @param string $dbname
* @return boolean
*/
public function createDb($dbname){
$suffix = "/sql/addb.html?db=$dbname";
//return $this->callresult;
$this->callUrl($suffix);
return $this->isSuccess('db');
}
public function createUser($username,$pass){
$suffix = "/sql/adduser.html?user=$username&pass=$pass&pass2=$pass";
//return $this->callresult;
$this->callUrl($suffix);
return $this->isSuccess('user');
}
public function grantPriv($db,$user){
//prepare the params
$params = "db=$db&user=$user&update=&ALL=ALL&SELECT=SELECT&CREATE=CREATE&INSERT=INSERT&ALTER=ALTER&UPDATE=UPDATE&DROP=DROP&DELETE=DELETE&LOCKTABLES=LOCK&INDEX=INDEX&REFERENCES=REFERENCES&CREATETEMPORARYTABLES=TEMPORARY&CREATEROUTINE=CREATEROUTINE";
$callurl = "/sql/addusertodb.html?$params";
$this->callUrl($callurl);
return $this->isSuccess('grant');
}
private function isSuccess($type='db'){
switch ($type){
case 'db':
if(eregi('Added the database',$this->callresult)){
return true;
} else {
return false;
}
break;
case 'user':
if(eregi('Added user',$this->callresult)){
return true;
} else {
return false;
}
break;
case 'grant':
if(eregi('was added to the database',$this->callresult)){
return true;
} else {
return false;
}
break;
case 'deldb':
if(eregi('deleted the database',$this->callresult)){
return true;
} else {
return false;
}
break;
case 'deluser':
if(eregi('Deleted the user',$this->callresult)){
return true;
} else {
return false;
}
break;
}
}
public function error($msg){
$this->error = $msg;
return false;
}
public function runBatch($dbname,$dbuser,$dbpass){
if(empty($dbname) OR empty($dbuser) OR empty($dbpass)) return false;
$result = array();
//create the database
$result['db'] = $this->createDb($dbname);
//create the user
$result['user'] = $this->createUser($dbuser,$dbpass);
//grant the access with real db name and username
$result['grant'] = $this->grantPriv($this->cpuser.'_'.$dbname,$this->cpuser.'_'.$dbuser);
return $result;
}
/**
* This method deletes a number of databases from cpanel.
*
* @param array $dbs
* @return array
*/
public function delDb($dbs){
//this method will delete a number of dbs.
if(is_array($dbs)){
foreach ($dbs as $db){
$db_full_name = $this->cpuser .'_'.$db;
$suffix = "/sql/deldb.html?db=$db_full_name";
$this->callUrl($suffix);
$result[$db] = $this->isSuccess('deldb');
}
return $result;
} else {
$this->error('Not an array');
}
return false;
}
/**
* This method deletes a number of users from cpanel.
*
* @param array $dbs
* @return array
*/
public function delUser($users){
//this method will delete a number of dbs.
if(is_array($users)){
foreach ($users as $user){
$user_full_name = $this->cpuser .'_'.$user;
$suffix = "/sql/deluser.html?user=$user_full_name";
$this->callUrl($suffix);
$result[$user] = $this->isSuccess('deluser');
}
return $result;
} else {
$this->error('Not an array');
}
return false;
}
/**
* Find whether a database is exists in cPanel or not!
*
* @param string $dbname Do not include the database name prefix (anything before _).
* @return boolean
*/
public function isDbExists($dbname,$limit=100){
$suffix = "/sql/index.html?itemsperpage=$limit";
$this->callUrl($suffix);
$html = $this->callresult;
$html = substr($html,stripos($html,''));
$html = str_ireplace('','BR',$html);
$html = strip_tags($html);
$all_db = explode('BR',$html); //array of all databases.
//trim the whitespaces surrounding the dbname
$all_db = array_map('trim',$all_db);
//print_r($all_db);
if(in_array($this->cpuser.'_'.$dbname,$all_db)){
return true;
} else {
return false;
}
}
public function isUserExists($username,$limit=100){
$suffix = "/sql/index.html?itemsperpage=$limit";
$this->callUrl($suffix);
$html = $this->callresult;
$html = substr($html,stripos($html,''));
$html = str_ireplace('','BR',$html);
$html = strip_tags($html);
$all_user = explode('BR',$html); //array of all databases.
//trim the whitespaces surrounding the dbname
$all_user = array_map('trim',$all_user);
//print_r($all_db);
if(in_array($this->cpuser.'_'.$username,$all_user)){
return true;
} else {
return false;
}
}
}
Usando la clase
error_reporting(E_ALL);
include('cpanel_mysql.class.php');
$db = new cpanel_db('domain','user','pass');
//create db
if($db->createDb('cpdb')){
echo 'Db Created';
} else {
echo 'Db not created';
}
//create user
if($db->createUser('cpuser','3837djd')){
echo 'User Created';
} else {
echo 'User not created';
}
//grant access
if($db->grantPriv('cpdb','cpuser')){
echo 'Priv granted';
} else {
echo 'Priv not granted';
}
//we can run the above three by this single line:
//$result = $db->runBatch('batch','batch','elkdrlfd');
//we can now check the result
print_r($result);
//del database
$db->delDb(array('db1','db2','db3'));
//del users
$db->delUser(array('user1','user1','user3'));
//we can also check whether a db/user exists
if($db->isUserExists('cpuser')) echo 'User exists';
if($db->isDbExists('cpdb')) echo 'Db exists';
Persevere Framework es un proyecto muy interesante para manipular datos y alamacenarlos (si queremos). Según los bechmarks que tienen, la performance que se logra es muy buena. Utiliza JSON y los protocolos para el intercambio de datos en HTTP/REST.
function nuevoAjax()
{
/* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por
lo que se puede copiar tal como esta aqui */
var xmlhttp=false;
try
{
// Creacion del objeto AJAX para navegadores no IE
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
// Creacion del objet AJAX para IE
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(E)
{
if (!xmlhttp && typeof XMLHttpRequest!='undefined') xmlhttp=new XMLHttpRequest();
}
}
return xmlhttp;
}