Thursday, September 1, 2016
AWK: Hashtag Safe String Function
Command:
$ cat twitter_hash_safe_string.awk
Result:
function twitter_hash_safe_string(hashStr)
{
gsub(/^[0-9]+/,"", hashStr);
gsub(" ", "", hashStr);
gsub("\\.", "", hashStr);
gsub("'", "", hashStr);
gsub("%", "", hashStr);
gsub(/"/, "", hashStr);
gsub("\\(", "", hashStr);
gsub("\\)", "", hashStr);
gsub("&", "And", hashStr);
gsub("-", "", hashStr);
gsub("=", "", hashStr);
gsub(">", "", hashStr);
gsub("<", "", hashStr);
gsub("\\$", "S", hashStr);
gsub("\\/", " #", hashStr);
gsub(",", " #", hashStr);
gsub(":", " #", hashStr);
gsub(";", " #", hashStr);
return hashStr;
}
$ cat twitter_hash_safe_string.awk
Result:
function twitter_hash_safe_string(hashStr)
{
gsub(/^[0-9]+/,"", hashStr);
gsub(" ", "", hashStr);
gsub("\\.", "", hashStr);
gsub("'", "", hashStr);
gsub("%", "", hashStr);
gsub(/"/, "", hashStr);
gsub("\\(", "", hashStr);
gsub("\\)", "", hashStr);
gsub("&", "And", hashStr);
gsub("-", "", hashStr);
gsub("=", "", hashStr);
gsub(">", "", hashStr);
gsub("<", "", hashStr);
gsub("\\$", "S", hashStr);
gsub("\\/", " #", hashStr);
gsub(",", " #", hashStr);
gsub(":", " #", hashStr);
gsub(";", " #", hashStr);
return hashStr;
}
Wednesday, August 31, 2016
Tuesday, August 30, 2016
Ruby: Print Out Multiple Lines
Command:
$ printf "1,name1,address1\n2,name2,address2" | ruby -e "while status = STDIN.gets do = STDIN.gets do
print status
end"
Result:
1,name1,address1
2,name2,address2
$ printf "1,name1,address1\n2,name2,address2" | ruby -e "while status = STDIN.gets do = STDIN.gets do
print status
end"
Result:
1,name1,address1
2,name2,address2
Friday, August 26, 2016
Thursday, August 25, 2016
Wednesday, August 24, 2016
Leonard Susskind: "ER = EPR" or "What's Behind the Horizons of Black Holes?"
- Correlation (相関)
- ER (Einstein, Rosen)
- EPR (Einstein, Podolsky, Rosen)
- ER is about geometry
- EPR is about quantum entanglement
- EPR paradox (アインシュタイン=ポドルスキー=ローゼンのパラドックス)
- Albert Einstein
- Boris Podolsky
- Nathan Rosen
- They are appearantly nothing to do with each other
- They are actually deeply connected
- Computational complexity
- Qubits
- |↑↓> - |↓↑>
- Bell pair
- Correlation
- Entanglement is a form of correlation
- Coin correlation: You didn't really know everything about the system that you could have known, that in principle could be known
- Low energy radio wave with couple of quanta in it, and those quanta might bounce off the objects and record which one was which without making any difference to the experiment. Classical mechanics is like that.
- Quantum mechanics, when you look at something you cause it to change.
- Peculiar thing about entanglement:
- You know everything about the system that can be known, but you know nothing about either of the constituents. That's the notion of entanglement.
- Entangle states are very special, they do characterize what quantum about quantum mechanics. Almost everything strange about quantum mechanics traces back to entanglement.
- So entanglement is not restricted to small objects. Large scale objects can be entangled.
Even just empty space is entangled |
- In fact even just empty space is entangled.
- |0 0> - |1 1>
- This is the form of entanglement that's there in empty space between parts of space.
- Scale invariant
- Conformal invariant
- Space is zip together by entanglement
- Contiguous
- Adjasant
- Entanglement has another nice feature: monogamy.
- Alice, Bob, and Charlie
- Entanglement is monogamous
- AMPS paradox
- Paradox about black hole and entanglement
- Two entangled black hole
- Conflicts of principle when they are unravel often lead to the biggest advances in understanding of physics.
- Violation of principle of equivalence (等価原理)
A and B' are the same thing |
- Geometry of the interior of black hole
- ER
- Einstein Rosen Bridge
- Space-time map of black hole
- Kruskal black hole
- Penrose diagram of black hole
Spacetime map of black hole |
Subscribe to:
Posts (Atom)