Managing logging with Log4j and Chainsaw

Those of you who haven’t used System.out.println(”My variable: ” + myVariable) in some Java classes to get debug information to the console, raise your hands please. None? 😉 I am very fond of logging as a complement to debugging, since I can ”trace” actions in my programs even if the classes is in production. ”But […]

g33k date

I was a key speaker at the first g33k date ever yesterday, and it was Ekakan that held the meeting in their small but great office at Saltmätargatan in Stockholm. Quite a lot showed up, many of which I know by name, but not by face, since they are all bloggers with no pictures at […]

Sammanfattning av Lotusphere Comes To You

Detta är i korthet vad som sades under halvdagen den 8:e mars i Kistam som IBM valt att kalla Lotusphere Comes to You. Presentationerna som visades finns att hämta hos IBM. Inledningstal av Ed Brill Det var kul att se Ed Brill pÃ¥ hans första besök i Sverige! Han presenterade siffror som visar att Lotusphere […]

Remove characters in a Java String

Here is a simple method (actually two) for removing multiple characters from a String: /** * Removes the specified characters from the supplied String. * * @param s the String to remove characters in. * @param a the characters to remove from the supplied String. * @return the String stripped from all the supplied characters. […]

Echo XML from a file, String or InputStream in Java with SAX

Here is an example how to use the XMLEchoer class, that I have refurbished from Sun’s tutorial Echoing an XML File with the SAX Parser. It is of limited use, but can be a good start learning SAX. import java.io.PrintWriter; import lotus.domino.AgentBase; import net.kanngard.xml.XMLEchoer; public class JavaAgent extends AgentBase { public void NotesMain() { try […]

String to InputStream

Arguments in many methods in the Java APIs are of the type InputStream. This is how to get an InputStream from a String, where argument to getBytes, UTF-8, is the encoding to use: InputStream is = new ByteArrayInputStream(myString.getBytes(”UTF-8”)); [tags]Java[/tags]

Java versions in Lotus Domino and Notes

1.0 to 3.x: N/A 4.5 to 4.6.7a: JRE/JDK 1.1 5.0 to 5.0.13a: JRE/JDK 1.1.8 6.0 to 6.5.6: JRE/JDK 1.3.1 7.0 to 7.0.3: JRE/JDK 1.4.2 8.0 to 8.0.1: JRE/JDK 1.5.0 IBM also has a list of supported JDKs and JREs. Old JDK/SDK/JRE versions can be downloaded at java.sun.com. [tags]Java, Lotus Domino, Lotus Notes[/tags]

StringUtils class in Java

Goodies like explode, leftback, rightback, switchcase, implode, middle, trim, unique etc. can be found in this utility class. The Commons Lang project at Apache Jakarta also has some really great stuff. Chad Schelfhout gave me a correction for the implode(Object[], String):String method and the new method word(String, String, int):String. StringUtils.java CollectionUtils.java NumberUtils.java

Creating Domino agents with Netbeans

Introduction Netbeans is an open source IDE, that is created and executed in a Java environment. It is a flexible and powerful IDE, and if you are tired of the lack of debugging capabilities for Java in the Lotus Domino Designer client, you may want to look at Netbeans. In this short tutorial, I will […]