Friday, February 5, 2016

Python: Print Hello

$ python -c 'print "hello"'

Version of PHP

$ php --version
PHP 5.5.30 (cli) (built: Oct 23 2015 17:21:45)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

Version of Perl

$ perl --version

This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)

Copyright 1987-2013, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

Version of AWK

$ awk --version
awk version 20070501

Version of Ruby

$ ruby --version
ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]

Version of Python

$ python --version
Python 2.7.10

Thursday, February 4, 2016

AWK: Number of Words

Printing the number of words in lines without newline:

$ awk 'BEGIN {words=0}{words+=NF} END { printf "%i", words} ./lines.txt

AWK: Number of Lines

print out number of lines without newline:

$ awk 'BEGIN {} END { printf "%i", NR }' ./lines.txt

Get a Random Line from CSV file

First line in a CSV file contains column names, so I ignore the line and get a line after it:

$ head -$[$[${RANDOM} % $[`wc -l < ./lines.csv` - 1]] + 2] ./lines.csv | tail -1

Wednesday, February 3, 2016

Tweeting Random Line in CSV, Formatted Using AWK

Tweeting random entry in list.txt. 2nd, 3rd, and 4th column in comma-separated value is used:

$ head -$[${RANDOM} % `wc -l < ./list.txt` + 1] ./list.txt | tail -1 | awk -F, '{print $4"("$2")"$3}' | ruby ./tweet.rb

Tuesday, February 2, 2016

Michio Kaku: On Democracy

Michio Kaku

Leonard Susskind: Are Science and Religion at War?

Leonard Susskind

Leonard Susskind: How Do Particles Explain the Cosmos?

Leonard Susskind

Theoretical Physicists and Its MD5 Hash Values

b9114dc37ab93677d533a0e3e025ee58,A. P. Balachandran
cfcfe15d6ecdfdef505b97ef2c3f9369,Abdul Qadeer Khan
dfb8265818ad7018ec4b7542baec7ad1,Abdus Salam
98a719bf14b8a3e84d74da977c94d63b,Al-Biruni
ebc17b94b9c494a8de085dcfe575d3ab,Al-Farabi
7560afa1f46d5e5fefe4ad93e42a293d,Albert Einstein
595707a5bcf0fa37ffc38cadd1a72305,Alexander Zamolodchikov
608847d7f19ea79773069a210cefca85,Alexei Alexeyevich Abrikosov
9fd439b6ed1e68942caa0e18756331c3,Alexei Kitaev
0d716d6e74cff4a2a8f465ca3b09a8b7,Alexei Yuryevich Smirnov
2341c8b7b62e1c04f24429fca77a2229,Alexei Zamolodchikov
ff2ca5c27ebbbc7d5f3a9d599d34026a,Ali Chamseddine
2d9a36cce07a72b66b1490e08720527f,Ali Javan
b80ac69e686b6704bfd279bfc1dc912f,Ali Moustafa Mosharafa
6403e0d05b243931fc80bfd7f57eab61,Anatoly Vlasov
a8603cc3c6d192bad70a934b1e944fdb,Anthony James Leggett
81b524745aec6711264774a15dfa6149,Antony Garrett Lisi
d0efefe9e6fde31efa3dfef0df1b9f1b,Archimedes
6919301d00f7a13c7a0e6658dae03a4e,Arnold Sommerfeld
76e9eb8ab6ce7e60c604bd179f1c144a,Arsenij Sokolov
80a1b0138a537058d3e04c2a98063fca,Arthur Eddington
71d6c39b895f05dfab6c679396270bc3,Arthur Compton
7b1f6178b9fdd53d5c517e6af0f0b276,Ashoke Sen
b938cd2d03bc88480c911d4756f0b04a,Ayşe Erzan
0a29495fe0147dfc84bda0c1501d793d,Behram Kurşunoğlu
a7fb1c5d8508a12ceb22b0026cd085a1,Blaise Pascal
8f499893b9e7c40d045a8ab0793b37dd,Brian Josephson
d5acb3519390a19b2bce9f4b4757cb34,Brian Greene
e6ad9901bfe4625d09acdd38913d4986,Bruno Zumino
906467d996dbe4b734771da3e2fea741,C. R. Hagen
d94bff8c65b98ddb3d85888218fef48d,Carlo Rovelli
8e4f0530893bbbb17986087ca3230ded,Carlos E.M. Wagner
97603bbba50de86ec755f7e33c4179c2,Charles-Augustin de Coulomb
4e41bdd7d7e8c48628ba4748e63dc4fd,Charles Thorn
3bc553fae759c92317bc4caf2a320440,Chen-Ning Yang
ddd20964ae1519f38767de9d8c3a13e7,Christiaan Huygens
982ea65a3943420055ccf3a3725ebc36,Christopher T. Hill
d94c803ac9ecb593296f394d06de8c4a,Cumrun Vafa
fba0776f7e258ac7c283838cf6a9de42,Đàm Thanh Sơn
d5c49c3cbdae21fc0f12f99dc8bcc046,Daniel Z. Freedman
897535581528185af98edc4156b6405e,David Bohm
b6fe46a666859b91c7730413b6723164,David Deutsch
d986902968dbef876880a2a74e9d136b,David Gross
b71592ed48f29a2f5c3b2f95ffd16567,Democritus
b3397bcab5767afbbc69fe9c0669e54e,Dennis W. Sciama
4642441bc389837e3e3a92d3202d8be5,Dimitri Nanopoulos
ab972465f8728d94cdf5c4c821d7d3c3,Dmitry Shirkov
1f8b3abf4393ccbcd0e0fdf144b315bc,Dmitry Zubarev
f568ce68aafc43b1e5ba187a47c80600,Durmus A. Demir
242094a6fc8ba39642576f1340163be1,Edward Witten
24ba105d6c0defd87c58ccb1da94a101,Emmy Noether
a6c915efff92e3313596bc9e86aa6636,Enrico Fermi
7666fc3342812ddfa2bad1fd1a25d7d4,Erdal İnönü
9fd850a91ae79f91c3e3b597d93f13ce,Ernest Rutherford
53223338cf930500fda4a892f1e2a892,Ernst Mach
6fef6eadd7fc0afa92a4cf2ed5cf8609,Erwin Schrödinger
b4671d195baffc41fed648cbbef55c6f,Ettore Majorana
807d62774463f42888869745ab92fb93,Eugene Wigner
1925b431d9bf8a23107c69045a489e53,Ezra T. Newman
ed8a9a906b96912c31ba5fdfbeb7a13b,Fazlur Rahman Khan
67d660f80c08afa368e574bba0439676,Felix Bloch
08b6976977f7a1d545adeb887c9c917d,Feza Gürsey
d0cacf359c4dddb4bc79fab3c8b27511,Francisco José Ynduráin
2eb0b81bd7287e6c57b1ab0816176cc4,Frank Wilczek
60b6dfe97a9e16d76a9abc59673e0b99,François Englert
f370745c55cb9523f3708ad7dc39200c,Freeman Dyson
8a830cc5a00aac6ba7b64028a84be384,Friedwardt Winterberg
d0919d96a544d3f2e1585b056d2f90b2,Fulvio Melia
dfe6c369253b6a534d7384a5084f24c1,Galileo Galilei
7e7d7da2e89e59873d4cb8fedfab218a,George Eugene Uhlenbeck
1500d1252c7cf70fef7d1b314b4f7491,George Gamow
10f32156adaa52712b3e5d37358365e8,E. C. George Sudarshan
54ec70ad491eb9033cd6f0097a550821,Georges Lemaître
2e2f77d6dd3e0ad33893739ab8de85ea,Gerald B. Cleaver
6e62b2f626e9a5506e8c911916f02037,Gerald Guralnik
dafb27e7315a9a371bced84d12fa6c22,Gerardus 't Hooft
6d8c9682ecd8298b4f456ff44e3e8c79,Gian Francesco Giudice
e6a9a86edf9bd8332cf942b11ef1ca45,Goran Senjanovic
76e45ffe483d19457d7d8e63aa58279e,Gottfried Wilhelm Leibniz
4b74480a31f4dfc464ba4aca7bf691e4,Gurgen Askaryan
38c43a6cf91da19a1ecf8333e03a616c,Hans Bethe
2eb37f670716bc42d12bab706c4fd75f,Harold E. Puthoff
ef0f0e925845860a1007031227c63265,Heinrich Hertz
2ad8a762be7fc4addfb84ce5ca84386d,Hendrik Lorentz
4f0212f08792f7d3717dfb6c4be8ec4a,Henri Poincaré
43bda38fd479756a6912a1c343a074d6,Hermann von Helmholtz
abd5173afab239ecf1374f242947a7aa,Hideki Yukawa
853758ec75ef8d1ddced1437016395c9,Holger Bech Nielsen
7304ccd854a8d04bdf87e1b2cc490086,Howard Georgi
afbd685b333479428193397138ad5756,Hugh David Politzer
8c1f94fc68c3ea2d8b4e9d56e220e3fb,Alhazen
54a183d4649be35dc3fb861dcd2dd48a,Igor Klebanov
edc037f19d611ce512001d97aca5f667,Igor Tamm
5383dc912768d17f1f08f051c98c4049,Igor Ternov
c3c32a17825ae857ef8b6378cbf78557,Ilya Frank
d28b9a449997497a8aff846f010ee478,Isaac Newton
898ea2a9c4a48a9014201ad0936cc1e1,J. Hans D. Jensen
8832527767e21eff275cfad06a54e343,Josiah Willard Gibbs
6f51f2a9060ce3d1d544983644b06783,Jacques Villain
9a862897171711daf90a32b5268619a0,James Clerk Maxwell
be403e9325e756d160afff82a6513e72,James Hopwood Jeans
440790823fe50c90de36d1e9d75520e2,Jeffrey Goldstone
cf659a3a2608ecc97dee24e7df593a46,Johannes Kepler
058f4c3dfea0a505da15b3d597459b2a,John Bardeen
0421f97b0fb9b5ee0b278adf91854553,John Cardy
851068ba448bbc43054092e63879f3e1,John G. Cramer
698701398eee80e15427ffbe53579c65,John Henry Schwarz
4ee1b2f8fc636bdd19477079cb386f69,John Iliopoulos
0c96a8a4f8ab2cf875aa633b1c684a06,John Robert Schrieffer
c42a8435312cf90f5009ccefeb05ad29,John Archibald Wheeler
aef6dcb07688a0987ea4b5a2807fc13c,Joseph Fourier
872c7412e0c8a00ee31d03b905acd98e,Joseph-Louis Lagrange
d3da4bf59f0989ab6ceb7317c0c77a2d,Joseph Lykken
f4f13f9c381985f3d45bd54a4a2a9521,Joseph Polchinski
4c6036bd3ee2030ba7c4df4d4f1a59d9,José Enrique Moyal
f619b04e322f0771c2e22b546132cd7b,José W. F. Valle
3a128320701826665d745acd25056bfc,João Magueijo
5c6e9635ecbcf3ec6241b497883a9473,Juan Martín Maldacena
4250ddb9744335a819b3299151d53485,Julia Yeomans
718c733cf8839542804ab466d2092fb7,Julian Schwinger
e219d561429770d6804dd2708a92f67d,Julius Wess
db49ed9dc78a6e9c5f5850f9e9be8bc1,Jürg Fröhlich
dfe3230188ff0b7debdcadb95364fb47,Kenneth G. Wilson
ec1462e30cf8b30c3b4f4bc5d491363a,Kip Thorne
f09dcbad07f5fe30d5fda604b0b3452a,Kurt Binder
93c32669df9739f234b3c0d4e957e76e,Kyriakos Tamvakis
15f0e42101ebd9973440bd131c1c48f9,Lawrence M. Krauss
13624fd0a2754ddad08718b3f8b71559,Lee Smolin
54fd4342fa25d4aa2c378a59bd5de4f5,Leo Kadanoff
189c0c2d45e04ac2ddff26fca9351c7d,Leon Cooper
ed79eb81dc5f2b2a5b98f7ea7c89668f,Leonard Susskind
26541fa14131a05970fa9d63f71ba2b8,Leonhard Euler
af489eb1614bbea93d5fcd40a4e4f11e,Lev Landau
fbd110413e9d45c427cdf680f3298a8f,Leo Szilard
a4bf3a2d13a0142e9ae92f58ab66659d,Lisa Randall
4dee7193ee1f103ffb59e5001226b906,Louis de Broglie
29e17564a3b9c74f7c01ea135340d467,Luciano Maiani
0476f1d53cc5e520216161c2486fad53,Ludvig Faddeev
f5f7406bd985fba06bb9c0c9b7d42a3d,Ludwig Boltzmann
0f3477357b3f7468b8ac79e1990a0879,Mahmoud Hessaby
1a2e66953dc2b96cef22a9c9dfdb1dfa,Makoto Kobayashi
407f7d2deb926984510c734ac76e4eb1,Marcela Carena
c1721ba95759112743c3d395514c22ef,Maria Goeppert-Mayer
8ee140eab9e0fc6fc162ba80793e9b06,Marie Curie
4129de7696215e62db94dbee5d920c1e,Mark B. Wise
9e972b3393959afcba6ab3ccf12be3e6,Martin Gutzwiller
f48c4c49d5010551e807d5ed21b58981,Martinus J. G. Veltman
4faccafed2c68ed9a668f377fb0906e0,Max Born
53e1a1c444e0ea85ca57a200a7f41865,Max Planck
07ee5055af7a909021d9824b93f9d149,Max von Laue
66277347b1546e6ea48cdd68069fafe6,Maxim Chernodub
8d9f4f111628cc5def70a2018351cf7a,Mehran Kardar
173c696b32466380f2696d72f0fbcc76,Michael Faraday
82a1f6cce038aff5466ef1309e675c37,Michael Green (physicist)
a682c579a09a5126fe68e2b4bf4a8851,Michael R. Douglas
0472a6b640a92798b8199cba8f7d9370,Michio Kaku
7582fee605092b74c93ac56dc4d3f0d9,Miguel Alcubierre
deb42b129ed6316dfaf4def0353f5e34,Munir Ahmad Khan
a2d2e87a589b8e212653a14961aa9f7d,Munir Nayfeh
012187d0d6e13808cdfa62f1303b84dd,Murray Gell-Mann
0161db4e7e441611e22d7197134844ca,Nasir al-Din al-Tusi
851bda897bde0f6a9234cc079f2150e7,Nathan Seiberg
db335e355d388e3c4271dbb3b3fdbc4e,Nicola Cabibbo
533ee47f448a5225b2f9d8fe915c855f,Nicolaus Copernicus
1615641382ac64498a9fe887d57caa9d,Niels Bohr
55b33e6a3a72a36cae0f0fb7658f402e,Nihat Berker
b4f4e4e34ee3ab44abe04fbd81d42f81,Nikolay Bogolyubov
1a6537c0bebc35f22d75d08dcc93153d,Nikolay Umov
b9f4a4ad0217eb76d25d0477c208a53c,Nima Arkani-Hamed
495156bc67192ee5e4dffb0a7fd5ed11,Omar Khayyam
da67503d69b917dbc929ec7c452e7c99,Pascual Jordan
d35cdf9fb8e9cdcd7dbb165c97090b6c,Paul Ehrenfest
0787f05a75ac3a740ee37367b8766d39,Tatyana Afanasyeva
2e46e9850eb8dcbaf97cdaa3ec7db430,Paul Dirac
a879ce21dec405294d9b9f053322381f,Paul Frampton
e0f9d8be917be63dffbd80eabe2ddb4a,Paul Steinhardt
51d5458e46b1e0af6ae911232952a4ac,Peter Freund
6979883d1a591efc1a469722858cfffc,Peter Higgs
30db10e14804d345980e2026cef3a6ff,Peter Westervelt
09f198d60ef6800f9feeef4d4fc9ddf2,Peter van Nieuwenhuizen
48e102dc5bf2aff3b7aef1911c03414f,Philip Warren Anderson
c34a0d486dff0ee0593c30416698666a,Pierre Ramond
962b846cdf906791c781fca7617d05c1,Pieter Zeeman
25500c6fca0386ffca8ea49da96164fc,Pran Nath
66d762ec0d7ca78267a67df2968af60d,Pythagoras
f2e3f0554d41901dca600bbe689db196,Raman Sundrum
a47e6a74e95cb8c2d322ad7d29b51112,Ratko Janev
05f6df7d8d2ee4163e2fe0a148f7e119,Reinhard Oehme
20b6f700aca6ab4064b94b5efe787514,René Descartes
6dac31029a5161aa558454753d406003,Revaz Dogonadze
854088230f991d69af49999144d80d0e,Riazuddin (physicist)
f9ebab092ff2695b3da2908ed760d5e1,Richard Arnowitt
749908863ff956e6a20115ad1ffc69ae,Richard Feynman
f8f41908d2cd95e519b5802d5123d757,Richard H. Price
6cfc8c39d3e34a5a660a5d3846ad1d55,Richard C. Tolman
03ad0e7c493aaeabaa0fcee686c14a02,Robert B. Laughlin
831e688c1787245dfc154632b3cbaa7e,Robert Brout
1b5cc9ea27ef661ffa7b32ca6f0138f5,Robert H. Dicke
cda62208c50c01aca00412993ccc7219,J. Robert Oppenheimer
3262f8ab3f5a4c706146d682d262b37d,Roger Penrose
eda9f3b63ec3823743704c9b634b97b5,Roy J. Glauber
a0849765de39fbfbb3acea8046969e31,Sameera Moussa
38c4a019fa85c928d3eec8be5dd34255,Samuel Abraham Goudsmit
0dbdb6af7b9ef5ef07e1788ff65a3603,Sankar Das Sarma
491b1dd363dd7679c512e3a73a0d8be7,Satyendra Nath Bose
2fc7dc97be0bd1326eff768bc12d0ed1,Sergei Tyablikov
77274478fea5cd3ee586ca89e7455f24,Sergio Ferrara
aee782877b0eb266573f9af74f4b16c8,Sheldon Glashow
5a5b535478d20093a6e34781bbb46155,Sin-Itiro Tomonaga
49f5c0f7fbb74fdded231e70e172ac9d,Stanislav Mikheyev
2ee9b2e31d16752b24d2f89ac602fc63,Stanley Deser
48f2ea0218ea493254413227568de127,Stanley Mandelstam
4e43bbc2dc5ff177fe9efe480d84f8bd,Stephen Hawking
97898506da11745d1febdeaeded34dfd,Stephen Parke
fc95978b7451f359f8708ba3538e8d1e,Steven Gubser
1d9dd9a8a515df915060229ee32e20d0,Steven Weinberg
7c10bb488dc088815105faf3a52b0f06,Subrahmanyan Chandrasekhar
e5ce94d2217e3ab99edfa00f4eb4c9fa,Sultan Bashiruddin Mahmood
6bd52ee880579d84286bd9d893db4fa7,Sylvester James Gates
5b988cc88c1aab0467f5c03f79841131,Tekin Dereli
285e760d157c12307ebe65137ca7300b,Thales
938dccecb8c4aa9d51c14339e7712288,Thomas Young
abf8099a6b4f83574fb49120d8cc3583,Tom Kibble
51ee0577bcafce905651baf3d573da1c,Toshihide Maskawa
09e42fe5016ab22b37173f50dccc74dc,Tsung-Dao Lee
0a96f113bb44d0179c08082293b1d876,V. Balakrishnan
944c95da73eaa44f3b29cdae1d0d7ae9,Valery Pokrovsky
fcc616925d1265e493614ae38c03805c,Viatcheslav Mukhanov
d79a9aba12fe78b53d3bf05e250ee185,Victor Popov
83c53c8fac59d4b79043a303a1dd5fe7,Viktor Ambartsumian
3883228a8b6d1a07a20f0581394629c2,Vitaly Ginzburg
0f6034f3662093c10b098382871bd22a,Walter Selke
a31342c3f642d32227fc5f2d382aadae,Werner Heisenberg
074c22b29b41efadbb3b354d75d7daf7,William Alfred Fowler
d6b637ecc071edd00fd8123794ada906,William Rowan Hamilton
3b034439de2fad641d43980f3fd3c799,William Thomson
45afa0b9b382c7a60817402503f9794d,Wojciech H. Zurek
e9aa3f55bf5fcf116962f8dd71b4f277,Wolfgang Pauli
ef3510c500873eca88f5b56647ce26eb,Xiao-Gang Wen
ce1cdfbfbb971aa0c042e8761e5ed69b,Yoichiro Nambu
84b3a8aa340bbc82ecc128963d287228,İsmail Hakkı Duru