Pages

Removing permanent marker from Whiteboard

Recently, I used permanent marker mistakenly instead of white-board marker. How to remove this writing?

1. If the writing is a few words or letters, you can use whiteboard marker (of any color) to write on the letters written by permanent marker. Then you can use clean cloth the remove. Now all will be gone.

2. If you have written the whole white board and you can use the first method, you can use fallowing procedure.
You can use pencil eraser to remove the writing.

3. Use Acetone. Acetone (250 ml) can be bought for about 2 USD. Use a pure cotton cloth and dip in acetone so that the cloth become wet. Then, gently rub on the board where the marker is written. This will clean the board completely. Make sure that acetone bottle is closed tight. Otherwise, it will evaporate quickly. You can use tissue papers too instead of a cloth.

4. You can use any alcohol and use method 3 by using a clean cloth.

For more ideas, visit lifehack stack exchange.






Copy multiple files with different names (res to unres)

Change directory to where you have the original files.

Then test with the following command line,

for i in *_original.*;do echo cp -p "$i" "${i/_original./_copy.}";done
and if it looks good, remove echo and do the copying,

for i in *_original.*;do cp -p "$i" "${i/_original./_copy.}";done


Reference
https://askubuntu.com/a/1045000/465828



Using for loop to save outcome in in different file using np.savetxt

I wrote a script to do following task.

For each number that is created using range(0,100), I created xyz coordinates to generate guess structures for my calculations. The structure of the script is as follow.


for numPoints in range(0, 101):
     #do something to create x0, y0 and cons0 (xyz coordinates for a molecule)
     np.savetxt(fname_template.format(i=numPoints), np.c_[x0,y0,cons0],delimiter=' ',fmt='%10f')

This solved my problem.

I got this idea from following post in stack overflow.

fname_template = "Subarray.{i}.txt"
for i, sarr in enumerate(sub_arr):
    np.savetxt(fname_template.format(i=i), sarr, fmt='%s')
To create the file name I've used the new string formatting. Otherwise you can concatenate strings with + as "Subarray."+str(i)+".txt", but you have to make sure that all the elements that you concatenate are strings.

awk, sed, pipe, grep, etc like functions in python

I would like to translate from bash to python script.

The bash contains awk, sed, pipes, cat commands.

How to write commands in python?




Ubuntu update error: Unable to lock directory /var/lib/apt/lists/

When I update using

sudo apt-get update
or
sudo apt update

I get following error.

E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/

I tried updating through Software Updater and Restarted the machine.

Now its fine.




Trignometric formula

Trig functions

sin(A + B) = sin A cos B  +  cos A sin B
cos(A + B) = cos A cos B  −  sin A sin B

cos(A − B) = cos A cos B + sin A sin B
sin(A − B) = sin A cos B − cos A sin B

Useful sites
https://brownmath.com

Installing VESTA

Check whether curl has been installed or not.

which curl

if curl is installed, it will give you the path. 

If not installed, 

sudo apt-get install curl 


Now, use 


This will download the installer to the current directory.

Now, 

sudo bash vestacp.sh

This will install vesta. First it will ask for e-mail ID. Enter a valid e-mail ID. 
Then, it will ask for host. If want to use default, presee ENTER.

Then, vesta will be installed.

It may take 15 minutes to 30 minutes.






Tetrahedral site



What is tetrahedral site?

Here is a good explanation with clear sketch.
Following description and figures are taken from

https://www.tf.uni-kiel.de/matwis/amat/def_en/kap_1/illustr/t1_3_4.html

"In a tetrahedral site the interstitial is in the center of a tetrahedra forms by four lattice atoms. Three atoms, touching each other, are in plane; the fourth atom sits in the symmetrical position on top. Again, the tetrahedral site has a defined geometry and offers space for an interstitial atom."

 "The configuration on top is the tetrahedral position in the fcc lattice. The black circles denote lattice points, the red circle marks one of the 8 the tetrahedral position."

"The picture on the bottom shows the tetrahedral configuration for the bcc lattice. We have (6 · 4)/2 = 12 positions per unit cell."


Figure: The tetrahedral site in FCC (above) and BCC (below) crystal structures

References
https://www.tf.uni-kiel.de/matwis/amat/def_en/kap_1/illustr/t1_3_4.html

SI Prefixes


Factor
Name
Symbol
Multiplying Factor
1024
yotta
Y
1 000 000 000 000 000 000 000 000
1021
zetta
Z
1 000 000 000 000 000 000 000
1018
exa
E
1 000 000 000 000 000 000
1015
peta
P
1 000 000 000 000 000
1012
tera
T
1 000 000 000 000
109
giga
G
1 000 000 000
106
mega
M
1 000 000
103
kilo
k
1 000
102
hecto
h
100
101
deca
da
10
10–1
deci
d
0.1
10–2
centi
c
0.01
10–3
milli
m
0.001
10–6
micro
µ
0.000 001
10–9
nano
n
0.000 000 001
10–12
pico
p
0.000 000 000 001
10–15
femto
f
0.000 000 000 000 001
10–18
atto
a
0.000 000 000 000 000 001
10–21
zepto
z
0.000 000 000 000 000 000 001
10–24
yocto
y
0.000 000 000 000 000 000 000 001


Source: https://www.bipm.org/en/measurement-units/prefixes.html

Teaching philosophy

Universities ask for statement of teaching interest or teaching philosophy

Important components in the statement

first one: internal honesty with myself
take the time, to think thorough and think fundamentally what it
attitude
take you put into

- statement should be completely personal.
- should use "I" instead of speaking globally
- don't explain others how to teach
- because it is going to be read by already who is teaching (they will get irritated by reading your statement if you teach them how to teach)




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...