-
Calculating the intersection of two Java sets
This is my simple stupid Java tip for the day: to nondestructively calculate the intersection of two Set’s (ie, retain both object), do the following: Set intersection = new HashSet(s1); intersection.retainAll(s2); Taken from Java Tutorials. Lessons learned: before implementing code which even vaguely seems that it should already exists, check with your favorite search engine.…
-
Fiddling with the comment system
My friend Dan D. mentioned that the new inline commenting system wasn’t playing nice with NoScript. After a little looking into it I found that indeed, Blogger is using JS to render the form (why?). To reduce the pain a little I’ve added a link to the old method of leaving comments which should appear…
-
Mixed links
Via /dev/random: the story of a fictitious penetration testing. Very interesting, eager to read the rest. From Kim Cameron’s Identity blog: Leaving a comment (with CardSpace / IdentityCards). The first time you do this it takes a whopping 11 steps! I fail to see how this is better than current systems or OpenID. (I’m talking…
-
Enumerations in Java
Starting to (professionally) program in Java, one of the things which bugged me were the constant declarations in classes which implemented struct-like idioms: class Foo { public static final int FOO_1 = 1; public static final int FOO_2 = 2; public static final String FOO_3 = “42”; … The code referencing this seems even more…
-
Anti Malware Testing Guidelines
Via the ESET blog: the guidelines for testing Anti-Malware products were published by AMTSO (the Anti Malware Testing Standards Organization). Go and read them if you are so inclined (each of them consists of only 5 pages – you have to give them props for brevity – although maybe they just wanted to avoid being…
