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 […]

Setting opacity/transparency on elements using JavaScript

Here’s a short snippet to set the opacity of an element: function setOpacity(e,opacity){ var; o.opacity=(opacity/100); //Opera o.MozOpacity=(opacity/100); //Mozilla+Firefox o.KhtmlOpacity=(opacity/100); //Konqueror o.filter=”alpha(opacity=”+opacity+”)”; //IE } Use it like this: var e=document.getElementById(’myElement’); setOpacity(e, 50);//Sets the opacity to 50% [tags]JavaScript[/tags]

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 […]

Use DocumentViewer instead of Document Properties

Thomas tipped about the DocumentViewer Notes ”Smart Icon” application, that can be used to inspect the fields of a document. It’s easier to find values you’re looking for, and it allows copying of both multiple values and field names. I have written a similar application for use on the web, but DocumentViewer is great if […]

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. […]

Lotusphere Comes to You i Sverige

Den 8 mars kommer Lotusphere till Sverige! Närmare bestämt till IBM på Oddegatan i Kista. Ed Brill kommer att medverka som talare. Själv har jag redan anmält mig, det kan du också göra!

Cross browser DynamicSelect JavaScript class

When developing web applications, select-boxes are usually involved in the UI. I’ve put together a custom JavaScript class to handle things like removing, adding and selecting elements. By the way, Matt Kruse has a bunch of nice JavaScript libraries! Example: var e=new DynamicSelect(’MySelect’); e.removeAll(); e.append(’Entry 1’,”); e.append(’Entry 2’,”); e.selectAll(); e.unselectAll();’Entry 2’); e.toggleAll(); if(e.contains(’Entry 1’)){ […]

Replacing No documents found

This has been done before. Here is my contribution: /** * Replaces \”No Documents Found\” with a custom text. * * @author Johan Känngård, * @param message the text to replace with * */ function replaceNoDocumentsFound(message){ var h2=document.getElementsByTagName(\’h2\’); if(h2!=\’undefined\’&&h2.length>0&&h2[0]!=\’undefined\’) { var oldTextNode=h2[0].firstChild; var newTextNode=document.createTextNode(message); h2[0].replaceChild(newTextNode,oldTextNode); } } Put the function in the HTML Head […]

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; import lotus.domino.AgentBase; import net.kanngard.xml.XMLEchoer; public class JavaAgent extends AgentBase { public void NotesMain() { try […]