Stuckness shouldn't be avoided. It's the psychic predecessor of all real understanding. An egoless acceptance of stuckness is a key to an understanding of Quality, in mechanical work as in other endeavors. It's this understanding of Quality as revealed by stuckness which so often makes self-taught mechanics so superior to institute-trained men who have learned how to handle everything except a new situation. - Robert Pirsig, Zen and the Art of Motorcycle Maintenance
Friday, April 20, 2012
Thursday, April 19, 2012
svn: making trunk identical to a branch
So, I created a branch, made changes within the branch over a period and periodically kept merging from trunk into the branch.
Now I want to make the trunk identical to the branch. The best approach for this is as described at http://stackoverflow.com/a/1008805/19501, namely use the three-way merge option:
...you want to merge "FROM trunk@HEAD TO branch@HEAD" with the working copy pointing to trunk. In essence:
"Give me all the changes I'd need to make trunk identical to branch".
Thursday, April 5, 2012
Copy one sparse matrix into another in Python
Copying Xf into features. In this case, Xf is a scipy.sparse.csr_matrix and features is a dok_matrix.
nz_indices = Xf.nonzero()
for ix, jx in zip(nz_indices[0], nz_indices[1]):
features[ix, jx] = Xf[ix, jx]
Notes:
1. When I checked, the assignment of a 0 to an element of a dok_matrix resulted in a crash. So 0 assignments have to be avoided.
Subscribe to:
Posts (Atom)