Skip to content

Instantly share code, notes, and snippets.

@bchetty
bchetty / highcharts_demo.xhtml
Created March 25, 2016 21:20
highcharts_demo.xhtml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@bchetty
bchetty / CookieClicker.java
Created April 24, 2014 21:15
GCJ 2014 - CookieClicker problem solution with Recursion
package com.bchetty.gcj2014;
import java.text.DecimalFormat;
/**
* GCJ 2014 - Cookie Clicker Alpha problem solution with Recursion
*
* @author Babji, Chetty
*/
public class CookieClicker {
@bchetty
bchetty / Inception.java
Created April 24, 2014 20:48
Java - Recursion Depth
**
* Inception
*
* @author Babji, Chetty
*/
public class Inception {
public static void main(String[] args) {
Inception inception = new Inception();
inception.dream(0);
}
@bchetty
bchetty / DeceitfulWar.java
Created April 24, 2014 11:46
GCJ 2014 - 'Deceitful War' problem solution
package com.bchetty.gcj2014;
import java.util.Iterator;
import java.util.TreeSet;
/**
* GCJ 2014 - 'Deceitful War' problem solution
*
* @author Babji, Chetty
*/
@bchetty
bchetty / CookieClicker.java
Created April 24, 2014 11:39
GCJ 2014 - 'Cookie Clicker Alpha' problem solution
package com.bchetty.gcj2014;
import java.text.DecimalFormat;
/**
* GCJ 2014 - 'Cookie Clicker Alpha' problem soultion
* @author Babji, Chetty
*/
public class CookieClicker {
@bchetty
bchetty / MagicTrick.java
Created April 24, 2014 11:07
GCJ 2014 - Magic Trick Problem
package com.bchetty.gcj2014;
import java.util.ArrayList;
import java.util.List;
/**
* GCJ 2014 - Magic Trick Problem
*
* @author Babji, Chetty
*/
@bchetty
bchetty / Run.java
Created May 31, 2013 21:19
Simple Java program to execute Mac-OS commands (For Ex: To open a Finder Window) through a Java program.
import java.io.IOException;
/**
* Simple Java program to execute Mac-OS command (For Ex: To open a Finder Window) through a Java program.
*
* @author Babji, Chetty
*/
public class Run {
public static void main(String[] params) throws IOException {
Runtime.getRuntime().exec(new String[] {"open", params[0]});
@bchetty
bchetty / CaliperTest1.java
Created May 24, 2013 21:31
Simple Caliper Benchmark test program.
import com.google.caliper.Param;
import com.google.caliper.Runner;
import com.google.caliper.SimpleBenchmark;
import java.util.HashMap;
/**
* Simple Caliper Benchmark test program.
*
* @author Babji Prashanth, Chetty
*/
@bchetty
bchetty / SpiralWalking.java
Created May 24, 2013 21:26
Spiral Walking in a rectangular grid.
public class SpiralWalking {
public static void main(String[] args) {
SpiralWalking sw = new SpiralWalking();
String res[][] = sw.walkSpirally(10,10);
for(int i=0;i<10;i++) {
System.out.println();
for(int j=0;j<10;j++) {
System.out.print(res[i][j] + " ");
}