This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .bash_profile | |
# Get the aliases and functions | |
if [ -f ~/.bashrc ]; then | |
. ~/.bashrc | |
fi | |
# User specific environment and startup programs | |
#export JAVA_HOME=/etc/alternatives/java_sdk_1.7.0_openjdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Enter XML as a heredoc, pipe it to xmllint, and run an XPath query. | |
cat <<EOF | xmllint --xpath /catalog/product[@type=\"cloths\"] - | |
<?xml version="1.0"?> | |
<!DOCTYPE catalog SYSTEM "catalog.dtd"> | |
<catalog> | |
<product type="cloths" product_image="cardigan.jpg"> | |
<catalog_item gender="Men's"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"javaType": "model.Game", | |
"properties": { | |
"data": { | |
"id": "data", | |
"properties": { | |
"about_the_game": { | |
"id": "about_the_game", | |
"type": "string" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> curl 'http://172.20.11.177:50070/jmx?qry=Hadoop:service=NameNode,name=NameNodeStatus' | |
{ | |
"beans" : [ { | |
"name" : "Hadoop:service=NameNode,name=NameNodeStatus", | |
"modelerType" : "org.apache.hadoop.hdfs.server.namenode.NameNode", | |
"State" : "active", | |
"NNRole" : "NameNode", | |
"HostAndPort" : "localhost:19000", | |
"SecurityEnabled" : false, | |
"LastHATransitionTime" : 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This causes certain versions of the JVM to enter an infinite loop. | |
// For more details, see: | |
// http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/ | |
// http://www.exploringbinary.com/fpupdater-fixes-the-java-2-2250738585072012e-308-bug/ | |
public class JavaFloatingPointBug { | |
public static void main(String[] args) { | |
System.out.println("Test:"); | |
double d = Double.parseDouble("2.2250738585072012e-308"); | |
System.out.println("Value: " + d); |