Skip to content

Instantly share code, notes, and snippets.

View dhinojosa's full-sized avatar

Daniel Hinojosa dhinojosa

View GitHub Profile
@dhinojosa
dhinojosa / TypeConstraint.sh
Created March 19, 2012 20:19
Scala call to view more information about generalized type constraints
scala -Xprint:typer -e "implicitly[Int =:= Int]"
@dhinojosa
dhinojosa / richfaces-error.txt
Created May 17, 2012 03:12
Output from JBAS-7.1.1 with regards to rich faces
20:59:35,766 WARN [org.jboss.seam.security.permission.PersistentPermissionResolver] (MSC service thread 1-5) no permission store available - please install a PermissionStore with the name 'org.jboss.seam.security.jpaPermissionStore' if persistent permissions are required.
20:59:35,908 INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-5) Initializing Mojarra 2.1.7-jbossorg-1 (20120227-1401) for context '/test-seam'
20:59:40,971 INFO [org.hibernate.validator.util.Version] (MSC service thread 1-5) Hibernate Validator 4.2.0.Final
20:59:43,273 WARN [org.jboss.modules] (MSC service thread 1-5) Failed to define class org.ajax4jsf.webapp.taglib.EmptyHandler in Module "deployment.test-seam.war:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/ajax4jsf/webapp/taglib/EmptyHandler (Module "deployment.test-seam.war:main" from Service Module Loader)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)
at org.jboss.modules.ModuleClassLoa
@dhinojosa
dhinojosa / error-dependency.txt
Created May 18, 2012 17:40
Dependency issue richfaces
11:38:09,393 INFO [org.jboss.seam.Component] (MSC service thread 1-8) Component: org.jboss.seam.web.redirectFilter, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.web.RedirectFilter
11:38:09,395 INFO [org.jboss.seam.Component] (MSC service thread 1-8) Component: org.jboss.seam.web.servletContexts, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.web.ServletContexts
11:38:09,398 INFO [org.jboss.seam.Component] (MSC service thread 1-8) Component: org.jboss.seam.web.session, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.web.Session
11:38:09,401 INFO [org.jboss.seam.Component] (MSC service thread 1-8) Component: org.jboss.seam.web.userPrincipal, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.faces.UserPrincipal
11:38:09,403 INFO [org.jboss.seam.Component] (MSC service thread 1-8) Component: securityRules, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.drools.RuleBase
11:38:09,412 WARN [org.jboss.seam.security.permission.PersistentPermissionResolver] (MSC serv
danno@Lemur-Ultra-Thin:~/development/Seam_2_3$ mvn dependency:list -Pjboss | grep 'richfaces'
[INFO] org.richfaces.core:richfaces-core-impl:jar:4.2.2.Final:compile
[INFO] org.richfaces.cdk:annotations:jar:4.2.2.Final:compile
[INFO] org.richfaces.ui:richfaces-components-ui:jar:4.2.2.Final:compile
[INFO] org.richfaces.ui:richfaces-components-api:jar:4.2.2.Final:compile
[INFO] org.richfaces.core:richfaces-core-api:jar:4.2.2.Final:compile
[INFO] org.richfaces.core:richfaces-core-impl:jar:4.2.2.Final:compile
[INFO] org.richfaces.ui:richfaces-components-api:jar:4.2.2.Final:compile
[INFO] org.richfaces.ui:richfaces-components-ui:jar:4.2.2.Final:compile
[INFO] org.richfaces.core:richfaces-core-api:jar:4.2.2.Final:compile
package com.vmware.cf.web;
import java.net.MalformedURLException;
import java.security.Principal;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import org.cloudfoundry.client.lib.CloudService;
@dhinojosa
dhinojosa / CustomCloudFoundryClient.java
Created June 19, 2012 06:10
Paraphrasing solution
public class CustomCloudFoundryClientFactory {
public CustomCloudFoundryClientFactory() {
}
public void setPrincipal(Principal principal) {
this.principal = principal;
}
public CustomCloudFoundryClient create() {
@dhinojosa
dhinojosa / HomeController.java
Created June 19, 2012 22:31
Another version of the HomeController, maybe name it should renamed to CloudClientController
@Controller
public class HomeController {
private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Locale locale, Model model) {
return "home";
}
@dhinojosa
dhinojosa / testng.xml
Created July 31, 2012 07:54
testng sample
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite1" verbose="1" >
<test name="unit-testing"
parallel="methods" thread-count="5" junit="false">
<parameter name="defaultClassroomName" value="Using JDBC"/>
<parameter name="defaultCapacity" value="5"/>
<groups>
<run>
<include name="unit" />
<exclude name="broken" />
@dhinojosa
dhinojosa / ClassroomTestWithTestNG.java
Created July 31, 2012 07:56
Test from this morning.
package com.vmware;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Factory;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import static org.fest.assertions.Assertions.*;
public class ClassroomTestWithTestNG {
@Test(groups={"unit", "fast", "classroom"})
@dhinojosa
dhinojosa / Meta.groovy
Created August 12, 2012 18:36
Playing with meta-programming for comparison with Scala.
Integer.metaClass.double() {->
delegate * 2
}
Integer.metaClass.abs() {->
if (delegate < 0) return delegate + double()
else return delegate
}
println(2.double())
println(-2.abs())