Libera #java

Getting a usable, non-localhost IP address for a JVM

I recently had a task where I needed to inform a docker image of the host OS’ IP address. (The docker image needed to make an HTTP call to the host machine, for testing purposes.) However, it’s not trivial to find code to actually get a host machine’s IP address. Here’s some code in Kotlin (and in Java) to accomplish the task; I can’t say it’s perfect (and won’t...

2 minute(s) read

Interesting Links – 2017/Jun/12

picocli, a command-line parser. Apache-licensed; seems similar to JCommander with fewer dependencies. 9 Logging Sins in your Java Applications details, well, nine possible logging problems. It’s stuff worth thinking about. Five Things You Didn’t Know About… Java Database Connectivity, from IBM developerworks, walks through some things about JDBC that you might not have known. I learned about at least two things that were added since the last time I took a...

1 minute(s) read

Interesting Links – 2017/Jun/5

iciql is a type-safe, model-based wrapper for JDBC… another entry in a fairly large set of libraries designed for that purpose. “Cassandra vs. MongoDB” walks through the two datastores, comparing and contrasting. DZone published “What Archive Format Should You Use, WAR or JAR?“, suggesting that Docker makes .war files more relevant again. Need to extract an HTML page’s main content? Consider Snacktory.

1 minute(s) read

Interesting Links – 2017/May/25

How Fonts are Fueling the Culture Wars is an article talking about, well, font usage and what specific fonts mean, which has only a tangential relation to Java — but think about it in terms of user experience, too. Do you think the user experience of Java communicates a specific mode of thought? If so, what would it be? (And no, “Duhhhh” is not a valid answer!) From DZone: The Soon-to-Be-Hated Object Locator...

2 minute(s) read

Interesting Links – 8/May/2017

Excellent advice for developers who design APIs, no matter who is consuming those APIs: “Building for Builders: Stripe’s 8 Tips for Designing APIs and Supporting Developers“ Artificial intelligence is everywhere these days. Here’s “Every single Machine Learning course on the internet, ranked by your reviews“ A cool discrete mathematics library, written in Kotlin: KotlinDiscreteMathToolkit. From DZone: Understanding When to Use RabbitMQ or Apache Kafka. Short form: RabbitMQ is for lazy developers; AMQP message...

2 minute(s) read

DropWizard Metrics Advice

I was working on an application with DropWizard, and I was having trouble getting my own metrics to show up in the display. The Metrics Getting Started is useful, and it actually showed me what I needed, but didn’t make it obvious enough for me. What I needed was, in DropWizard Metrics parlance, a “meter.” This gives me performance data over time; basically, every time an event happens, I’d mark it and thus...

2 minute(s) read

Interesting Links – 2017/May/1

Crafting perfect Java Docker build flow, which addresses the “bare minimum you need to build, test and run my Java application in Docker container.” Also relevant: manorrock/maven, a docker container that delivers a specific version of Maven / OpenJDK for Continuous Integration purposes. From DZone: Using Java 8? Please Avoid Functional Vomit “The Complete Beginners’ Guide to Artificial Intelligence” is a very high-level view of AI. It won’t teach you much about AI...

2 minute(s) read

Interesting Links – 2017/Apr/26

Yes, it’s been a while, I’ve been busy and I’m the only curator of this content: Courtesy of The Introduction of Java Memory Leaks, Javosize, the “free next generation java profiler” — and a commercial product, Plumbr (with a free trial available.) On Optional.isEmpty()… – a fascinating email from Dalibor Topic. Great and funny reading. Courtesy of selckin, Stephen Colebourne has a series on the Java Platform Module System. More on Java 9...

1 minute(s) read

LinkedList vs. ArrayList

Recently, The Java Programmer published “Difference between ArrayList and LinkedList in Java“, asserting different cases of when to prefer one List implementation over another. It’s a link full of conventional wisdom, and while it has some good information, it’s also wrong. Here’s the channel’s factoid on LinkedList, as of 2017/Apr/25 (prior to it having been changed to point to the page you’re reading): LinkedList is almost always slower...

7 minute(s) read