Blog
Thoughts on programming, systems, robotics, and everything in between, sharing what I learn and build.

HashMap Internal Implementation Analysis in Java
HashMap is one of the most common topics in Java interviews, and “How does HashMap work?” has a deceptively simple one-line answer: “On the principle of hashing.” To say anything more, you need to know how hashing works and how HashMap applies it internally. This post assumes you already know the basics of using a HashMap; if not, start with the official Java docs. The walkthrough below uses the pre-Java-8 source as its baseline; wherever Java 8+ changed the implementation, an inline Note flags it.
WordPress $ is not defined
If you copy a normal jQuery snippet into a WordPress theme or plugin, sooner or later you hit Uncaught ReferenceError: $ is not defined. The confusing part is that jQuery itself is loaded; your other jQuery code may even be working. So why does $ blow up? Why It Happens WordPress ships its own copy of jQuery and loads it in no-conflict mode. On startup it effectively runs: jQuery.noConflict(); noConflict() tells jQuery to give back control of the global $. After it runs, jQuery still points to the library, but $ no longer does; it is left free for some other library to claim.
Getting Started with Hadoop 2.0
Apache™ Hadoop® is an open source software project that enables the distributed processing of large data sets across clusters of commodity servers. It is designed to scale up from a single server to thousands of machines, with a very high degree of fault tolerance. Rather than relying on high-end hardware, the resiliency of these clusters comes from the software’s ability to detect and handle failures at the application layer. Hadoop 1 popularized MapReduce programming for batch jobs and demonstrated the potential value of large scale, distributed processing. MapReduce, as implemented in Hadoop 1, can be I/O intensive, not suitable for interactive analysis, and constrained in support for graph, machine learning and on other memory intensive algorithms. Hadoop developers rewrote major components of the file system to produce Hadoop 2. To get started with the new version, it helps to understand the major differences between Hadoop 1 and 2.
HTTP Protocol
What’s HTTP? HTTP stands for Hypertext Transfer Protocol. It’s the network protocol used to deliver virtually all files and other data (collectively called resources) on the World Wide Web, whether they’re HTML files, image files, query results, or anything else. HTTP allows communication between a wide variety of hosts and clients, and supports a mixture of network configurations. To make this possible, it assumes very little about a particular system and keeps no state between message exchanges; this is why HTTP is called a stateless protocol. Communication usually takes place over TCP/IP sockets, though any reliable transport can be used. The standard (and default) port is 80, but a server can listen on any port.
Integrate Spring MVC with Log4j
Integrating Log4j into a Spring MVC application is quite straightforward: include the Log4j library in your project dependencies, then create a log4j.properties file to define Log4j’s appenders and put it on the project classpath. This tutorial walks through that with the Log4j 1.x logging framework. Note: This post targets Log4j 1.x, which reached end of life in August 2015 and has known vulnerabilities (e.g. CVE-2019-17571, CVE-2021-4104). Treat it as a reference for maintaining legacy projects only. For anything new, prefer SLF4J + Logback (the default in Spring Boot) or Log4j 2.x. Their configuration and API differ entirely from what’s shown here, and the official link below now redirects to Log4j 2.
How does Ajax Work
Ajax, a term coined by Jesse James Garrett that became popular after the publication of the article Ajax: A New Approach to Web Applications in February 2005, is short for Asynchronous JavaScript and XML. The normal behavior of the Internet that involves sending pages to the browser is completely changed by the use of Ajax. Ajax has become commonplace with its integration in HTML 5 and JavaScript frameworks, and in fact, the interest of developers has moved to HTML 5 for its new tags and APIs that accompany it. Among these, WebSocket appears as the successor to Ajax, because it is a superior means of communication between an application and the server or the backend.
Unit Testing for Spring MVC Controllers
Once the services, DAO, and supporting classes are tested, it’s time for the controller. Controllers are often the hardest layer to test, so many developers (based on observation) reach for Selenium or, worse, test by hand. That works, but it makes exercising individual logic branches awkward and slow, and no one wants to wait for a browser to spin up before checking in code. The Spring MVC Test framework solves this by driving full controller logic through fast unit tests, and it has lived in Spring’s core ever since Spring 4.
Spring 4 MVC Hello World Tutorial Using Maven
In this tutorial we build the smallest useful Spring MVC application: a controller that reads a request parameter and renders it in a JSP view. It is the classic “Hello World”, but the wiring it shows (a DispatcherServlet, a bean configuration, and a view resolver) is the same wiring every larger Spring MVC application is built on. Note: This tutorial has been updated for Spring Framework 7. It was originally written in 2014 for Spring 4 and the javax.* servlet API; the configuration below now uses the jakarta.* namespace, drops the Eclipse-specific setup for a plain Maven command, and runs on Jakarta EE 11 (Tomcat 11+). We keep XML configuration and web.xml so every piece of the wiring stays visible. The same beans map one-to-one onto a @Configuration class if you prefer Java config.