Posts

ubuntu - Compiling CUDA looks for wrong CUDA version -

on ubuntu, had installation of cuda 6.5, , wanted upgrade cuda 7.0. so, deleted directory @ /usr/local/cuda-6.5, , installed cuda 7.0 /usr/local/cuda-7.0. changed symbolic link @ /usr/local/cuda point /usr/local/cuda-7.0. in bash.rc file, updated environment variables accordingly: export cuda_home=/usr/local/cuda-7.0 export ld_library_path=${cuda_home}/lib64 export path=${cuda_home}/bin:${path} if type in "nvcc --version", following expected: cuda compilation tools, release 7.0, v7.0.27 however, compiling code (the caffe deep learning library, precise) uses cuda, , getting following error message: error while loading shared libraries: libcudart.so.6.5: cannot open shared object file: no such file or directory so reason, still looking cuda 6.5 libraries, rather cuda 7.0 libraries. why this? how tell compiler 7.0 libraries? cannot find reference libcudart.so.6.5 in source code compiling, cuda compiler looking wrong version. obviously, didn't follow ...

git - How do I squash two non-consecutive commits? -

i'm bit new whole rebasing feature within git. let's made following commits: a -> b -> c -> d afterwards, realize d contains fix depends on new code added in a , , these commits belong together. how squash a & d , leave b & c alone? you can run git rebase --interactive , reorder d before b , squash d a.

javascript - How can I set the maximum number of object to show? -

i have following function create automatically new option if there folder inside. last folder contain html file , html going opened automatically when select parent folder. in case don't want create option . this code create new levels want stop create new 1 once there 4 option levels created: function processnewdfdata( respobj, $currentselectitem, strcurrentpath ) { fsstructure[strcurrentpath] = {'subfolders':[], 'subshtmls':[]}; if ( (respobj.subfolders.length > 0) || (respobj.subshtmls.length > 0) ) { for( var = 0; < respobj.subfolders.length; i++ ) { fsstructure[strcurrentpath].subfolders.push( respobj.subfolders[i] ); } for( var = 0; < respobj.subshtmls.length; i++ ) { fsstructure[strcurrentpath].subshtmls.push( respobj.subshtmls[i] ); } } rendselects( $currentselectitem, strcurrentpath ); }

angularjs - How to avoid nested call in ionic/angular? -

i'm totally new ionic/angular, code: .controller('postctrl', function($scope, posts, $cordovasqlite, $http) { $scope.getposts = function() { $http.get('http://localhost/postids').then(function(resp) { _.each(resp.data, function(id) { var query = "select id posts id = ?"; $cordovasqlite.execute(db, query, [id]).then(function(res) { if(res.rows.length = 0) { $http.get('http://localhost/post/' + id).then(function(resp) { var post = resp.data; var query = "insert posts (postid, title, user, content) values (?,?,?,?)"; $cordovasqlite.execute(db, query, [post.id, post.title, post.user, post.content]).then(function(res) { // success }, function(err) { console.log(err); }); }, function(err) { console.log(err); }); } }, function (err) { ...

How can I permanently save the last code until next restart in vim -

so question if writing code in vim & want go 20 minutes earlier, type :earlier 20m in vim. doesn't work if exit vim once or reboot system. understand stored temporary registers , once vim restarts, cleans whole register buffers. there way can save last changes & apply undo mechanisms. work on big project files & if wrong occurs, can not go back. in vim 7.3 or later, can use undo file. put in .vimrc. set undofile by default save 100 actions undo. if want more, can set manually adding .vimrc, whatever number want: set undolevels=100 persistent undo create undo files in same directories files work on. if want put these in separate directory don't clutter filesystem, add .vimrc: set undodir=~/.vim/undo then, need make directory. command line: mkdir ~/.vim/undo i using version control instead of relying on vim's persistent undo track changes in projects.

Numerically find energy eigenvalues of a large symbolic matrix in Mathematica for a given range -

i have 136x136 hamiltonian (matrix) , need find eigenvalues. it cannot solved analytically eigenvalues[h] required solve 136th order polynomial. i need solve numerically replacing symbolic terms values before computing eigenvalues. however, needs plotted range of values of symbolic term example -1 < x < 1. is there method numerically solve , plot range of values? { {10.1358 - 6.72029 x, 0., 0.},... {0., 10.1358 - 6.72029 x, 0.}, {0., 0., 10.1358 - 6.72029 x}, {0., 0., 0.}, {0., 0., 0.}, {0., 0., 0.}, {0., 0., 0.}, {0., 0., 0.}, {0., 0.204252, 0.}, {0., 0., 0.267429} ... corner of matrix example. matrix real , symmetric.

c - Warshall algorithm idea and improvement -

the warshall-floyd algorithm based on idea: exploit relationship between problem , simpler rather smaller version. warshall , floyd published algorithms without mentioning dynamic programming. nevertheless, algorithms have dynamic programming flavor , have come considered applications of technique. algorithm warshall(a[1..n, 1..n]) //implementswarshall’s algorithm computing transitive closure //input: adjacency matrix of digraph n vertices //output: transitive closure of digraph r(0) ←a k←1 n ←1 n j ←1 n r(k)[i, j ]←r(k−1)[i, j ] or (r(k−1)[i, k] , r(k−1)[k, j]) return r(n) we can speed above implementation of warshall’s algorithm inputs restructuring innermost loop my question on above text following what author mean idea " exploit relationship between problem , simpler rather smaller version" please elobaorate. how can improve speed author mentioned in above implemenation. the formulation 1...