Pages

Friday, January 31, 2014

Fetching a remote git branch

The following command will update your local repo with remote changes.
$ git fetch --all

After that use the following command:
git checkout --track origin/the_branch


Deleting the last commit pushed to remote repo

Let's say that you have a repo called "origin" with a branch named "UK-December". In order to remove the last commit, follow these steps:

1. Get the commit history.

$git hist
* ef92aa4 2014-01-31 | pretty sure?
* e5d2440 2014-01-30 | Bitmap loading
* 954b23a 2014-01-30 | PRIO-40: fixed?
...

The commit we want to delete is ef92aa4

2. Use the following command to force git to rebase the UK-December repo to the parent of ef92aa4.

$git push origin +ef92aa4^:O2UK-December

Thats it. Your remote commit is gone!

Friday, January 3, 2014

Decorator Pattern Using Fortran

Structural design patterns deals with using existing classes. One of the structural pattern is Decorator. It acts as a wrapper to existing class object and adds functionality to it without changing the signature of the class. It attaches additional responsibilities to the object without modifying the class.

Following is an example of Decorator pattern implemented in Fortran:

GitHub - Decorator Pattern In Fortran
Fork

Wednesday, January 1, 2014

Criteria Design Pattern In Fortran

"Criteria" is a simple yet useful structural design pattern. It is applied in the cases where there are different types of object of the same class and it is a requirement to fetch objects of certain kinds. The criteria pattern helps defining a class hierarchy which makes applying any possible criteria for the objects trivial. Adding a criteria to the existing set of criteria is as simple as adding a class.

Following is an example in Fortran:

GitHub - Criteria Pattern
Fork