Skip to content

Instantly share code, notes, and snippets.

View karanmalhi's full-sized avatar

Karan Singh Malhi karanmalhi

  • MuleSoft
  • San Francisco
View GitHub Profile
@karanmalhi
karanmalhi / isapi_redirect.properties
Created December 6, 2011 21:24
The properties file which ties everything together.
#tomcat will be the name of the virtual directory under IIS
extension_uri=/tomcat/isapi_redirect.dll
#location of the log file
log_file=C:\inetpub\isapi\logs\isapi_redirect.log
log_level=debug
#location of worker.properties
worker_file=C:\inetpub\isapi\conf\worker.properties
#location of uriworkermap.properties
worker_mount_file=C:\inetpub\isapi\conf\uriworkermap.properties
@karanmalhi
karanmalhi / gist:1230754
Created September 20, 2011 23:45
Can't assign requeted address
SEVERE: Error starting endpoint
java.net.BindException: Can't assign requested address /172.16.10.170:60001
at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:549)
at org.apache.tomcat.util.net.JIoEndpoint.start(JIoEndpoint.java:565)
at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:203)
at org.apache.catalina.connector.Connector.start(Connector.java:1095)
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:277)
at com.mulesoft.tcat.agent.web.AgentServlet.doCreateSecureConnector(AgentServlet.java:225)
at com.mulesoft.common.agent.servlet.AbstractAgentServlet.createSecureConnector(AbstractAgentServlet.java:245)
at com.mulesoft.common.agent.servlet.AbstractAgentServlet.pair(AbstractAgentServlet.java:129)
@karanmalhi
karanmalhi / Test.java
Created July 28, 2011 14:54
Template class
package learnquest;
public class Test {
public static void main(String[] args) {
}
}
@karanmalhi
karanmalhi / samples.txt
Created June 24, 2011 18:39
svn repo for spring samples
https://anonsvn.springframework.org/svn/spring-samples
https://github.com/SpringSource
@karanmalhi
karanmalhi / eclipse.ini
Created June 24, 2011 18:36
example eclipse.ini file
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.2.R36x_v20101222
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
@karanmalhi
karanmalhi / InnerclassExample.java
Created June 23, 2011 17:38
Anonymous inner class example
package com.lq;
public class InnerClassExample {
public static void main(String[] args) {
Driver d = new Driver();
Car c = new Car();
d.operate(c);
d.operate(
// anonymous Inner class
new Driveable(){
@karanmalhi
karanmalhi / GenericsExample.java
Created June 21, 2011 13:51
Simple example on generics
package com.lq;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
public class GenericsExample {
public static void main(String[] args) {
@karanmalhi
karanmalhi / CreditCardType.java
Created June 20, 2011 15:21
Example of an advanced enum
package com.lq;
public enum CreditCardType {
VISA("111-22-3333") {
@Override
public boolean isValid() {
System.out.println("Validating a " + this.name());
return false;
}
@karanmalhi
karanmalhi / ProxyFactory.java
Created June 14, 2011 18:59
The proxy creation mechanism
package learnquest;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class ProxyFactory {
@karanmalhi
karanmalhi / Reversable.java
Created June 14, 2011 18:58
Basic interface and its impl
package learnquest;
public interface Reversable<T> {
T reverse(T str);
}
class StringReverser implements Reversable<String> {
@Override
public String reverse(String str) {