Debdeep Bhattacharya

View My GitHub Profile


Featured Posts

Recent Posts (5)

3D plots in python

12 Apr 2022

Python library matplolib does a pretty good job.

3D scatter plot

from mpl_toolkits.mplot3d import Axes3D fig = plt.figure() ax = Axes3D(fig) ax.scatter(X, Y, Z, s = 10, linewidth = 1 ) ax.<span...

Python parallel processing with multiprocessing

5 Mar 2022

Say we have a function called write_img(t) that takes integer values. The for loop

for t in range(starting, ending): write_img(t) 

can be replaced by

from multiprocessing import Pool a_pool = Pool(), range(staring, ending)) 

Common git scenarios

15 Jan 2022

Removing a large file from the commit history

If you want to remove a large file from the repository which was accidentally committed and pushed to GitHub (possibly due to a sloppy .gitignore), do

git filter-branch --force --index-filter \ 'git rm --cached --ignore-unmatch path/to/file.jpg' \ --prune-empty --tag-name-filter cat -- --all 

Then, to delete the same in the remote repo,

git push origin --force --all 

Setting up vim in a local environment

14 Dec 2021

If you are working in a linux environment without superuser privileges, you can set up vim (or nvim) and its plugins in the following way.



Merging a git branch

13 Nov 2021

If we want to merge the branch remote_branch to the branch local_branch (the terms remote and local are well-defined in that sense), we do the following.

git branch local_branch 
git checkout local_branch 
git merge remote_branch 

Note: you may get ‘branch does not exist’ error, in that...