Pages

Hyperwebster: A dictionary made of infinite words and all of the texts, poems, everything written and ye to writeen (Paradoxes series #1)

If we create words from the alpaphet A....Z , like
A
AA
AAA.......A

B
BB
BBB........B
.
.
.
Z
ZZ
ZZZ........Z

Then, 

AB
AAB
...
AAA.....B

and then finally

.
.
.
......Z

If we create such words, this dictionary would contain everything written so far and future words, books, all of the text-worlds.

A mind blowing idea.

(need update)

Check R is installed or not

To check whether R is installed or not, type

$R

or type

$which R

or you can use

$type R


List of numerical libraries used in Quantum Chemistry / Computational Materials Science codes

The speed of a quantum chemical calculation often depends on how efficient the used numerical libraries are. Here is a list of numerical libraries that are widely used in various scientific codes.

C Program based
FFTW
GNU Scientific Libarary
Intel MKL (includes BLAS, LAPACK, ScaLAPACK, FFT, etc)

C++ Program based
Armadillo
LAPACK++
Intel MKL

Fortran Program based
LAPACK
LINPACK
Netlib

Python Program based
NumPy
SciPy
ScientificPython
SymPy



sed tutorial

The stream line editor 'sed' and the 'AWK' are the simple and highly useful languages for processing text files.

Here are some of the tips and tricks to use "sed". Later, I will post on AWK usage.

sed -n '/matchingWord/p' foo.txt

[Note that this is similar to: grep "matchingWord" foo.txt which seems to be very simple for this task. But for many instances, 'sed' may do more.]

sed -i -e 's/match/replacingText/g' hello.txt
Here, the line containing 'match' will be replaced with 'replacingText.

-e : just displays the outcome but don't change the file
-i : change the file (writes in the file)
s  : substitute
g  : is for global substitution. If need only first match, remove g.

Last one is the file name.

You can use this to a bunch of files. 

sed -i -e 's/match/replacingText/g' file*.txt


To delete lines with match pattern

sed -i '/pattern/d' FileName

To replace ":" with " " 

The sed expression s/:/ /g replaces every ":" with a "space".
That is sed substitutes an empty space for every ":" character globally in the file


Sometimes, there may be a need to remove (which is better than replacing a line which contain special characters)

To remove use following onliner

sed '/pattern to match/d' ./filename
To modify the file itself

sed -i '/pattern to match/d' ./filename


Replace the second line (or nth line, first line, third line, etc) using sed:

sed -i '2s/.*/0 5/' c*.in








For other posts like this, see
AWK


For more see following links:
https://stackoverflow.com/a/5410784/6628192




Using "tmux" for managing multiple screens

TMUX (tmux) is a fantastic tool for doing multitasks in terminal. For a programmer and researchers whose work involves coding, tmux is an essential tool.

In Ubuntu Linux, it can be installed by apt command.

To install from source code, download the package from this GitHub link.

Here are the important commands to use tmux.

tmux
tmux attach
ctrl + B   (the default prefix for tmux)
prefix + c   "Creates a window"
prefix + ,   To name/rename the panel
prefix + $  To name/rename the session
prefix + % vertical split
prefix + "   horizontal split
prefix + d   detach
prefix + d   ? to list all shortcuts
prefix + --> arrow : moves cursor to the right pane
prefix + <-- arrow : moves cursor to the left pane

To resize the panel size, prefix + Right /Lef/Down/Up arrow (i.e. --> or <--)
(Note that prefix followed by right/left arrow will move the cursor to the right/left pane)

It is also possible to restart entire tmux session after the restart. For this you need to use
tmux resurrect command. More on this later.

You can also see:
https://github.com/ssthurai/tmux-resurrect
https://github.com/ssthurai/tmux-continuum
For more commands, see this GitHub page on tmux.




Linux Onliners


To copy multiple files to multiple-different names
for f in *.txt ; do cp -p "$f" " ${f/text/texttobereplaced"; done

To copy a single file to multiple files 
for file in foo*.txt; do cp singlefile "$file" ; done
Note: Here, you have to create the files using touch.


To check the total size of a list of files in a directory
du -ch *.out | tail -n 1


To find all the instances of files with specific extension and delete all of them (recursively).
Before deleting, check all the files that will be deleted
find . -name "*.bak" -type f
Now, to if you are sure that these are the files to delete, run following command.
find . -name "*.bak" -type f -delete



Reference
Ask Ubuntu


How to disable the sound when using terminal in Windows 10?

How to disable the annoying notification sound when we do something wrong in the terminal (in Windows)?

Here is the simple way.

On the task bar, right click on the sound icon.

Select Open Volume Mixer. Here, click on the sound icon to disable the sound (like here)





How to hide (white out) some portions in a pdf file

How to hide (white out) some portions in a pdf file before printing?

We may have come across following situation.

You may want to print a research article or any file (which is in .pdf format).

But it may have a lot of pictures that may completely empty your cartridge. You may want to print other portions without this image. Also you may want hide certain portion of the text when you take print out.

Of course. You can do these with the Acrobat Reader (from Adobe)
But, How to do these in the free version of the Adobe Reader?

Here is a simple way.


  1. Open the file in Adobe Reader
  2. Go to Edit --> Paste
  3. A rectangular box will appear (with some text which is typed by you recently)
  4. Adjust the corners/sides of the box so that it hides entire Figure/portion that you want to hide
  5. You may delete the text or you may type some text inside this box
  6. You can also change the color of the outline by right clicking on the box and changing the property.


Hope it helps.





Quantum Espresso Series: How to run calculations in Quantum Espresso

I found a blog where nuts and bolts of doing calculations in Quantum Espresso code. In the blog post from quantumbarista.blogspot.com , the author Ryan Cloke has discussed the "Electronic Structure Calculations of Graphene Nanoribbons Using Quantum Espresso".

This blog post provides a detailed description on how to compute the band structure of a graphene nanoribbon.

Have a look at it.

I will do calculations and update to you later.


Quantum Espresso Series: Installing Quantum Espresso in Ubuntu 16.04 for newbies

Quantum Espresso is a opensource code for studying the electronic properties of materials. Installation of Quantum Espresso had been a difficult task earlier for new comers (now I believe that it is easy)

In this guide, I provide an easy way to install Quantum Espresso in Ubuntu 16.04. The hardware requirements can be seen here.

First check whether you have a FORTRAN complier (gfortran is a free FORTRAN compiler which is available in Ubuntu by default)

To update to new version of gfortran,

sudo apt-get install gfortran

This will install/update gfortran.

Now go the Quantum Espresso site.

Go to download page.

Download the specific version of the code you want.

Download the examples.

Extract the code using xzvf *.tz

Run ./configure

This will tell you if there is need for the installation of any packages

If configure is success,

Run make pw

Then move to examples folder

Now, you can run the specific examples

If there is need for 

You may be interested in these posts

Error in image file conversion: convert-im6.q16: not authorized `test.eps' @ error/constitute.c/WriteImage/1037.

This error is because of the vulnerability. This allows remote execution of code using image formats. So, some Linux distributions by defaul...