-
I recently stumbled upon what is just about the best thing since I first discovered the wonders of maven – the ability to add javascript dependencies in your pom.xml using webjars. Like this:
12345<dependency><groupId>org.webjars</groupId><artifactId>bootstrap</artifactId><version>3.0.3</version></dependency>Maven will manage their sub-dependencies and your web pages can access the scripts direct from the jars. Lovely. Sign me up! Except… Read more »
-
An interesting question about StringTokenizer popped up on stackoverflow the other day. It was essentially about how to optimise reading delimitated data, in this case lines of integers separated by lines of spaces. It demonstrated three things. Don’t fixate on micro-optimisations when you probably have big bottlenecks elsewhere String.split() is really slow The difference is… Read more »
-
It’s one of those simple UI things that make a real difference. You have to be pretty special to be able to instantly convert 45742364 bytes into 43.6MB in your head. Enter some great code snippets I’ve discovered on StackOverflow that do this. This four line wonder is top answer to that question (from Mr… Read more »
-
Well, here’s a thing. Imagine you have some XML or JSON that looks like a map, only you don’t know the names or number of the properties in advance. For example:
1234<A><B>b</B><C>c</C></A>Or some JSON that looks like this:
1{"B":"b","C":"c"}How can you do it? Using Jackson @JsonAnyGetter and @JsonAnySetter . All you need is the XML root… Read more »
-
I’ve only been on StackOverflow for a short while and already feel like I’m drowning under the the sheer quantity of people asking how to parse CSV. Most of them start in one a few ways. So, for the record, here’s how you don’t do it. Don’t use regular expressions That’s right. You don’t use… Read more »
-
CSV should be defined somewhere, right? You should be able to tell if CSV is well formed? WRONG. This is going to be the first post of many on CSV, the devils own file format. Here’s the closest you can get to a specification of the CSV format, the RFC for the CSV MIME type…. Read more »
Close