Monday, November 24, 2014

Nearpy - Scypy installation error on Mac OS: library dfftpack has Fortran sources but no Fortran compiler found

Run the following commands:

1. install homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


2. Install GCC: GNU Fortran is now provided as part of GCC, and can be installed with: brew install gcc.

brew install gcc

That's it, now try to install Scypy again, everything should work smoothly.

Resources:
http://stackoverflow.com/questions/14821297/scipy-build-install-mac-osx
http://penandpants.com/2012/03/01/install-python-2/

Wednesday, November 12, 2014

Angularjs update migration : getting function parameters from template

Using angular 1.2.0-rc.3 with this code

// html 
...
<div ng-repeat="row in rowdata">
   <a ng-click="getDetailedListing('{{row._id.$oid}}');">Details</a>
</div>
...

//angular js controller
$scope.getDetailedListing = function(listingId) {
        console.log(listingId);
}

When the user clicks the 'a' element, in the console is printed the listingId ie. 54613ed26fb36f26e5ab41a8

But when we upgrade the angular version to 1.2.26, the same code printed {{row._id.$oid}} instead of the listing id. So the fix was changing the a element a little bit:

<a href="javascript:;" ng-init="listingId=row._id.$oid" ng-click="getDetailedListing(listingId);" >Details</a>

Reference
http://stackoverflow.com/questions/18694827/calling-a-scope-function-from-an-ng-include-template-passing-template-value-as-p

Pycharm: exit code 69 trying to run git command

I was getting the error:

exit code of #69 Additional error details: Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

I solved it by installing Xcode, running it, accept the user agreement, let it install everything and reload Pycharm.

Source:
http://nielsvanrongen.com/bower-exit-code-of-69/

Sunday, October 19, 2014

python - PIP : ImportError: cannot import name IncompleteRead

I got the error:

ImportError: cannot import name IncompleteRead

The solution was reinstalling pip:

sudo easy_install freeze
sudo apt-get remove python-pip
sudo apt-get autoremove
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py --no-check-certificate
sudo python get-pip.py

Resource:

http://suanfazu.com/discussion/140/pip-install-importerror-cannot-import-name-incompleteread/p1

Angular js: re render directive dinamycally

Here is a great and simple example of how is done:

http://jsfiddle.net/7Waxv/2/

Tuesday, October 7, 2014

Share data among controllers

Use $ rootScope

var app = angular.module('mymodule',[]);
app.controller('Ctrl1', ['$scope','$rootScope',
  function($scope, $rootScope) {
    $rootScope.showBanner = true;
}]);

app.controller('Ctrl2', ['$scope','$rootScope',
  function($scope, $rootScope) {
    $rootScope.showBanner = false;
}]);

Source:
http://stackoverflow.com/questions/20181323/passing-data-between-controllers-in-angular-js