Displaying 51-60 of 274 results.
Resolved: Composer Ubuntu installation and errors
posted by admin on January 18, 2017
I am trying to install composer by that way and get some errors.
Instalation
Step 1: Ensure the Curl dependency is installed.

sudo apt-get -y install curl


Step 2: Download the Composer installer and pass it to php.

sudo curl -sS https://getcomposer.org/installer | php

My error in this step:

The program 'php' can be found in the following packages:
* php7.0-cli
* hhvm
Try: sudo apt install <selected package>
curl: (23) Failed writing body (0 != 16133)
Read more
Resolved: Skype Ubuntu This software comes from a 3-rd party and may contain non-free components error
posted by admin on January 18, 2017
I am trying to install skype to ubuntu and all methods which I use didn't resolve this error

This software comes from a 3-rd party and may contain non-free components error


In command line I have got error like this

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
google-chrome-stable : Depends: libpango1.0-0 (>= 1.14.0) but it is not going to be installed
Depends: libappindicator1 but it is not going to be installed
ubuntu-restricted-extras : Depends: ubuntu-restricted-addons but it is not going to be installed
Recommends: ttf-mscorefonts-installer but it is not going to be installed
Recommends: unrar but it is not going to be installed
Recommends: libavcodec-extra
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).



I try to install gdebi installer, and have got error too

sudo apt install gdebi

Error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
gdebi : Depends: gdebi-core (= 0.9.5.7ubuntu1) but it is not going to be installed
Depends: gksu but it is not going to be installed
Depends: gnome-icon-theme but it is not going to be installed
Recommends: libgtk2-perl but it is not going to be installed
google-chrome-stable : Depends: libpango1.0-0 (>= 1.14.0) but it is not going to be installed
Depends: libappindicator1 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Read more
Resolved: Javascript jSnow plugin Uncaught TypeError: Cannot read property 'msie' of undefined
posted by admin on December 19, 2016
I use jsnow.js javascript plugin and now I have got this error.

$(document).ready(function () {
$().jSnow({zIndex : 999999999});
})

Please help to resolve itRead more
Resolved: Javascript body onclick function event
posted by admin on December 15, 2016
I have a function and onmousemove event in body attribute.
JS

function mouseShowHandler(e){

e = e || window.event


if (e.pageX == null && e.clientX != null ) {

var html = document.documentElement

var body = document.body

e.pageX = e.clientX + (html && html.scrollLeft || body && body.scrollLeft || 0) - (html.clientLeft || 0)

e.pageY = e.clientY + (html && html.scrollTop || body && body.scrollTop || 0) - (html.clientTop || 0)



}
xx=e.pageX
yy=e.pageY
}


HTML

...
<body onmousemove="mouseShowHandler(event)">
...

It is working fine, But I want to event handler to my script file, and remove from bodyRead more
Resolved: Dhtmlx attachform select option
posted by admin on December 9, 2016
I have DHtmlx form, and I have select option part of form. How I can downlload data from db and fill my select options
My form

var str = [
{ type:"block" , name:"bl1", list:[

]},
{ type:"input" , name:"id", label: "ID", hidden: true},
{ type:"input" , name:"status", label: "Status:", readonly: true, width: 287, labelWidth: 70, value: "Not set"},
{ type:"input" , name:"count", label: "Count"},
{ type:"select" , name:"worker", label: "Worker"},
{ type:"button" , name:"save", value:"End process", width:"320" }
];

form_1 = tab_x.attachForm(str);

I dont want load content from another file by select attribute, i want to upload int main file and output thereRead more
Resolved: PHP check time 00:00:00 from datetime
posted by admin on November 21, 2016
I have datetime from MySQL db in format Y:m:d H:i:s like

2014-11-02 02:04:05
2014-11-02 00:00:00
etc ...

I want to check, if time from datetime equal "00:00:00", then return or echo only date.
Result

2014-11-02 02:04:05
2014-11-02
Read more
Wiki: CActiveRelation HAS_MANY BELONGS_TO based on secondary keywiki
posted by admin on November 16, 2016
In the Model class, I overrode the getTableSchema and manually defined the foreign keys like so:

public function getTableSchema()
{
$table = parent::getTableSchema();

$table->columns['sid']->isForeignKey = true;
$table->foreignKeys['sid'] = array('Click', 'm_sid');

return $table;
}

And in the corresponding table:

public function getTableSchema()
{
$table = parent::getTableSchema();

$table->columns['m_sid']->isForeignKey = true;
$table->foreignKeys['m_sid'] = array('Message', 'sid');

return $table;
}

Now the standard relation definitions work directly!

'clicks'=>array( self::HAS_MANY, 'Click', 'm_sid' ),

as well as

'message'=>array( self::BELONGS_TO, 'Message', 'sid'),
Read more
Resolved: Hosting iPage.com MySQL connection error: SQLSTATE[HY000] [2002] Connection refused
posted by admin on November 11, 2016
I am trying to run my Yii 1 website and connect to DB, which is not in my hosting iPage.com and have this error:

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Connection refused

For example, my MySQL config in iPage.com working fine
protected/config/database.php

<?php
return array(
'connectionString' => 'mysql:host=*******.ipagemysql.com;dbname=somename',
'emulatePrepare' => true,
'username' => 'someuser',
'password' => 'somepassword',
'charset' => 'utf8',
);

Another server connection and error
protected/config/database.php

<?php
return array(
'connectionString' => 'mysql:host=anotherhostname;dbname=somename',
'emulatePrepare' => true,
'username' => 'someuser',
'password' => 'somepassword',
'charset' => 'utf8',
);

Error:

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Connection refused
Read more
Resolved: Yii 1.1 Redirect to referrer url
posted by admin on November 10, 2016
I want to redirect from referrer page
Now:

$this->redirect(array('admin'));

I want something like

$this->redirect({referrer});
Read more
Wiki: Yii 1.1 right way to pass parametr to model search from relation controller and view (usage in CGridView)wiki
posted by admin on November 9, 2016
Models:

* @property integer $id
* @property integer $type_id
* @property string $name
class Store extends CActiveRecord
{
//...
public function rules()
{
return array(
//your rules
array('id, type_id, name', 'safe', 'on'=>'search, searchbytype'),
);
}

public function relations()
{
return array(
'type' => array(self::BELONGS_TO, 'Type', 'type_id'),
);
}

public function search()
{
$criteria=new CDbCriteria;
$criteria->compare('t.id',$this->id);
$criteria->compare('t.name',$this->name,true);
$criteria->compare('t.type_id',$this->type_id);

return new CActiveDataProvider($this, array(
'criteria' => $criteria,
'sort' => array(
'defaultOrder' => 't.id DESC',
'attributes' => array(
'*',
),
),
'pagination' => array (
'PageSize' => 50 //edit your number items per page here
),
));
}

//Our custom search with recieve passed parametrs
public function searchbytype($id)
{
$criteria=new CDbCriteria;
//add condition here
$criteria->condition = "t.type_id = ".$id;

$criteria->compare('t.id',$this->id);
$criteria->compare('t.name',$this->name,true);
$criteria->compare('t.type_id',$this->type_id);

//do not add condition here, filter search not working correct
//$criteria->condition = "t.type_id = ".$id;

return new CActiveDataProvider($this, array(
'criteria' => $criteria,
'sort' => array(
'defaultOrder' => 't.id DESC',
'attributes' => array(
'*',
),
),
'pagination' => array (
'PageSize' => 50 //edit your number items per page here
),
));
}

//...
}

class Type extends CActiveRecord
{
//...
public function relations()
{
return array(
'store' => array(self::HAS_MANY, 'Store', 'type_id'),
);
}
//...
}


Controller:

class TypeController extends Controller
{
//...
public function actionView($id)
{
$model = $this->loadModel($id);
$stores=new Store('searchbytype');
$stores->unsetAttributes(); // clear any default values
if(isset($_GET['Store']))
$stores->attributes=$_GET['Store'];
$this->render('view',array(
'model'=>$model,
'stores'=>$stores
));
}
//...
}

View:

<h1><?php echo $model->id; ?></h1>
<?php
$id = Yii::app()->request->getQuery('id');

$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'application-grid',
'dataProvider'=>$stores->searchbytype($id),
'filter'=>$stores,
'pagerCssClass' => 'pagination pull-right',

'columns'=>array(
'id',
'name',
array(
'class'=>'CButtonColumn',
),
),
));
Read more