Nuclear force Updated 2025-07-16
Cryptocurrency exchange Updated 2025-07-16
Islam Updated 2025-07-16
youtube-dl Updated 2025-07-16
Cytoplasm Updated 2025-07-16
German physics journal Updated 2025-07-16
MediaWiki Updated 2025-07-16
PostgreSQL getting started Updated 2025-07-16
On Ubuntu 20.10 PostgreSQL 12.6, login with
psql on my default username without sudo fails with: stackoverflow.com/questions/11919391/postgresql-error-fatal-role-username-does-not-existThis is the one that worked on Ubuntu 21.04: stackoverflow.com/questions/11919391/postgresql-error-fatal-role-username-does-not-exist/38444152#38444152Explanation:
sudo -u postgres createuser -s $(whoami)
createdb $(whoami)You can now run shows that peer authentication is available to all users apparently:
psql without any password. This works without password due to peer authentication:sudo cat /etc/postgresql/12/main/pg_hba.conflocal all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peerList users:output:
psql -c '\du' List of roles
Role name | Attributes | Member of
-------------+------------------------------------------------------------+-----------
ciro | Superuser, Create role, Create DB | {}
owning_user | | {}
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}Delete user later on:
psql -c 'DROP USER username;'Help toplevel:
helpList supported SQL commands:
\hShow syntax for one type of command:
\h SELECTList all databases:which shows:
psql -c '\l' Name | Owner | Encoding | Collate | Ctype | Access privileges
-------------+----------+----------+-------------+-------------+-----------------------
ciro | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
postgres | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
template0 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
testdb0 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
(6 rows)If you didn't give a database from the command line e.g.:you can do that afterwards with:
psql\c testdb0Let's create a table and test that it is working:
psql testdb0 -c 'CREATE TABLE table0 (int0 INT, char0 CHAR(16));'List tables, no special tables:gives:
psql testdb0 -c '\dt' List of relations
Schema | Name | Type | Owner
--------+--------+-------+-------
public | table0 | table | ciro
(1 row)View table schema: stackoverflow.com/questions/109325/postgresql-describe-tableoutput:
psql testdb0 -c '\d+ table0' Table "public.table0"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+---------------+-----------+----------+---------+----------+--------------+-------------
int0 | integer | | | | plain | |
char0 | character(16) | | | | extended | |Insert some data into it and get the data out:output:
psql testdb0 -c "INSERT INTO table0 (int0, char0) VALUES (2, 'two'), (3, 'three'), (5, 'five'), (7, 'seven');"
psql testdb0 -c 'SELECT * FROM table0;' int0 | char0
------+------------------
2 | two
3 | three
5 | five
7 | seven
(4 rows)Delete the table:
psql testdb0 -c 'DROP TABLE table0;' Science communicator Updated 2025-07-16
Visual math HTML book Updated 2025-07-16
When you see some tagged examples, you will immediately know what this means.
Cyclotron Updated 2025-07-16
Predecessor to the synchrotron.
Debugger Updated 2025-07-16
Decay chain Updated 2025-07-16
Decompiler Updated 2025-07-16
nth root Updated 2025-10-14
Nuclear chain reaction Updated 2025-07-16
Open access Updated 2025-07-16
Definite matrix Updated 2025-07-16
Nuclear magnetic resonance Updated 2025-07-16
Ciro Santilli once visited the chemistry department of a world leading university, and the chemists there were obsessed with NMR. They had small benchtop NMR machines. They had larger machines. They had a room full of huge machines. They had them in corridors and on desk tops. Chemists really love that stuff. More precisely, these are used for NMR spectroscopy, which helps identify what a sample is made of.
Introduction to NMR by Allery Chemistry
. Source. - only works with an odd number of nucleons
- apply strong magnetic field, this separates the energy of up and down spins. Most spins align with field.
- send radio waves into sample to make nucleons go to upper energy level. We can see that the energy difference is small since we are talking about radio waves, low frequency.
- when nucleon goes back down, it re-emits radio waves, and we detect that. TODO: how do we not get that confused with the input wave, which is presumably at the same frequency? It appears to send pulses, and then wait for the response.
How to Prepare and Run a NMR Sample by University of Bath (2017)
Source. This is a more direct howto, cool to see. Uses a Bruker Corporation 300. They have a robotic arm add-on. Shows spectrum on computer screen at the end. Shame no molecule identification after that!This video has the merit of showing real equipment usage, including sample preparation.
Says clearly that NMR is the most important way to identify organic compounds.
- youtu.be/uNM801B9Y84?t=41 lists some of the most common targets, including hydrogen and carbon-13
- youtu.be/uNM801B9Y84?t=124 ethanol example
- youtu.be/uNM801B9Y84?t=251 they use solvents where all protium is replaced by deuterium to not affect results. Genius.
- youtu.be/uNM801B9Y84?t=354 usually they do 16 radio wave pulses
NMR spectroscopy visualized by ScienceSketch
. Source. 2020. Decent explanation with animation. Could go into a bit more numbers, but OK. Nuclear triad Updated 2025-07-16
There are unlisted articles, also show them or only show them.