Since the previous water analysis from 2005, I’ve since bought a house, which means the Champlain Water District sends me a report about how their water is the best water. Of note to me as a homebrewer is the analysis of certain chemical properties of the water. Since a few google searches for this information basically turned up my previous post and not the actual source of the data, here’s the data:
- aluminum: < 0.06ppm
- color: 2 units
- alkalinity: 42-56 ppm as CaCO3
- calcium hardness: 45-56 ppm as CaCO3
- total hardness: 61 ppm as CaCO3
- chloride: 17ppm
- foaming agents: < 0.1 ppm
- total organic carbon: 2.22 pm (1.60-3.1)
- conductivity: 189 micro-S/cm (163-208)
- pH: 7.56 (7.29 – 7.89)
- total disolved solids: 113 ppm
- iron: < 0.01ppm
- manganese: .007ppm
- sodium: 7.5ppm
- potassium: 1.31 ppm
- sulfate: 15 ppm
- silver: < 0.05ppm
- silica: 1.4ppm
- silicon: 0.67 ppm
- bromide: < 0.010 ppm
- iodide: < 1 ppm
- flouride: 0.97 ppm (0.71 – 1.21)
- ammonium ion: 0.20 ppm (0.04 – 0.048)
Java5 now has language support for iteration of the form:
for (Type var : someIterable) { ... }
As well, there is now an Iterable<t> interface, and Arrays are directly iterable, allowing you to write:
String[] thingys = {"a","b","c"};
for (String thingy : thingys) { ... }
At work, we have a collection of utility iterators, most written before these were available. As such, we have an ArrayIter utility, and a ZipIterator, inspired by Python’s itertools.izip.
I’ve been going through these classes and their usages on a lazy basis to update them to the new syntax. I finally got around to a usage of the ZipIterator, which happened to compose an ArrayIter … it zipped together an array of String names with the results of a test.
So, I changed it to:
String[] names = { "foo", "bar", "baz" };
List results;
for (Object[] pair : new ZipIterator(names, results))
{
// ...
No dice, says Java:
/home/jsled/stuff/work/[...]TestMumble.java:46: cannot find symbol symbol : constructor ZipIterator(java.lang.String[],java.util.List)
location: class com.spokesoftware.util.iterator.ZipIterator
for (Object pairObj : new ZipIterator(data, results))
WTF? Okay, let me help you out:
for (Object[] pair : new ZipIterator((Iterable)names, results))
// ...
FUCK YOU, says Java:
/home/jsled/stuff/work/[...]/TestMumble.java:46: inconvertible types
found : java.lang.String[]
required: java.lang.Iterable
for (Object pairObj : new ZipIterator((Iterable)data, results))
It turns out that the string “iter” isn’t even in the text of the section about Arrays in the Java Language Spec. Array instances aren’t Iterable. They’re a special case in the handling of the for-each loop syntax.
This code ended up as:
for (Object pair : new ZipIterator(Arrays.asList(names), results))
Java is totally shitrude.
edit 2009-10-10: added some formatting/syntax highlighting of the java blocks