Category Archives: Techniques

Available Python tools for researchers

When I first start my research life, I began with Python, and I never go back. Python is powerful, simple, rich and widely supported.

In my researches, I met several problems, and I built the solution, but a lot of them are already prepared in Python.

  1. Plotting – matplotlib:
    I often use Matlab to plot my diagrams, but matplotlib is so powerful and produces nice plots. There are lots of examples that you will be able to master this package in no time. Continue reading Available Python tools for researchers

Don’t stop writing

Can’t believe I stopped writing for a while.

As a researcher and a curious person, I always want to learn something new and something that is innovative. That is to say, in my free time, I tend to find new courses, learning new techniques that I didn’t know before, and dunk myself into them. That sounds good at the beginning, when new things in life give you the excitement of exploring something fresh, let you have feeling that you’ve never experienced before.

So, what have I done in the last 4 years of academic world?

Continue reading Don’t stop writing

Handle Error in Python with try except

for i in range(20):
  try:
    something here
  except IOError:
    pass

 When python finds error in the code, it will stop and escape the loop and it might be a nightmare for us, so making an exception handler is a smart choice.

The above code is the simplest usage of try… except function, it means that, from the range(20) we will do ‘something here’, but if there are errors, here for example the error IOError is the error of not finding the object, thanks to try except, python in this case will process the ‘pass’ (forget the error and continue). So the loop is safe and can be continued.

What I do when I work

This is not a savvy post about what people should do while working to boost up their productivity. This is what I often do, and that makes me feel guilty and productive at the same time.

1. Surfing internet:

Sure thing. If I don’t surf internet while I’m working, I lie. But they definitely give you some good effects on your day: lift up your stress, give you some lesson about handling your software and something similar. But to be honest, when you’re in a project, a serious project, forget this part.

Continue reading What I do when I work

Add symlink to bash in Ubuntu

This trick work with custom installation, so that you can start them normally from terminal window:

Here is the syntax of the code:

# Matlab shortcut
export PATH=/usr/local/MATLAB/R2013a/bin:$PATH

Here in this example the matlab is installed into the path usr/local/MATLAB/R2013a/bin, after you put this line into the bashrc file and re-login, you can start matlab by opening the terminal and simply type matlab to begin.

That’s all!

Learn something new every day

Just discovered this trick this morning, the trick that will help you learn random things whenever you open your web browser.

What I’m talking about is Wikipedia Random Page:

http://en.wikipedia.org/wiki/Special:Randompage

Now that if you open that link, wikipedia will redirect you to a random article, and there is great possibility that the info is not yet in your knowledge system, then BOOM!, you learn something new.

This is one of the most efficient trick and very simple to do, because you’re surfing the internet everyday, so make it more profitable for your brain!