April Fools Pranks with a Squid Proxy Server

Introduction Note: This guide was tested using Ubuntu Server 14.04.4 LTS. This is a HowTo for setting up Upside-Down-Ternet on Ubuntu. Basically, when a user browses the web, all the images are flipped upside-down. While it's not useful, it's quite a good April Fool's prank. The process uses a transparent proxy, web server, and script to flip the images. Web traffic is routed to the proxy, instead of the default gateway, which is intercepted by the proxy which then downloads and modifies the images and then serves them back to the client browser. Setting up the Proxy The proxy used in this guide is Squid v3.3.8. The IP of this server is 192.168.113.253. Installation Configuration Edit the configuration file located in…

Continue Reading

Random Projection

Introduction In mathematics and statistics, random projection is a technique used to reduce the dimensionality of a set of points which lie in Euclidean space. Random projection methods are powerful methods known for their simplicity and less erroneous output compared with other methods. According to experimental results, random projection preserve distances well, but empirical results are sparse. Consider a problem as follows: We have a set of n points in a high-dimensional Euclidean space \(\mathbf{R}^d\). We want to project the points onto a space of low dimension \(\mathbf{R}^k\) in such a way that pairwise distances of the points are approximately the same as before. Formally, we are looking for a map f:\(\mathbf{R}^d\rightarrow\mathbf{R}^k\) such that for any pair of original points u,v,\(\|f(u)-f(v)\|\)

Continue Reading

Decision Tree

What’s decision tree? A decision tree is a flowchart-like structure in which each internal node represents a "test" on an attribute (e.g. whether a coin flip comes up heads or tails), each branch represents the outcome of the test and each leaf node represents a class label (decision taken after computing all attributes). The paths from root to leaf represents classification rules. Overview A decision tree is a flowchart-like structure in which each internal node represents a "test" on an attribute (e.g. whether a coin flip comes up heads or tails), each branch represents the outcome of the test and each leaf node represents a class label (decision taken after computing all attributes). The paths from root to leaf represents…

Continue Reading

Introduction to Java Virtual Machine (JVM)

NOTE: We look at HotSpot in this article, other JVM might behave differently. What is JVM? The Java Virtual Machine is the cornerstone of the Java platform. It is the component of the technology responsible for its hardware- and operating system-independence, the small size of its compiled code, and its ability to protect users from malicious programs. The Java Virtual Machine is an abstract computing machine. Like a real computing machine, it has an instruction set and manipulates various memory areas at run time. The JVM doesn't understand Java typo, that's why you compile your *.java files to obtain *.class files that contain the bytecodes understandable by the JVM. JVM control execution of every Java program. It enables features such as automated…

Continue Reading

Use Server-Sent Event in Spring 4.2

Today, the Spring Framework released to 4.2 RC2. In Spring 4.2, better application events and Server-Sent Event(SSE) are supported. In this article, I'll introduce you the two new features. What's Server Sent Event Server-sent events (SSE) is a technology where a browser receives automatic updates from a server via HTTP connection. The Server-Sent Events EventSource API is standardized as part of HTML5 by the W3C. Server-sent events is a standard describing how servers can initiate data transmission towards clients once an initial client connection has been established. They are commonly used to send message updates or continuous data streams to a browser client and designed to enhance native, cross-browser streaming through a JavaScript API called EventSource, through which a client…

Continue Reading

Use WebSockets with Spring, SockJS and Stomp

This guide walks you through the process of creating a "hello world" application that sends messages back and forth, between a browser and the server. WebSocket is a very thin, lightweight layer above TCP. It makes it very suitable to use "subprotocols" to embed messages. In this guide we’ll dive in and use STOMP messaging with Spring to create an interactive web application. Maven Dependencies First we need to add the Spring messaging modules in the POM file: Spring MVC Configuration Next, we need to add the message broker config to the Spring MVC config XML file. The main thing here is the set up of the message broker for handling the message exchange between the server and its clients. This…

Continue Reading
Contact Us
  • Room 311, Zonghe Building, Harbin Institute of Technology
  • zjhzxhz[at]gmail.com