Monday, August 6, 2012

Well done, Oracle. Go Groovy!

I just wanted to download the JDK and look what welcomes you at the Oracle website:


Friday, June 15, 2012

Thursday, June 7, 2012

ByteArrayOutputStream.toString() human readable

I can do this for a readable output:

public class Changer {
    public static void main(String[] args) {
        try {
        java.io.InputStream in = new java.io.FileInputStream(new java.io.File("DBSDashboard.XML"));
        java.io.OutputStream out = new java.io.ByteArrayOutputStream();
        org.jdom2.input.SAXBuilder builder = new org.jdom2.input.SAXBuilder();
        org.jdom2.Document document = (org.jdom2.Document) builder.build(in);
        org.jdom2.Element rootNode = document.getRootElement();
        org.jdom2.Element ccc= rootNode.getChild("CallCentreClosed").getChild("callCentreClosed");
        ccc.setText("true");
        /* or, ccc.setText("false") */
        org.jdom2.output.XMLOutputter xmlOutputter = new org.jdom2.output.XMLOutputter();
        xmlOutputter.setFormat(org.jdom2.output.Format.getPrettyFormat());
        xmlOutputter.output(document, out);
        System.out.println(out);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

And voila:



 
    false
 
(...)

Good to know.

Sunday, June 3, 2012

MKP, y u no have English?!


Az előbb - unalomból - megnéztem az MKP hivatalos honlapjának angol nyelvű verzióját. A jobb felső sarokban: random kép. Csáky-Bugár dwa bratanki, azaz két jó szivar. Pártszakadás volt? Ezek szerint nem. So keep smiling.

Monday, April 23, 2012

Ubuntu open router

ip_forwarding = 1
sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

... think about your network design before you start kicking your head against the wall.
Poor external router does not know anything about internal addresses.
Fsck.

Wednesday, February 1, 2012