admin on November 12th, 2007

SELECT
        ‘nameValue’ AS “@name”,
        CAST(’<!– your comment –>’ AS XML),
        ‘anotherValue’ AS “another”,
        (SELECT ‘i’ AS “@name”, ‘1′ AS “@value” FOR XML PATH(’item’), TYPE),
        (SELECT ‘j’ AS “@name”, ‘2′ AS “@value” FOR XML PATH(’item’), TYPE)
FOR XML PATH(’sample’), ROOT(’root’)

output

<root>
  <sample name=”nameValue”>
  [...]

Continue reading about SQL 2005 generates XML comment, array of elements

admin on November 1st, 2007

/**
 * @author R
 * 1+2+3+4 …. + 99+100 = 5050
 */
public class Main {
    /** Creates a new instance of Main */
    public Main() {} 

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
    {
        System.out.println(recursiveAdd(100));
    }

    public [...]

Continue reading about Java simple recursion