Monday, November 12, 2018
Saturday, June 16, 2018
Release port under use in windows
We will release port 8080 here which is being used by windows
The Error:
The Solution:
Let's first run the following commands in order
- netstat -a -o -n: This will provide us the process id of the process which is using the port.We find that process 4516 is using our port 8080 and we need to kill it.
2. Next run the command taskkill /F /PID 4516 : This will kill the process.Make sure you have opened command prompt in administrative mode.
Wednesday, April 19, 2017
VMware Workstation unrecoverable error: (vcpu-0)
Trying to run OS X on a Virtual Machine and banging into following error.
VMware Workstation unrecoverable error: (vcpu-0)
vcpu-0:VERIFY vmcore/vmm/main/physMem_monitor.c:1180
A log file is available in "E:\temp\os x\vmware.log".
You can request support.
To collect data to submit to VMware support, choose "Collect Support Data" from the Help menu.
You can also run the "vm-support" script in the Workstation folder directly.
We will respond on the basis of your support entitlement.
Just add the following at the end of VMX file(configuration file)
smc.version = "0"
VMware Workstation unrecoverable error: (vcpu-0)
vcpu-0:VERIFY vmcore/vmm/main/physMem_monitor.c:1180
A log file is available in "E:\temp\os x\vmware.log".
You can request support.
To collect data to submit to VMware support, choose "Collect Support Data" from the Help menu.
You can also run the "vm-support" script in the Workstation folder directly.
We will respond on the basis of your support entitlement.
Just add the following at the end of VMX file(configuration file)
smc.version = "0"
Labels:
El Capitan Retail,
error,
Machine,
OS X,
vcpu-0,
Virtual,
VMware,
Workstation
Friday, September 30, 2016
Angular Js- Using minified version of Controller,filter js files
Using minifed version of controller JS Files
Here we will use a controller as an example same can be used for Filters
One important thing to note when we isolate controller from our HTML file is during its minification.
The minification also minifies variable in controller and $scope,$http,$filter may become variables a,b,c which are not recognized by angular see the minified version of above controller.js is as follows
controller.js
angular.module('myApp',[]).controller('myCtrl',function($scope){
$scope.names=[
{name:'Gaurav',country:'India'},
{name:'Mike',country:'USA'},
{name:'Steve',country:'Denmark'}
];
});
controller.min.js
angular.module("myApp",[]).controller("myCtrl",function(n){n.names=[{name:"Gaurav",country:"India"},{name:"Mike",country:"USA"},{name:"Steve",country:"Denmark"}]});
Here $scope becomes n and this will not be recognized by angular js.To over come this problem use code controller code in controller.js as
controller.js
angular.module('myApp',[]).controller('myCtrl',["$scope",myCtrl]);
function myCtrl($scope){
$scope.names=[
{name:'Gaurav',country:'India'},
{name:'Mike',country:'USA'},
{name:'Steve',country:'Denmark'}
];
};
In this we isolate the Controller function but we also tell the module that the first parameter of this function will be "$scope"
The Minified version of this file is
controller.min.js
function myCtrl(n){n.names=[{name:"Gaurav",country:"India"},{name:"Mike",country:"USA"},{name:"Steve",country:"Denmark"}]}angular.module("myApp",[]).controller("myCtrl",["$scope",myCtrl]);
Above file also changes the parameter $scope of the function to "n" but when final call is made to function the first parameter is sent as $scope
Labels:
Angular,
angularjs,
controller,
files,
filter,
Javascript,
js,
minified,
version
Monday, September 26, 2016
Saturday, September 24, 2016
Angular Js- Use a filter in expression with javascript addition operator
Recently in one of my Projects I was stuck up in an issue regarding filters
Here is My Custom Filter
I am trying to use this filter in my HTML as
But this didn't worked out so I had to use filter in my controller.Here is how I did the same
And then I used this in my Html as follows
Here is My Custom Filter
app.filter('alterCap',function()
{
return function(x)
{
var i, c, txt = "";
for (i = 0; i < x.length; i++) {
c = x[i];
if (i % 2 == 0) {
c = c.toUpperCase();
}
txt += c;
}
return txt;
};
});
I am trying to use this filter in my HTML as
{{ x.country|alterCap + ":" + x.capital|alterCap }}
But this didn't worked out so I had to use filter in my controller.Here is how I did the same
app.controller("myCtrl",function($scope,$filter){
$scope.capitals = [
{country:'India',capital:'Delhi'},
{country:'Sri Lanka',capital:'Colombo'},
{country:'Afganistan',capital:'Kabul'},
{country:'Bhutan',capital:'Norway'},
{country:'Nepal',capital:'Thimphu'},
{country:'Japan',capital:'Tokyo'},
{country:'China',capital:'Beijing'},
{country:'Russia',capital:'Moscow'},
{country:'USA',capital:'Washington, D.C.'}
];
$scope.applyAlterCap = function(movie){
return $filter('alterCap')(movie);
};
});
And then I used this in my Html as follows
<p>Using Custom Filter with addition operator inside expression</p>
<ul>
<li ng-repeat="x in capitals | orderBy:'capital'">
{{ applyAlterCap(x.country) + ":" + x.capital }}
</li>
</ul>
Labels:
addition,
Angular,
angularjs,
controller,
custom,
expression,
filter,
Javascript,
js,
operator
Tuesday, September 20, 2016
Ubuntu boots into command line after update
I recently faced this issue after updating to Ubuntu 15.10 and was looking for solutions until this one worked for me
Enter into recovery mode from grub and run the following command
sudo dpkg --configure -a
Enter into recovery mode from grub and run the following command
sudo dpkg --configure -a
Monday, January 4, 2016
Symfony-Error-Annotation not Imported
[Semantical Error] The annotation "@Template" in method AppBundle\Controller\DefaultController::indexAction() was never imported. Did you maybe forget to add a "use" statement for this annotation? in /var/www/symfony_learn_2_6/src/AppBundle/Controller/ (which is being imported from "/var/www/symfony_learn_2_6/app/config/routing.yml").
Recently while working on symfony I encountered above error.The resolution is simple we just need to add Sensio annotation handler for the above annotation.So in this case since annotation handler for template is missing we need to add
Sensio\Bundle\FrameworkExtraBundle\Configuration\Template
above the controller.Similerly if annotation handler for route is missing then we can add
Sensio\Bundle\FrameworkExtraBundle\Configuration\Route
Sunday, December 27, 2015
Symfony-Generate Bundle Option not working in app/console
Recently in One of the symfony dumps I gathered from my IT team had an issue due to some reason "Generate Bundle" option was not working from app/console list -- raw
Solution :
Add following lines in File composer.json
"required-dev":{
"sensio/generator-bundle": "~2.3"
}
File AppKernal.php should have
new Sensio\Bundle\GeneratorBundle\SensioGenerator();
That's it
Solution :
Add following lines in File composer.json
"required-dev":{
"sensio/generator-bundle": "~2.3"
}
File AppKernal.php should have
new Sensio\Bundle\GeneratorBundle\SensioGenerator();
That's it
Thursday, July 30, 2015
Cakephp 2.0-Validations not working
Many a times Our custom Validations do not work in cakephp due to very tiny small errors.Here is a piece of my research and development which might help you
In the controller
See the line in Bold this must be done to get errors set
In the view
In the controller
if (!empty($this->data))
{
$this->User->set($this->data);
if ($this->User->validates())
{
// it validated logic
echo "Yes we can proceed";
}
else
{
// didn't validate logic
$errors = $this->User->validationErrors;
pr($errors);
}
}
See the line in Bold this must be done to get errors set
In the view
<?php
if($this->Form->isFieldError('User.username'))
{
echo $this->Form->error('User.username', null, array('class' => 'message'));
}
?>
Now set the class to taste and you will get error message in view in desired color.
Subscribe to:
Posts (Atom)
