Title: Method for returning the base URL of a java.net.URL object Author: Bruno Borges Organization: Oracle Owner: Bruno Borges Created: 2013/01/15 Type: Feature State: Draft Exposure: Open Component: core/net Scope: SE
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 TDCOnCamelRoute extends RouteBuilder { | |
@Override | |
public void configure() throws Exception { | |
String accessToken = System.getProperty("twitter.accessToken"); | |
String accessTokenSecret = System.getProperty("twitter.accessTokenSecret"); | |
String consumerKey = System.getProperty("twitter.consumerKey"); | |
String consumerSecret = System.getProperty("twitter.consumerSecret"); | |
TwitterComponent tc = new TwitterComponent(); | |
tc.setAccessToken(accessToken); |
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
class TDCOnCamelRoute extends RouteBuilder { | |
val accessToken = System.getProperty("twitter.accessToken") | |
val accessTokenSecret = System.getProperty("twitter.accessTokenSecret") | |
val consumerKey = System.getProperty("twitter.consumerKey") | |
val consumerSecret = System.getProperty("twitter.consumerSecret") | |
val tc = new TwitterComponent() | |
tc.setAccessToken(accessToken) | |
tc.setAccessTokenSecret(accessTokenSecret) | |
tc.setConsumerKey(consumerKey) |
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
class TDCOnCamelRoute extends RouteBuilder { | |
val accessToken = System.getProperty("twitter.accessToken") | |
val accessTokenSecret = System.getProperty("twitter.accessTokenSecret") | |
val consumerKey = System.getProperty("twitter.consumerKey") | |
val consumerSecret = System.getProperty("twitter.consumerSecret") | |
val tc = new TwitterComponent() | |
tc.setAccessToken(accessToken) | |
tc.setAccessTokenSecret(accessTokenSecret) | |
tc.setConsumerKey(consumerKey) |
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
SEVERE: Error serializing object class code.webapp.pages.Index [object=[Page class = code.webapp.pages.Index, id = 3, render count = 1]] | |
org.apache.wicket.core.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate | |
Field hierarchy is: | |
3 [class=code.webapp.pages.Index, path=3] | |
private code.services.Service code.webapp.pages.Base.service [class=code.services.ScalaObject$Service$918758560$Proxy$_$$_Weld$Proxy$] | |
javassist.util.proxy.MethodHandler code.services.ScalaObject$Service$918758560$Proxy$_$$_Weld$Proxy$.methodHandler [class=org.jboss.weld.bean.proxy.ProxyMethodHandler] | |
private org.jboss.weld.bean.proxy.BeanInstance org.jboss.weld.bean.proxy.ProxyMethodHandler.beanInstance [class=org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance] | |
private final javassist.util.proxy.MethodHandler org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.methodHandler [class=org.jboss.weld.bean.proxy. |
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 sample; | |
// imports | |
@MessageDriven(mappedName = "jms/queue0") | |
public class MessageSelectorBean implements MessageListener { | |
@Resource(lookup = "jms/connectionFactory") | |
ConnectionFactory connectionFactory; |
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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); |
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
<domain log-root="${com.sun.aas.instanceRoot}/logs" application-root="${com.sun.aas.instanceRoot}/applications" version="12"> | |
<system-applications/> | |
<applications /> | |
<resources> | |
<jdbc-connection-pool connection-validation-method="auto-commit" | |
validation-table-name="SYS.SYSALIASES" | |
allow-non-component-callers="true" | |
connection-leak-reclaim="true" | |
lazy-connection-association="true" |
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 static URL getBasePath(URL url) throws MalformedURLException { | |
int lastSlash = url.getFile().lastIndexOf('/'); | |
if (lastSlash == -1) { | |
return url; | |
} | |
String path = url.getFile().substring(0, lastSlash); | |
URL basePath = new URL(url.getProtocol(), url.getHost(), url.getPort(), path); | |
return basePath; |
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
@Grab('org.codehaus.groovyfx:groovyfx:0.3.1') | |
import static groovyx.javafx.GroovyFX.start | |
final int ROW_COUNT = 10 | |
final int COL_COUNT = 10 | |
final int RADIUS = 20 | |
final int DIAMETER = 2 * RADIUS | |
final int MOVE_WAY = 8 * DIAMETER | |
final int WIDTH = COL_COUNT * DIAMETER + MOVE_WAY | |
final int HEIGHT = ROW_COUNT * DIAMETER |