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
1. List[+T] is convariant | |
2. def ::(elem child):List[me] ----> List[child] < List[me) | |
3. def ::[parent >: me](x: parent):List[parent] ----> parent::List[me] returns List[parent] | |
scala> class parent | |
defined class parent | |
scala> class me extends parent | |
defined class me |
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
/** | |
* create Events.Groovy under directory <grails-project>/scripts | |
**/ | |
eventCreateWarStart = {warName, stagingDir -> | |
//def wd = grailsSettings.projectWorkDir | |
println "###eventCreateWarStart [${stagingDir}]" | |
def today = System.currentTimeMillis() | |
def spt_js_dir= "spt_${today}" | |
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
<project> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.mycompany.myproject</groupId> | |
<artifactId>my-app</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<name>My App</name> | |
<properties> | |
<org.springframework.version></org.springframework.version> | |
</properties> |
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
#!/bin/sh | |
# daily backup for gradle in gradle project | |
cd C:/x/y/z | |
find . -name "build.gradle" -print0 2>/dev/null | xargs -0 --replace cp -P {} C:/a/b/c/d/gradle-dayily-back |
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
/** | |
* http://stackoverflow.com/questions/13459718/could-not-serialize-object-cause-of-hibernateproxy | |
* | |
* in bootstrap: | |
* import hbadapter.HibernateProxyTypeAdapter | |
* | |
* class BootStrap { | |
* | |
* def init = { servletContext -> | |
* |
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
/** | |
* in grails-app/resource/spring/resource.groovy | |
* beans = { | |
* hibernateProxyAdapterFactory(hbadapter.HibernateProxyAdapterFactory) | |
* } | |
* | |
*/ | |
package hbadapter; | |
import org.hibernate.proxy.HibernateProxy; |
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
/** | |
http://stackoverflow.com/questions/17370176/webapplicationinitializer-is-not-launched-on-jettyselenium | |
*/ | |
public class WebappConfig implements WebApplicationInitializer { | |
protected final Logger logger = LoggerFactory.getLogger(getClass()); | |
@Override | |
public void onStartup(final ServletContext servletContext) throws ServletException { |
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 t; | |
import org.glassfish.jersey.server.ResourceConfig; | |
import org.glassfish.jersey.server.spring.SpringLifecycleListener; | |
import org.glassfish.jersey.server.spring.scope.RequestContextFilter; | |
import org.glassfish.jersey.test.JerseyTest; | |
import org.glassfish.jersey.test.inmemory.InMemoryTestContainerFactory; | |
import org.junit.Test; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.context.ApplicationContext; |
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
task addToWar(type: Jar) { | |
destinationDir = file('dist') | |
archiveName = 'drools-guvnor.war' | |
from zipTree('ss/drools-guvnor.war') | |
from(file("ss/RRR.txt")) { | |
into ('META-INF') | |
} | |
} |
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 me; | |
import java.util.Enumeration; | |
import java.util.Properties; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: chris | |
* Date: 7/4/14 | |
* Time: 3:54 PM |
OlderNewer