This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.bchetty.charts.model; | |
import java.util.List; | |
/** | |
* | |
* @author Babji Prashanth, Chetty | |
*/ | |
public class Series { | |
private String name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.bchetty.charts.controller; | |
import com.bchetty.charts.model.Series; | |
import com.google.gson.Gson; | |
import java.text.SimpleDateFormat; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import java.util.List; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] + " "); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Scope(ScopeType.STATELESS) | |
@BypassInterceptors | |
@Install(precedence = Install.APPLICATION, dependencies = "org.jboss.seam.security.identity") | |
@Name("org.jboss.seam.core.resourceLoader") | |
public class DatabaseResourceLoader extends ResourceLoader { | |
@Override | |
public ResourceBundle loadBundle(String bundleName) { | |
return new ResourceBundle() { | |
public Enumeration<String> getKeys() { | |
//Locale locale = org.jboss.seam.core.Locale.instance(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<pluginrepositories> | |
<pluginrepository> | |
<name>oss.sonatype.org</name> | |
<id>oss.sonatype.org</id> | |
<url>http://oss.sonatype.org/content/groups/public</url> | |
</pluginRepository> | |
</pluginRepositories> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<build> | |
<plugins> | |
<plugin> | |
<groupid>net.alchim31.maven</groupId> | |
<artifactid>yuicompressor-maven-plugin</artifactId> | |
<executions> | |
<execution> | |
<goals> | |
<goal>compress</goal> | |
</goals> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<build> | |
<plugins> | |
<plugin> | |
<groupid>org.apache.maven.plugins</groupId> | |
<artifactid>maven-shade-plugin</artifactId> | |
<version>1.4</version> | |
<executions> | |
<execution> | |
<phase>package</phase> | |
<goals> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.math.BigInteger; | |
public class BigIntTest { | |
public static void main(String[] args) { | |
BigInteger bigInt1 = new BigInteger("1000000000000000"); | |
BigInteger bigInt2 = new BigInteger("1000000000000500"); | |
//Loop from bigInt1 to bigInt2 | |
for(BigInteger bigInt = bigInt1; bigInt.compareTo(bigInt2) < 0; bigInt = bigInt.add(BigInteger.ONE)) { | |
System.out.println("I'm so big now : " + bigInt); |