https://www.gravatar.com/avatar/f819a092b23cb25a09f87436f68df217?s=240&d=mp

Ang Gao

Software Engineer @ TripAdvisor, CS Ph.D @ University College Cork

JavaScript Note Eleven

HTTP Sending a request 1 2 3 4 5 6 7 8 9 var req = new XMLHttpRequest(); req.open("GET", "example/data.txt", false); req.send(null); consle.log(req.responseText); // → This is the content of data.txt console.log(req.status, req.statusText); // → 200 OK console.log(req.getResponseHeader("content-type")); // → text/plain If we pass true as the third argument to open, the request is asynchronous. 1 2 3 4 5 6 var req = new XMLHttpRequest(); req.

Hadoop: Build Apache Hadoop 2.5.2 in CentOS 6.7

Install build tools 1 2 3 4 5 6 yum install gcc yum install gcc-c++ yum install make yum install cmake yum install openssl-devel yum install ncurses-devel Install Maven 1 2 3 4 5 wget http://ftp.heanet.ie/mirrors/www.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz tar -xzvf apache-maven-3.3.3-bin.tar.gz export MAVEN_HOME=/opt/apache-maven-3.3.3 export PATH=$MAVEN_HOME/bin:$PATH mvn -v Install protobuf 1 2 3 4 5 6 7 8 wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2 tar -xjvf protobuf-2.

JavaScript Note Ten

JavaScript and the Browser In HTML, an ampersand (&) character followed by a word and a semicolon (;) is called an entity, and will be replaced by the character it encodes. A script tag must always be closed with </script>, even if it refers to a script file and doesn’t contain any code. If you forget this, the rest of the page will be interpreted as part of the script.

Hadoop 1.x Cluster Setup (MapReduce only)

Purpose This document describes how to set up and configure a 3-nodes Hadoop 1.x MapReduce cluster. For HDFS setup Hadoop 1.x Cluster Setup (HDFS only) Hadoop MapReduce Config config mapred-site.xml 1 2 3 4 5 6 <configuration> <property> <name>mapred.job.tracker</name> <value>node1:9001</value> </property> </configuration> copy configs to slaves 1 2 3 # From node1 scp /home/hadoop-1.2/conf/* root@node2:/home/hadoop-1.2/conf scp /home/hadoop-1.2/conf/* root@node3:/home/hadoop-1.2/conf start MapReduce 1 /home/hadoop-1.

Hadoop 1.x Cluster Setup (HDFS only)

Purpose This document describes how to set up and configure a 3-nodes Hadoop 1.x Distributed File System (HDFS) cluster. Prerequisites 3 CentOS 6.x VMs In the following examples I have three nodes: node1: 192.168.0.11 node2: 192.168.0.12 node3: 192.168.0.13 The finally setup will be: NameNode: node1 Secondary NN: node2 DataNode: node2 node3 Steps Followings steps are for: CentOS 6.7, Hadoop-1.2.1 Installing Software (3 nodes) Install Java 7 1 2 3 4 5 tar -xzvf jdk-7u79-linux-x64.

JavaScript Note Nine

The Document Object Model scans a document for text nodes containing a given string and returns true when it has found one 1 2 3 4 5 6 7 8 9 10 11 12 13 function talksAbout(node, string) { if (node.nodeType == document.ELEMENT_NODE) { for (var i = 0; i < node.childNodes.length; i++) { if (talksAbout(node.childNodes[i], string)) return true; } return false; } else if (node.nodeType == document.