IP2Location: A Free IP Database — Java Client and BIN File Downloads
This post uses the IP2Location LITE database and queries it by reading the BIN file directly. The code is a trimmed-down version of the official sample, published to Maven Central.
108 posts
This post uses the IP2Location LITE database and queries it by reading the BIN file directly. The code is a trimmed-down version of the official sample, published to Maven Central.

The China edition of GitLab, operated by JiHu Information Technology (Hubei) Co. and branded "JiHu", focuses on enterprise DevOps. I was lucky enough to join the SaaS beta — here's my look at the domestic version of JiHu.

Google has long supported proactive URL submission, but it's not a point-and-click UI for ordinary users — it's an API for programmers. Plenty of webmasters aren't developers, and since Google requires ownership verification, I can't just build a UI where people paste their own private key. Instead I wrapped Google's API to make it easier to use.

Last time we learned synchronized thread coordination, which is enough to build real things — the most classic being the producer-consumer model. One producer keeps making resources, one consumer keeps taking them, two threads simulating that relationship, like a chef and a server: the chef keeps cooking, and the server takes the dish away once it's plated.

Anyone who's touched multithreading has heard the synchronized keyword. We'll start with a broken example to show what happens without it, fix it with synchronized, and then let synchronized lead us into deadlock.

Let's be clear about this: Java threads have 6 states. Online — including the copy-paste crowd on CSDN who mindlessly repost who-knows-what — everyone says 5. I went and read the docs myself, and I'm certain it's 6.

Last time we looked at the Thread class and the Runnable interface, but that pairing has one problem: no return value. If we want the thread to hand a value back, we need FutureTask and Callable, which is what this post covers.

Last time we talked broadly about why we need multiple threads. Now that we want to study concurrency, let's create threads ourselves and dig into its mysteries.

What's the relationship between high concurrency and multithreading? I never create threads in my code, so why does everyone start talking about multithreading the moment the subject comes up? My opening post digs into why we should learn multithreading, and how high concurrency turns into multithreading.

This post serves as the index for the Java intermediate/advanced programming series. I also wanted to raise my own skill level, so I decided to start learning and sharing some genuinely advanced material.
