text:
Q: How to solve missing bean references in Hybris' cuppytrail project? While following the instructions in cuppy-trail: Testing the DAO topic, I am getting the below exceptions. I have followed the instructions to the book, I have included <context:component-scan base-package="de.hybris.platform.cuppytrail" /> in the cuppytrail-spring.xml. Pls suggest how to resolve the error. All 3 tests are failing.
Below are the DefaultStadiumDAOIntegrationTest and DefaultStadiumDAO
public class DefaultStadiumDAOIntegrationTest extends ServicelayerTransactionalTest
{
    /** As this is an integration test, the class (object) being tested gets injected here. */
    @Resource(name = "stadiumDAO")
    private StadiumDAO stadiumDAO;

    /** Platform's ModelService used for creation of test data. */
    @Resource
    private ModelService modelService;
    ....
}

DefaultStadiumDAO :
@Component(value = "stadiumDAO")
public class DefaultStadiumDAO implements StadiumDAO
{
  @Autowired
   private FlexibleSearchService flexibleSearchService;
    ....
}

Error:
WARN  [main] (junit) [ComposedTypeEJBImpl] missing jalo class 'com.hybris.backoffice.jalo.user.BackofficeRole' for item type 'BackofficeRole' - trying supertype class instead
INFO  [main] (junit) [LogRunListener] Starting test class de.hybris.platform.cuppytrail.daos.impl.DefaultStadiumDAOIntegrationTest
INFO  [Task-junit-poll] (junit) [DefaultModelConverterRegistry] loading model converters:
INFO  [Task-junit-poll] (junit) [DefaultModelConverterRegistry]     pre-fetch mode:default
INFO  [main] (junit) [LogRunListener] Starting test method testFindStadiums_EmptyStringParam(de.hybris.platform.cuppytrail.daos.impl.DefaultStadiumDAOIntegrationTest)
ERROR [main] (junit) [ServicelayerBaseTest] error fetching bean stadiumDAO : No bean named 'stadiumDAO' is defined
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'stadiumDAO' is defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1168) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:281) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:272) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest$1.doWith(ServicelayerBaseTest.java:66) [classes/:?]
    at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:605) [spring-core-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:585) [spring-core-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest.autowireProperties(ServicelayerBaseTest.java:51) [classes/:?]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest.prepareApplicationContextAndSession(ServicelayerBaseTest.java:42) [classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_60]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_60]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_60]
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) [junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
    at de.hybris.platform.testframework.HybrisJUnit4ClassRunner$TenantActivationNotAllowedRunBefores.evaluate(HybrisJUnit4ClassRunner.java:252) [coreserver.jar:?]
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
    at de.hybris.platform.testframework.HybrisJUnit4ClassRunner.run(HybrisJUnit4ClassRunner.java:124) [coreserver.jar:?]
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) [.cp/:?]
ERROR [main] (junit) [LogRunListener] Test method testFindStadiums_EmptyStringParam(de.hybris.platform.cuppytrail.daos.impl.DefaultStadiumDAOIntegrationTest) failed!!
java.lang.IllegalStateException: test DefaultStadiumDAOIntegrationTest is not properly initialized - missing bean references [stadiumDAO]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest.autowireProperties(ServicelayerBaseTest.java:86) ~[classes/:?]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest.prepareApplicationContextAndSession(ServicelayerBaseTest.java:42) ~[classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_60]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_60]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_60]
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) ~[junit-4.12.jar:4.12]
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) ~[junit-4.12.jar:4.12]
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) ~[junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) ~[junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) ~[junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
    at de.hybris.platform.testframework.HybrisJUnit4ClassRunner$TenantActivationNotAllowedRunBefores.evaluate(HybrisJUnit4ClassRunner.java:252) [coreserver.jar:?]
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
    at de.hybris.platform.testframework.HybrisJUnit4ClassRunner.run(HybrisJUnit4ClassRunner.java:124) [coreserver.jar:?]
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) [.cp/:?]
INFO  [main] (junit) [LogRunListener] Finished test method testFindStadiums_EmptyStringParam(de.hybris.platform.cuppytrail.daos.impl.DefaultStadiumDAOIntegrationTest) in 9 seconds
INFO  [main] (junit) [OpenDBConnectionRunListener] Currently still open DB connection: 0
INFO  [main] (junit) [LogRunListener] Starting test method stadiumDAOTest(de.hybris.platform.cuppytrail.daos.impl.DefaultStadiumDAOIntegrationTest)
ERROR [main] (junit) [ServicelayerBaseTest] error fetching bean stadiumDAO : No bean named 'stadiumDAO' is defined
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'stadiumDAO' is defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1168) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:281) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:272) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest$1.doWith(ServicelayerBaseTest.java:66) [classes/:?]
    at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:605) [spring-core-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:585) [spring-core-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest.autowireProperties(ServicelayerBaseTest.java:51) [classes/:?]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest.prepareApplicationContextAndSession(ServicelayerBaseTest.java:42) [classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_60]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_60]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_60]
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) [junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
    at de.hybris.platform.testframework.HybrisJUnit4ClassRunner$TenantActivationNotAllowedRunBefores.evaluate(HybrisJUnit4ClassRunner.java:252) [coreserver.jar:?]
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
    at de.hybris.platform.testframework.HybrisJUnit4ClassRunner.run(HybrisJUnit4ClassRunner.java:124) [coreserver.jar:?]
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) [.cp/:?]
ERROR [main] (junit) [LogRunListener] Test method stadiumDAOTest(de.hybris.platform.cuppytrail.daos.impl.DefaultStadiumDAOIntegrationTest) failed!!
java.lang.IllegalStateException: test DefaultStadiumDAOIntegrationTest is not properly initialized - missing bean references [stadiumDAO]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest.autowireProperties(ServicelayerBaseTest.java:86) ~[classes/:?]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest.prepareApplicationContextAndSession(ServicelayerBaseTest.java:42) ~[classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_60]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_60]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_60]
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) ~[junit-4.12.jar:4.12]
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) ~[junit-4.12.jar:4.12]
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) ~[junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) ~[junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) ~[junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
    at de.hybris.platform.testframework.HybrisJUnit4ClassRunner$TenantActivationNotAllowedRunBefores.evaluate(HybrisJUnit4ClassRunner.java:252) [coreserver.jar:?]
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
    at de.hybris.platform.testframework.HybrisJUnit4ClassRunner.run(HybrisJUnit4ClassRunner.java:124) [coreserver.jar:?]
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) [.cp/:?]
INFO  [main] (junit) [LogRunListener] Finished test method stadiumDAOTest(de.hybris.platform.cuppytrail.daos.impl.DefaultStadiumDAOIntegrationTest) in 7 seconds
INFO  [main] (junit) [OpenDBConnectionRunListener] Currently still open DB connection: 0
INFO  [main] (junit) [LogRunListener] Starting test method testfindStadiums_NullParam(de.hybris.platform.cuppytrail.daos.impl.DefaultStadiumDAOIntegrationTest)
ERROR [main] (junit) [ServicelayerBaseTest] error fetching bean stadiumDAO : No bean named 'stadiumDAO' is defined
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'stadiumDAO' is defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1168) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:281) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:272) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest$1.doWith(ServicelayerBaseTest.java:66) [classes/:?]
    at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:605) [spring-core-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:585) [spring-core-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest.autowireProperties(ServicelayerBaseTest.java:51) [classes/:?]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest.prepareApplicationContextAndSession(ServicelayerBaseTest.java:42) [classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_60]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_60]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_60]
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) [junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
    at de.hybris.platform.testframework.HybrisJUnit4ClassRunner$TenantActivationNotAllowedRunBefores.evaluate(HybrisJUnit4ClassRunner.java:252) [coreserver.jar:?]
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
    at de.hybris.platform.testframework.HybrisJUnit4ClassRunner.run(HybrisJUnit4ClassRunner.java:124) [coreserver.jar:?]
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) [.cp/:?]
ERROR [main] (junit) [LogRunListener] Test method testfindStadiums_NullParam(de.hybris.platform.cuppytrail.daos.impl.DefaultStadiumDAOIntegrationTest) failed!!
java.lang.IllegalStateException: test DefaultStadiumDAOIntegrationTest is not properly initialized - missing bean references [stadiumDAO]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest.autowireProperties(ServicelayerBaseTest.java:86) ~[classes/:?]
    at de.hybris.platform.servicelayer.ServicelayerBaseTest.prepareApplicationContextAndSession(ServicelayerBaseTest.java:42) ~[classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_60]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_60]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_60]
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) ~[junit-4.12.jar:4.12]
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) ~[junit-4.12.jar:4.12]
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) ~[junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) ~[junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) ~[junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
    at de.hybris.platform.testframework.HybrisJUnit4ClassRunner$TenantActivationNotAllowedRunBefores.evaluate(HybrisJUnit4ClassRunner.java:252) [coreserver.jar:?]
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
    at de.hybris.platform.testframework.HybrisJUnit4ClassRunner.run(HybrisJUnit4ClassRunner.java:124) [coreserver.jar:?]
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) [.cp/:?]
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) [.cp/:?]
INFO  [main] (junit) [LogRunListener] Finished test method testfindStadiums_NullParam(de.hybris.platform.cuppytrail.daos.impl.DefaultStadiumDAOIntegrationTest) in 6 seconds
INFO  [main] (junit) [OpenDBConnectionRunListener] Currently still open DB connection: 0
INFO  [main] (junit) [LogRunListener] Finished (failed) test class de.hybris.platform.cuppytrail.daos.impl.DefaultStadiumDAOIntegrationTest
INFO  [main] (junit) [LogRunListener]   Total run time: 0d 00h:00m:24s:328ms
INFO  [main] (junit) [LogRunListener]   Total tests count: 3
INFO  [main] (junit) [LogRunListener]   Failed tests count: 3
INFO  [main] (junit) [LogRunListener]   Ignored tests count: 0
INFO  [main] (junit) [ClassLoaderOverviewRunListener] Loaded class count: 10195 diff: 434
INFO  [main] (junit) [ClassLoaderOverviewRunListener] Total loaded class count: 10195 diff: 434
INFO  [main] (junit) [ClassLoaderOverviewRunListener] Unloaded class count: 0 diff: 0
shutting down hybris registry..
INFO  [Thread-5] [DefaultClusterNodeManagementService] Unregistering assigned cluster node id 0...

A: I have the same issue because I am using IntelliJ 17, however with eclipse it works!! is the same configuration but something with the spring configuration on IntelliJ dont allow it works, so... alternatives:
1) go on with eclipse :(
2) if you are using IntelliJ, you need add the resouce folder or at least your cuppytrail-spring.xml to your resource test wich you would see in project structure, you could duplicate this, the problem is IntelliJ on its *.iml is not able to find this file and dont get this context.

A: I had the same issue. The following steps work for me.

*

*ant clean all

*Right click on module in Project view/ Rebuild module
'cuppytrail'

*File/ Refresh project

InteliJ Idea 2017.2 + Hybris integration plugin 6.3 (plugin)


text:
Q: SWIG Python bindings for OpenCV 2.0 with MacPorts Y'all,
I've been at to for 3 days trying to get OpenCV Python binds happening, and I have (the full epic struggle is documented here) but despite turning the SWIG flag on in CMake after installing swig via macports, I'm not getting any SWIG action :(
My cmake command looks like:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/opt/local -D BUILD_PYTHON_SUPPORT=ON -D BUILD_SWIG_PYTHON_SUPPORT=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON -D BUILD_TESTS=ON -D PYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Headers -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_SWIG_PYTHON_SUPPORT=ON -D CMAKE_CXX_COMPILER=/usr/bin/g++-4.2 -D CMAKE_C_COMPILER=/usr/bin/gcc-4.2 ..

which pulls this error:
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - not found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found

SO I guess its not finding the one i have at:
/opt/local/include/libavformat/avformat.h

How do I tell it about that? With something like
-D CMAKE_CXX_FLAGS="-I/opt/local/include" -D CMAKE_SHARED_LINKER_FLAGS="-L/opt/local/lib"

???
I'm using OSX 10.5.8, Python 2.6 via Macports and compiling the latest OpenCV-trunk.

A: Seems that the cmake flags didn't make much of a difference. I became systematic and reduced them to the minimum:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/opt/local -D BUILD_PYTHON_SUPPORT=ON -D BUILD_SWIG_PYTHON_SUPPORT=OFF -D BUILD_NEW_PYTHON_SUPPORT=ON -D PYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Headers -D CMAKE_CXX_COMPILER=/usr/bin/g++-4.2 -D CMAKE_C_COMPILER=/usr/bin/gcc-4.2 -D BUILD_SWIG_PYTHON_SUPPORT=ON ..

and I managed to compile everything, but when I tired to "import cv" win Python I kept getting  the following error:
Fatal Python error: Interpreter not initialized (version mismatch?)

which is because the compiler on darwin defaults to the system version of python. I followed some advice and found this worked like a charm:
sudo chmod 000 /System/Library/Frameworks/Python.framework/
cmake ...
sudo chmod 755 /System/Library/Frameworks/Python.framework/

A: If you're ok with the newer (non-SWIG) bindings, which imho are better anyway, you can just install directly via MacPorts:
sudo port install opencv +python26

or
sudo port install opencv +python27

as appropriate.
See also How to install OpenCV for python

redpajama_set_name: RedPajamaStackExchange


text:
Q: Access xparse's \BooleanTrue via latex3 expl3 I'm implementing a command with xparse's boolean token processing
\NewDocumentCommand{\op}{s o t' t. t^ g}{
    % Here I need to check for
    %     (#3 || #4 || #5) && !(#3 && #4 && #5)
}

I'd like to avoid all the \IfBooleanTF combinations and instead to check via \bool_if:nTF.
That is, of the boolean tokens passed to the function not all at the same time should be true or false. Testing with \IfBooleanTF for
(p ∨ q ∨ r) ∧ ¬(p ∧ q ∧ r)
is very tedious (a higher-order exclusive disjunction, XOR), especially given more such arguments.
I could assign boolean "variables" in expl3 based on xparse's tests, e.g.,
\IfBooleanTF{#1}
{\bool_set_true:N \l_first_arg_bool}
{\bool_set_false:N \l_first_arg_bool}

That's okay.
But is there a way to access the boolean flags set by xparse for the arguments directly?

A: It is probably not such a good idea to rely on an implementation detail, but xparse defines
\cs_new_eq:NN \BooleanFalse \c_false_bool
\cs_new_eq:NN \BooleanTrue  \c_true_bool

which means that the booleans that are signalled by your arguments are just regular expl3 booleans which can go directly into \bool_if:nTF.
\documentclass{article}
\usepackage{xparse}

\ExplSyntaxOn

\NewDocumentCommand \op { s o t' t. t^ g }
{
  \bool_if:nTF { (#3 || #4 || #5) && !(#3 && #4 && #5) }
    { True }
    { False }
}

\ExplSyntaxOff

\begin{document}

\op*[foo]'.^{bar} % False

\end{document}

A: Implementing this XOR is quite easy:
\int_new:Nn \l_foo_bad_check_int

\NewDocumentCommand{\bad}{t' t. t^}
 {
  \int_zero:N \l_foo_bad_check_int
  \IfBooleanTF { #1 } { \int_incr:N \l_foo_bad_check_int }
  \IfBooleanTF { #2 } { \int_incr:N \l_foo_bad_check_int }
  \IfBooleanTF { #3 } { \int_incr:N \l_foo_bad_check_int }
  \int_compare:nTF { 0 < \l_foo_bad_check_int < 3 }
   { Good }
   { Bad }
 }

On the other hand, such a syntax would be confusing even for the macro creator, particularly with an argument specifier such as
s o t' t. t^ g

with six optional parts.


text:
Q: Comparing IEnumerable string to SortedList string,string I ran into a problem I cannot solve. :-) I have to find all the values which contains a certain substring then I must get back the key and value pair. I had to implement a system where I had to make a SortedList, where the Albums is a class string is the key of course
Albums alb = new Albums();
SortedList<string, Albums> list1 = new SortedList<string, Albums>();

The Albums class looks like this:
public class Albums : IComparable
{
    public string albname;
    public string name1;
    public string releasedate;
    public Guid albumID;

   public Albums()
    {
        albumID = new Guid();
    }

   public override string ToString()
   {
       return "Album: " + Albname + "\t" + Releasedate;
   }

   public Albums(string albname, string releasedate)
   {

       this.albname = albname;
       this.releasedate = releasedate;
   }

   public string Name1
   {
       get { return name1; }
       set { name1 = value; }
   }

    public string Albname
    {
        get { return albname; }
        set { albname = value; }
    }
   public string Releasedate
    {
        get { return releasedate; }
        set { releasedate = value; }
    }
    public int CompareTo(object obj)
    {
        if (obj is Albums)
        {
            Albums other = (Albums)obj;
            return albname.CompareTo(other.albname);
        }
       if (obj is string)
       {
           string other = (string)obj;
           return releasedate.CompareTo(releasedate);
       }

        else
        {
            return -999;
        }
    }
   }

What I tried at last that I put the Albums into a LinkedList:
LinkedList<string> albm1 = new LinkedList<string>();

I did manage to find all the Albums that contains the substring using IEnumerable:
string albsearch = textBox16.Text;
IEnumerable<string> result = albm1.Where(s => s.Contains(albsearch));

BUT I do not know how to compare result to the Values of the SortedList. I also tried to create a new SortedList which contains the album in string:
SortedList<string, string> list2 = new SortedList<string, string>();

Any suggestion would be appreciated. Thanks in advance!

A: When you enumerate a SortedList, each item in the enumeration is a key/value pair.
I think what you want is:
Albums alb = new Albums();
SortedList<string, Albums> list1 = new SortedList<string, Albums>();

var foundItems = list1.Where(item => item.Key.Contains(albsearch));

Or, if you want to search in the Album:
var foundItems = list1.Where(item => item.Value.albname.Contains(albsearch));

Of course, you could search the name1 field rather than the album name, if that's what you want.
Each item returned is a key/value pair. More correctly, a KeyValuePair<string, Album>.

A:     [Test]
    public void Allbum_Search_Test()
    {
        var searchText = "TestA";
        var list1 = new SortedList<string, Albums>
        {
            {"TestAlbum1", new Albums("TestAlbum1","SomeDate")},
            {"TestAlbum2", new Albums("TestAlbum2","SomeDate")},
            {"OtherAlbum2", new Albums("OtherAlbum","SomeDate")}
        };

        var results = list1.Where(pair => pair.Key.Contains(searchText));

        Assert.That(results.Count(), Is.EqualTo(2));
    }

On another note i would highly recommend

*

*making the fields private

*renaming Albums to Album

*changing the ReleaseDate type to DateTime

*renaming Albname to AlbumName


text:
Q: A Grammar And some challenge about SLR, LALR I know:

A language is said to be LL(1) if it can be generated by a LL(1) grammar. It can be shown that LL(1) grammars are

not ambiguous and
not left-recursive.

but i ran into a problem.
Why the Grammar

S-> aBDb
B -> lambda
D-> dD | lambda

why this grammar is not LL(1) nor SLR nor LALR? anyone could describe me?

A: This grammar is indeed LL(1). Here's the parse table:
      a     b     d       $
S     aBDb
B           eps   eps
D           eps   dD

It's also SLR(1). Here are the FOLLOW sets:
S: $
B: d, b
D: b

Here are the configurating sets:
 S' -> .S$
 S  -> .aBDb  ($)

 S' -> S.$

 S  -> a.BDb   ($)
 B  -> .       (b, d)

 S  -> aB.Db   ($)
 D  -> .       (b)
 D  -> .dD     (b)

 D  -> d.D     (b)
 D  -> .dD     (b)
 D  -> .       (b)

 D  -> dD.     (b)

There are no shift/reduce or reduce/reduce conflicts, so this grammar is SLR(1). Therefore, it's also LALR(1).
Hope this helps!


text:
Q: How to extract xml response in php and create json response after getting xml response from server using $result = curl_exec($ch);
i want to exctract some data from xml response and build that extracted data to valid json format and send that json to mobile app in android
this is what i am getting from my server.
<ENVELOPE>
 <HEADER>
  <VERSION>1</VERSION>
  <STATUS>1</STATUS>
  </HEADER>
 <BODY>
  <DESC>
   <CMPINFO>
    ...
   </CMPINFO>
  </DESC>
  <DATA>
       <COLLECTION ISMSTDEPTYPE="Yes" MSTDEPTYPE="512">
    <STOCKITEM NAME="Abc Test" RESERVEDNAME="">
     <STOCKITEMNAME TYPE="String">Abc Test</STOCKITEMNAME>
     <CLOSINGBALANCE TYPE="Quantity"> 102 Nos</CLOSINGBALANCE>
     <OPENINGBALANCE TYPE="Quantity"> 500 Nos</OPENINGBALANCE>
     <DEBITTOTALS TYPE="Quantity"> 418 Nos</DEBITTOTALS>
     <CREDITTOTALS TYPE="Quantity"> 20 Nos</CREDITTOTALS>
     <OPENINGVALUE TYPE="Amount">-1000000.00</OPENINGVALUE>
     <CLOSINGVALUE TYPE="Amount">-366400.00</CLOSINGVALUE>
     <OUTWARDVALUE TYPE="Amount">4180000.00</OUTWARDVALUE>
     <INWARDVALUE TYPE="Amount">-2400.00</INWARDVALUE>
     <BASICQTY TYPE="Quantity"></BASICQTY>
     <OPENINGRATE TYPE="Rate">2000.00/Nos</OPENINGRATE>
     <CLOSINGRATE TYPE="Rate">1927.69/Nos</CLOSINGRATE>
     <TBALCLOSING TYPE="Amount">-366400.00</TBALCLOSING>
     <TBALOPENING TYPE="Amount">-1000000.00</TBALOPENING>
     <STKOPBALANCE TYPE="Quantity"> 500 Nos</STKOPBALANCE>
     <STKCLBALANCE TYPE="Quantity"> 102 Nos</STKCLBALANCE>
     <TBALDEBITS TYPE="Amount">-2400.00</TBALDEBITS>
     <TBALCREDITS TYPE="Amount">4180000.00</TBALCREDITS>
     <STKINQTY TYPE="Quantity"> 20 Nos</STKINQTY>
     <STKOUTQTY TYPE="Quantity"> 418 Nos</STKOUTQTY>
     <TBALNETTCREDITS TYPE="Amount">4180000.00</TBALNETTCREDITS>
    </STOCKITEM>
    <STOCKITEM NAME="Gas" RESERVEDNAME="">
     <STOCKITEMNAME TYPE="String">Gas</STOCKITEMNAME>
     <CLOSINGBALANCE TYPE="Quantity"></CLOSINGBALANCE>
     <OPENINGBALANCE TYPE="Quantity"></OPENINGBALANCE>
     <DEBITTOTALS TYPE="Quantity"></DEBITTOTALS>
     <CREDITTOTALS TYPE="Quantity"></CREDITTOTALS>
     <OPENINGVALUE TYPE="Amount">0.00</OPENINGVALUE>
     <CLOSINGVALUE TYPE="Amount"></CLOSINGVALUE>
     <OUTWARDVALUE TYPE="Amount"></OUTWARDVALUE>
     <INWARDVALUE TYPE="Amount"></INWARDVALUE>
     <BASICQTY TYPE="Quantity"></BASICQTY>
     <OPENINGRATE TYPE="Rate"></OPENINGRATE>
     <CLOSINGRATE TYPE="Rate"></CLOSINGRATE>
     <TBALCLOSING TYPE="Amount"></TBALCLOSING>
     <TBALOPENING TYPE="Amount">0.00</TBALOPENING>
     <STKOPBALANCE TYPE="Quantity"></STKOPBALANCE>
     <STKCLBALANCE TYPE="Quantity"></STKCLBALANCE>
     <TBALDEBITS TYPE="Amount"></TBALDEBITS>
     <TBALCREDITS TYPE="Amount"></TBALCREDITS>
     <STKINQTY TYPE="Quantity"></STKINQTY>
     <STKOUTQTY TYPE="Quantity"></STKOUTQTY>
     <TBALNETTCREDITS TYPE="Amount"></TBALNETTCREDITS>
    </STOCKITEM>
    ....

   </COLLECTION>
  </DATA>
 </BODY>
</ENVELOPE>

this is just only sample it gives very huge amt of data. suppose if i need only  STOCKITEMNAME, CLOSINGBALANCE, STKINQTY  etc ... tag values in json file. this values are in arrays. i tried like this...
<?php
.
.
.
$retValue = curl_exec($ch);
curl_close($ch);
$oXML = simplexml_load_string($retValue );
//echo $sXML;

$hd = array();

foreach ($oXML as $s):
$hd[$s]=$s->DATA->COLLECTION->STOCKITEM;
endforeach;

//$response["error"]                = FALSE;
$response["resp"]               = $hd;
//echo $header;
echo json_encode($response);

?>

but this is not working...
help me out please

A: STOCKITEM element is an array of elements. You have to crab each child element of STOCKITEM like STOCKITEMNAME etc.
<?php
$oXML = simplexml_load_string($retValue);

$i = 0;
$hd = [];
foreach ($oXML->BODY->DATA->COLLECTION->STOCKITEM as $item):
    $hd[$i]['STOCKITEMNAME']= (string) $item->STOCKITEMNAME;
    $hd[$i]['DEBITTOTALS']= (string) $item->DEBITTOTALS;
    # continue with elements you want ...
    $i++;
endforeach;


text:
Q: Ubuntu 20.04 Desktop fails at boot with wifi card I have an issue with starting Ubuntu up. it will crash when booting up and the last line will say:
[  OK  ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.

In which right after the screen will go black. After multiple attempts, I had to go through the Grub Menu to start up my system in Safe Mode. When trying out the desktop in safe mode, the wifi was working on my desktop and I was able to access the internet.
When digging through some research, it seems as though rfkill can be related to a wifi problem. When I removed the wifi card from the desktop, it worked perfectly fine and it was able to boot up with no problems.
I installed the wifi card about 5-6 weeks ago and hadn't had this problem before during boot until last night. What should I check for when searching for the cause of this problem and to fix this so I do not run into this error during boot?


text:
Q: Do I need to acquire a wakelock when not using a broadcast receiver to handle IntentServices sent from Alarm Manager? I have been reading about starting a service from a BroadcastReceiver. In this scenario I have to acquire a WakeLock until the Intent is handled by the IntentService.
What about when I call an IntentService directly from the AlarmManager wrapped into a pendingIntent? In this scenario there's no BroadcastReceiver... the intent is forwarded directly to the onHandleIntent of the service. Then, where do I acquire the lock? Is it really needed??? All seems to work fine.

A: An IntentService is only a threaded service. You will need to aquire a wake lock. Commonsguy has a lovely WakefulIntentService here.
His IntentService acquires a Wakelock for you so if you call it from an AlarmService it will wake obtain the wake and release it when the work is done.
I've used it allot, works great, and the source is on Github so you can see how its working.


text:
Q: Multiple Polygon On Map how to make multiple polygon on Google  Map I am using
List<lat long> data = new Array List<Lat Long>();

but its create only one polygon when we draw another then last polygon deleted so anyone please help me thanks in advance

A: You can define a common method to draw polygon on google maps like this:
public PolygonOptions addPolygon(ArrayList < LatLng > arg) {

    LatLng[] data = arg.toArray();
    PolygonOptions polygonOptions;

    for (int i = 0; i <= data.length; i++) {
        polygonOptions = new PolygonOptions();
        polygonOptions.add(data[i], data[i + 1], data[i + 2])).strokeColor(Color.RED).strokeWidth(2);
        polygonOptions.fillColor(Color.parseColor("#51000000"));
        return polygonOptions;
    }
}

and then add it to your GoogleMap like this:
yourGoogleMap.addPolygon(addPolygon(data));


text:
Q: Redis, only allow operation on existing keys I am using the python package (redis-py) to operate the redis database. I have a bunch of clients that set keys and values of a hash in redis. I want they set keys and values only when the hash exists. If the hash doesn't exist, setting keys and values will create the hash, which is not what I want to do.
In the redis-py page (https://github.com/andymccurdy/redis-py), the author suggested a way to do atomic operation on client side. So I wrote a similar function:
    with r.pipeline() as pipe:
        while True:
            try:
                pipe.watch("a_hash")
                if pipe.exists("a_hash"):
                    pipe.hset("a_hash", "key", "value")
                break
            except redis.WatchError:
                continue
            finally:
                pipe.reset()

However, this seems does not work. After I delete the hash from another client, this hash still gets created by this piece of code, so I guess this piece of code is not atomic operation. Could someone help me to identify what's the problem with this code? Or is there a better to achieve this purpose?
Appreciate your help!

A: I would suggest to read the definition of a WATCH/MULTI/EXEC block as explained in the Redis documentation.
In such block, only the commands between MULTI and EXEC are actually processed atomically (and conditionally, with an all-or-nothing semantic depending on the watch).
In your example, the EXISTS and HSET commands are not executed atomically. Actually, you don't need this atomicity: what you want is the conditional execution.
This should work better:
with r.pipeline() as pipe:
    while True:
        try:
            pipe.watch("a_hash")
            if pipe.exists("a_hash"):
                pipe.multi()
                pipe.hset("a_hash", "key", "value")
                pipe.execute()
            break
        except redis.WatchError:
            continue
        finally:
            pipe.reset()

If the key is deleted after the EXISTS but before the MULTI, the HSET will not be executed, thanks to the watch.
With Redis 2.6, a Lua server-side script is probably easier to write, and more efficient.


text:
Q: Not able to place elements properly after dividing them in components (Angular) I'm kinda noob on the css layout. So i had a sidebar and the app-root all placed in the index.html file as you can see in the master branch of the repository:
https://github.com/Ghevi/Angular-BugTracker/tree/master
It wasnt perfect yet but it was something: https://imgur.com/a/jGUjhct
The navbar animations were fine and the main content moved to the right when the navbar was hovered and opened.
So then i tried to move everything in their correct components and i placed the #wrapper #left #right styling in the app.component.css to apply to in the selectors of app.component.html.
But now is more broken than ever: https://imgur.com/a/GZR5fXp
https://github.com/Ghevi/Angular-BugTracker/tree/broken
I don't understand why other than the components beying displayed one above the other, the navbar has also missing the background color and animations now, even if i copy pasted its code in the right components.
For reference the navbar is this one: https://www.youtube.com/watch?v=biOMz4puGt8
I understand the question is loadead and a bit vague, but i'm really lost at this point.


text:
Q: Count on left join querty Just help me with this query please.
SELECT COUNT (name.IN) AS Total, name.St_Name, name.Class_Id,
    teacher.Class_Id
  FROM name
  Left Join teacher ON  name.Class_Id = teacher.Class_Id
  WHERE name.IN = '1';

Question : how do I COUNT(name.IN) as total and get the number of students that name.Class_Id and teacher.Class_Id are the same.

A: If you use an aggregation function like COUNT or SUM or MAX?
Then when you add other fields to the SELECT, then those fields should be in the GROUP BY.
This is true for most databases. But MySql can be an exception to that SQL92 rule.
In MariaDB it's not permitted to omit those fields from the GROUP BY if the ONLY_FULL_GROUP_BY SQL_MODE is used.
So try this:
SELECT
 COUNT(name.IN) AS Total,
 COUNT(DISTINCT name.St_Name) AS TotalUniqueStudentNames,
 COUNT(teacher.Class_id) AS TotalMatchingTeacherClass,
 name.Class_Id
FROM name
LEFT JOIN teacher ON name.Class_Id = teacher.Class_id
WHERE name.IN = '1'
GROUP BY name.Class_Id
ORDER BY name.Class_Id

A: A SELECT statement clause that divides the query result into groups of rows, usually for the purpose of performing one or more aggregations on each group. The SELECT statement returns one row per group
    SELECT (name.IN) AS Total, name.St_Name, name.Class_Id, teacher.Class_Id
        FROM name
        Left Join teacher ON  name.Class_Id = teacher.Class_Id
        WHERE name.IN = '1'
group by  name.St_Name, name.Class_Id, teacher.Class_Id


text:
Q: jQuery Cycle2 slide disapear when using "fade animation" i've a problem in cycle2 pluging
when i go to another page and comeback to my page sometimes and not always the slide disappear and show after a sec delay

 div"
>

         econtent here

   content here

A: This code should work:

 div">

       econtent here

       content here

UPDATE
Using jquery 3.0.0 fix the "Fade Animation Bug"


text:
Q: SecurityException reading picture from Android gallery I am getting a image from gallery and send to my remote server. Next, I save the image path into my shared preferences. This works well.
After some time, when I try recover the image from saved path and show in my image view I get this exception in the line:
bitmap = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), fileUri);

Some times, the code works, but after some time I get this exception.
My exception is:
E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: net.techabout.medappointment, PID: 4160
                  java.lang.SecurityException: Permission Denial: opening provider com.android.externalstorage.ExternalStorageProvider from ProcessRecord{9922e7c 4160:net.techabout.medappointment/u0a105} (pid=4160, uid=10105) requires android.permission.MANAGE_DOCUMENTS or
android.permission.MANAGE_DOCUMENTS
                      at android.os.Parcel.readException(Parcel.java:1599)
                      at android.os.Parcel.readException(Parcel.java:1552)
                      at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:3550)
                      at android.app.ActivityThread.acquireProvider(ActivityThread.java:4778)
                      at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2018)
                      at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1468)
                      at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1088)
                      at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:942)
                      at android.content.ContentResolver.openInputStream(ContentResolver.java:662)
                      at android.provider.MediaStore$Images$Media.getBitmap(MediaStore.java:866)
                      at net.techabout.medappointment.ConfigurationFragment.onCreateView(ConfigurationFragment.java:115)

Here is my manifest:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />

Here is my code:
private Uri fileUri;
String pathimg;
Bitmap bitmap = null;
ImageView imageView;
private static int RESULT_LOAD_IMG = 1;
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.configuationfrag, container, false);
        imageView = (ImageView) view.findViewById(R.id.imageView);
        SharedPreferences pref = getActivity().getSharedPreferences(Common.SHARED_PREF_NAME, Context.MODE_PRIVATE);
        pathimg = pref.getString("imagepath", "");
        fileUri = Uri.parse(pathimg);

        try {
            bitmap = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), fileUri);
            imageView.setImageBitmap(bitmap);
        } catch (IOException e) {
            e.printStackTrace();
        }
        Button buttonChoose = (Button) view.findViewById(R.id.buttonChooseImage);
        buttonChoose.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                showFileChooser();
            }
        });

        Button buttonupload = (Button) view.findViewById(R.id.buttonUpload);
        buttonupload.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (bitmap != null) new UploadImage().execute();
            }
        });
        return view;
    }
    private void showFileChooser() {
        Intent intent;

        if (Build.VERSION.SDK_INT < 19) {
            intent = new Intent();
            intent.setAction(Intent.ACTION_GET_CONTENT);
            intent.setType("image/*");
            startActivityForResult(intent, RESULT_LOAD_IMG);
        } else {
            intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
            intent.addCategory(Intent.CATEGORY_OPENABLE);
            intent.setType("image/*");
            startActivityForResult(intent, RESULT_LOAD_IMG);
        }

    }
@Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
       if (requestCode == RESULT_LOAD_IMG && resultCode == RESULT_OK && data != null && data.getData() != null) {
            Uri filePath = data.getData();
            try {
                bitmap = MediaStore.Images.Media.getBitmap(getActivity().getApplicationContext().getContentResolver(), filePath);
                imageView.setImageBitmap(bitmap);
                pathimg=filePath.toString();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

A: The problem is that the framework only grants temporal access to the image URI.
If you want to continue to use the URI you have to request a persistent permission, execute the following before storing the URI to the shared preferences:
final int takeFlags = intent.getFlags()
        & (Intent.FLAG_GRANT_READ_URI_PERMISSION
        | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
// Check for the freshest data.
getContentResolver().takePersistableUriPermission(uri, takeFlags);

For more details have a look at the documentation.


text:
Q: Clearing text on mouse click from multiple JTextFields in Java I'm doing some error checking in two JTextFields. I'll label them jtext1 and jtext2.
Right now my GUI looks like this:
Enter number 1: [      ] // jtext1
Enter number 2: [      ] // jtext2
Convert         [ answer ]

I want to be able to check for multiple conditions and display an error message. For example, if the user enters nothing for both text fields, and hits convert the following should appear:
Enter number 1: [  Nothing entered    ] // jtext1
Enter number 2: [  Nothing entered    ] // jtext2
Convert         [ answer ]

And, if you use the mouse to click on jtext1 I want it to clear the message so the user can enter a number. If they click on jtext2 the same thing should also happen.
So for example if I were to click on jtext2 the following should appear:
Enter number 1: [  Nothing entered    ] // jtext1
Enter number 2: [        ]              // jtext2
Convert         [ answer ]

The problem is, with this piece of code:
if(!jtext1.isvalid()) {
    jtext1.setText("Nothing entered");
    jtext1.addMouseListener(new MouseAdapter(){
        @Override
        public void mouseClicked(MouseEvent e) {
            jtext1.setText("");
        }
    });
}

if(!jtext2.isvalid()) {
    jtext2.setText("Nothing entered");
    jtext2.addMouseListener(new MouseAdapter(){
        @Override
        public void mouseClicked(MouseEvent e) {
            jtext2.setText("");
        }
    });
}

Only jtext1 will work. This sort of makes sense to me, because I don't think I can keep overriding the same function, but how would I go around the issue?

A: I think it would be better if you create another class that can display a hint, that way it will be easier whenever you need to do this again.
Here's an example of how it could work, taken from another question on SO
class HintTextField extends JTextField implements FocusListener {

  private final String hint;
  private boolean showingHint;

  public HintTextField(final String hint) {
    super(hint);
    this.hint = hint;
    this.showingHint = true;
    super.addFocusListener(this);
  }

  @Override
  public void focusGained(FocusEvent e) {
    if(this.getText().isEmpty()) {
      super.setText("");
      showingHint = false;
    }
  }
  @Override
  public void focusLost(FocusEvent e) {
    if(this.getText().isEmpty()) {
      super.setText(hint);
      showingHint = true;
    }
  }

  @Override
  public String getText() {
    return showingHint ? "" : super.getText();
  }
}

You can use this and then set your JTextField to new HintTextField("What you want your hint to be"). You can modify this class for your own needs, but it's a good starting point.
Update: And if you want to use your current code for whatever reason, change the mouse listener to a focus listener and override focusGained.


text:
Q: How to use xsl:value-of as src for fo:external-graphic? I'm fairly new to XSL-FO, and what I'm trying is probably not the ideal way to solve this.
I've got a few icons stored in a local directory.
I need to use the path to these icons dynamically for the src of fo:external-graphic.
<fo:external-graphic src='xsl:value-of select="article[@index=1]/data/subscriber-B-10'  width="100px" height="90px" content-height="scale-up-to-fit"  display-align="center" text-align="center"></fo:external-graphic>

I have tried different variations of the path in subscriber-B-10.
"subscriber-B-10": "url('file:///C:/Users/Administrator/icons/icon1.bmp')",
"subscriber-B-10": "file:///C:/Users/Administrator/icons/icon1.bmp",

The last one with src='url("xsl:value-of select="article[@index=1]/data/subscriber-B-10")'
Using the path directly to one of the icons is working:
src='url("file:///C:/Users/Administrator/icons/icon1.bmp")

A: Look up 'Attribute Value Templates'.  The XSLT 1.0 definition is at https://www.w3.org/TR/1999/REC-xslt-19991116#attribute-value-templates (but hopefully you are using the more recent XSLT 2.0 or XSLT 3.0).
You can use an attribute value template to get the string value of your XPath by putting the XPath between { and } in your literal attribute value:
<fo:external-graphic
  src="{article[@index=1]/data/subscriber-B-10}"
  width="100px" height="90px" content-height="scale-up-to-fit"
  display-align="center" text-align="center" />


text:
Q: Embedding Python DLL in Lua & exposing functions Is it possible to embed the Python DLL to a Lua program? And expose functions to it? I've also thought about a wrapper library, if Lua can't handle this on its own. May there be already a project trying this?

A: A quick googling finds Lunatic Python, a two-way Python-Lua bridge.


text:
Q: Find the correct php.ini file I am currently trying to locate the correct php.ini file to edit it and restart apache so the changes will take place and I'm stumped.
I have found three different php.ini files (no idea why there are three)
 this is how I found the files
$ sudo find / -name php.ini
/etc/php5/cli/php.ini
/etc/php5/apache2/php.ini
/etc/php5/cgi/php.ini

I also did....
$ sudo php -i | grep 'Configuration File'
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini

I changed all of them (just to be sure) to the settings I wanted.
I restarted apache using
sudo service apache2 restart

The results...
* Restarting web server apache2

I reloaded the page and it showed that the php.ini file was not updated.
I know this because I used
echo ini_get('post_max_size');

Which was supposed to be changed to 20M but was still only 2M
I tried rebooting my computer thinking maybe that would stop the apache server and reload the php.ini file with the correct setting, but alas that attempt also failed.
Is there any chance there could be another php.ini file that could be interfering?

A: You can find the file being used by running this on terminal:
php --ini

A: To find which php.ini the CLI is using you can run:
php -i | grep 'php.ini'

Example output:
$ php -i | grep 'php.ini'

Configuration File (php.ini) Path => /etc/php/7.0/cli
Loaded Configuration File => /etc/php/7.0/cli/php.ini

A: The three files you have there are each meant for different uses.
/etc/php/5.6/cli/php.ini is for the CLI PHP program, which you found by running php on the terminal.
/etc/php/5.6/cgi/php.ini is for the php-cgi system which isn't specifically used in this setup.
/etc/php/5.6/apache2/php.ini is for the PHP plugin used by Apache.  This is the one you need to edit for changes to be applied for your Apache setup which utilizes the in-built PHP module to Apache.
/etc/php/5.6/fpm/php.ini is for the php5-fpm processor, which is a fastcgi-compatible 'wrapper' for PHP processing (such as to hand off from NGINX to php5-fpm) and runs as a standalone process on the system (unlike the Apache PHP plugin)

For versions of Ubuntu lower than 16.04, /etc/php/5.6/,/etc/php/7.0/,/etc/php/7.1/, and so on, are replaced by /etc/php5/ and so on. Otherwise, these paths remain accurate.  Adapt this accordingly for your environment, replacing the 5.6 or number with the actual version folder that exists on your environment.

A: Try running a script containing this snippet in your browser <?php phpinfo(); ?> and then try to search for something like Loaded Configuration File. This entry specifies the php.ini your PHP uses in your Apache server.

A: just use <?= phpinfo() ?> and read :

Loaded Configuration File

A: for php7 ubuntu 16.4
/etc/php/7.0/apache2/php.ini

A: I am on LAMP stack on Amazon Lightsail and the location of the correct php.ini file for my Ubuntu server is:
/opt/bitnami/php/etc/php.ini


text:
Q: Joining multiple collections in different databases with $lookup I am a beginner to Mongo. I want to simulate an inner join using the aggregate $lookup and I have 3 collections ( 1 in a separate database ) I want to see all the projects that a user is part of can someone give me an example?
Here are the 3 collections
"projects.details"
    {
        "_id" : ObjectId("5684f3c454b1fd6926c324fd"),
        "projName" : "I am a test project",
        "active" : "true"
        "projId" : "project1"
    }

"userDetails.projMembership"
{
    "_id" : ObjectId("56d82612b63f1c31cf906003"),
    "projId" : "project1",
    "userId" : "user1",
    "status" : "Invite"
}

"userDetails.details"
{
    "_id" : ObjectId("56d82612b63f1c31cf906003"),
    "userId" : "user1",
    "email" : "user1@somemail.com"
}

A: After searching far and wide for an answer, The answer is simple This is NOT possible in Mongo. The only way to achieve the result I was looking for is to perform a $lookup for the 2 collections in the userDetails DB, store the results in an array, then perform another lookup against the collection in the projects DB. Hope this helps someone out there.


text:
Q: Joining two lists in linq and return consolidated records Currently, the return type is:

"System.Collections.GenericList<{a:ConsoleApplication3.Person,b:ConsoleApplication3.Person>

What is the best way to get the List<Person> with all the data just like the SQL join would return?
I want to get only two rows in the List<Person> :
{Name:Jon, Address=loc1,Country=US,Continent=NA}

{Name:Ryan, Address=loc2,Country=Germany,Continent=Europe}

Person person1 = new Person();
person1.Name = "Jon";
person1.Address = "loc1";

Person person2 = new Person();
person2.Name = "Ryan";
person2.Address = "loc2";

Person person3 = new Person();
person3.Name = "Jon";
person3.Country = "US";
person3.Continent = "NA";

Person person4 = new Person();
person4.Name="Ryan";
person4.Country = "Germany";
person4.Continent = "Europe";

list1.Add(person1);
list1.Add(person2);

list2.Add(person3);
list2.Add(person4);

var  result = (from a in list1
               join b in list2 on a.Name equals b.Name
               select new {a,b}).ToList();

A: It looks like you want to create new objects
var results = (from a in list1
               join b in list2 on a.Name equals b.Name
               select new Person
               {
                   Name = a.Name,
                   Address = a.Address,
                   Country = b.Country,
                   Continent = b.Continent
               }).ToList();

If however you don't know which list has values you could do something like the following
var results = (from a in list1
               join b in list2 on a.Name equals b.Name
               select new Person
               {
                   Name = a.Name,
                   Address = a.Address ?? b.Address,
                   Country = a.Country ?? b.Country,
                   Continent = a.Continent ?? b.Continent
               }).ToList();

That will take the values from list1 unless they are null and if they are it will instead take the values from list2.

A: I don't really get how you're choosing whether the Country is in the first list of the second one. But you can do something like this:
var  result = (from a in list1
               join b in list2 on a.Name equals b.Name
               select new Person()
               {
                  Name = a.Name,
                  Address = a.Address
                  Country = b.Country ?? a.Country
                  Continent = b.Continent ?? a.Continent
               }).ToList();

You can play with the conditions however you want and maybe even mix them to have multi-level conditions on both a and b.

A: Firstly you should create a new Person. So your query should be like this:
var resulttt = (from a in list1
                join b in list2 on a.Name equals b.Name
                select new Person
                {
                    Name = a.Name,
                    Address = a.Address ?? b.Address,
                    Country = a.Country ?? b.Country,
                    Continent = a.Continent ?? b.Continent
                }).ToList();

Secondly to show the result in the correct format and as you want you need to override the ToString method like this:
public class Person
{
    public string Name { get; set; }
    public string Address { get; set; }
    public string Country { get; set; }
    public string Continent { get; set; }

    public override string ToString()
    {
        return String.Format("Name = {0}, Address = {1}, Country = {2}, Continent = {3}", Name,Address,Country,Continent);
    }
}

Finally by iterating through the result you will get your desired result. Like this:
foreach (var item in result)
{
    Console.WriteLine(item);
}

Output:

Name:Jon, Address=loc1,Country=US,Continent=NA
Name:Ryan, Address=loc2,Country=Germany,Continent=Europe

A: You want a Tuple:
List<Tuple<Person, Person>> result = (
from a in list1
join b in list2 on a.Name equals b.Name
select Tuple.Create(a, b)
).ToList();

A: If List 1 always has Address and List 2 always has Country and Continent, your linq statement would look something like
var  result = (from a in list1 join b in list2 on a.Name equals b.Name select new Person { Name = a.Name, Address = a.Address, Country = b.Country, Continent = b.Continent }).ToList();


text:
Q: Uncompleted code Shiny App, mtcars dataset, how to make four user inputs to four different graphs I'm unsure of the code I need to put in the mainPanel portion to have the mainPanel graph change based on the user input.
I have four working graphs all tied to the mtcars dataset:
first graph, lets call "counts":
counts <- table(mtcars$gear)
          barplot(counts, main="Car Distribution",
          xlab="Number of Gears")

second graph lets call "Horizontal Counts":
Horizontalcounts <- table(mtcars$gear)
                   barplot(counts, main="Car Distribution", horiz=TRUE,
                   names.arg=c("3 Gears", "4 Gears", "5 Gears"))

third graph lets call "stacked bar chart":
stackedbarchart <- table(mtcars$vs, mtcars$gear)
                   barplot(counts, main="Car Distribution by Gears and VS",
                   xlab="Number of Gears", col=c("darkblue","red"),
                   legend = rownames(counts))

and the fourth graph called "grouped bar chart":
groupedbarchart <- table(mtcars$vs, mtcars$gear)
                  barplot(counts, main="Car Distribution by Gears and VS",
                  xlab="Number of Gears", col=c("darkblue","red"),
                  legend = rownames(counts), beside=TRUE)

I want to do the following with Shiny, the user has four options ( the four charts listed above) when one is selected, the graph will then show. So a simple shiny app, user selects a graph and the graph shows up on the main panel.
I have the following code and it runs, but the graphs do not show up:
library(shiny)
library(ggplot2)

setwd("wd")
myData <- mtcars

ui <- fluidPage(
     titlePanel("cars graphs"),
     sidebarLayout(
          sidebarPanel(selectInput("carsInput", " car graph Choice",
                         choices = c("counts", "Horizontal counts", "stacked bar chart", "grouped bar chart"),
                          selected = "counts" )),
        mainPanel( plotOutput("unsure?"),
                    br(), br(),
                     tableOutput("results")
    )
 )
)

server <- function(input, output) {

       output$plotOutput <- reactive({
            if (input$carsInput == "counts")
        {

  counts <- table(mtcars$gear)
  barplot(counts, main="Car Distribution",
          xlab="Number of Gears")

    }
if (input$carsInput == "horizontal counts")
  {

  counts <- table(mtcars$gear)
  barplot(counts, main="Car Distribution", horiz=TRUE,
          names.arg=c("3 Gears", "4 Gears", "5 Gears"))

}

if (input$carsInput == "stacked bar chart")
{

  counts <- table(mtcars$vs, mtcars$gear)
  barplot(counts, main="Car Distribution by Gears and VS",
          xlab="Number of Gears", col=c("darkblue","red"),
          legend = rownames(counts))

}
if (input$carsInput == "grouped bar chart")
{

  counts <- table(mtcars$vs, mtcars$gear)
  barplot(counts, main="Car Distribution by Gears and VS",
          xlab="Number of Gears", col=c("darkblue","red"),
          legend = rownames(counts), beside=TRUE)

}
}

 } )

 }
shinyApp(ui = ui, server = server)

I'm unsure of the code I need to put in the mainPanel portion to have the mainPanel graph change based on the user input. Do you have any idea?

A: I think you need to use renderPlot if you want to see plots in UI like this
 library(shiny)
    library(ggplot2)

    myData <- mtcars

    ui <- fluidPage(
        titlePanel("cars graphs"),
        sidebarLayout(
            sidebarPanel(selectInput("carsInput", " car graph Choice",
                                     choices = c("counts", "Horizontal counts", "stacked bar chart", "grouped bar chart"),
                                     selected = "counts" )),
            mainPanel( plotOutput("plotOutput"),
                       br(), br(),
                       tableOutput("results")
            )
        )
    )

    server <- function(input, output) {

        output$plotOutput <- renderPlot({
            if (input$carsInput == "counts")
            {

                counts <- table(mtcars$gear)
                barplot(counts, main="Car Distribution",
                        xlab="Number of Gears")

            }
            if (input$carsInput == "Horizontal counts")
            {

                counts <- table(mtcars$gear)
                barplot(counts, main="Car Distribution", horiz=TRUE,
                        names.arg=c("3 Gears", "4 Gears", "5 Gears"))

            }

            if (input$carsInput == "stacked bar chart")
            {

                counts <- table(mtcars$vs, mtcars$gear)
                barplot(counts, main="Car Distribution by Gears and VS",
                        xlab="Number of Gears", col=c("darkblue","red"),
                        legend = rownames(counts))

            }
            if (input$carsInput == "grouped bar chart")
            {

                counts <- table(mtcars$vs, mtcars$gear)
                barplot(counts, main="Car Distribution by Gears and VS",
                        xlab="Number of Gears", col=c("darkblue","red"),
                        legend = rownames(counts), beside=TRUE)

            }
        })

    }

    shinyApp(ui = ui, server = server)


text:
Q: How does Object this concept link itself to other concepts like glGenBuffers , glBindBuffer , glBufferData . etc? e.g. Vertex Buffer Object . However , I know what it is , and it is something used to store datas representing some specific places in a certain space , which would be called by GL later to draw specific images , hence when drawing , GL would extract datas from VBO , and the word 'buffer' stands for 'vessel' , storing various things from vertex to others , and I know there were firstly datas in CPU , then datas passed to GPU for quick calling . I know all these things , but what exactly does Object this word mean ? How does Object this concept link itself to other concepts like glGenBuffers , glBindBuffer , glBufferData . etc ? What did the Object this class do when GPU had the need to receive datas from CPU?
I had referred to https://www.khronos.org/opengl/wiki/OpenGL_Object but its description looks weird . Doesn't glBindBuffer generate object itself ? Why does the author call it 'state' , hinting there was already object when glGenBuffer ?
Thx for your answers


text:
Q: Initializing data member of struct in C++ //Not able to figure out how we can initialize data member of an struct inside
//struct . I believe this is against the guidelines of OOP . The below program is not showing any compiler error and runs fines and gives output 10  30
#include<iostream>
using namespace std;
struct Accumulator
{
    int counter = 0;
    int operator()(int i) { return counter += i; }
};
int main(void)
{
   Accumulator acc;
   cout << acc(10) << endl; //prints "10"
   cout << acc(20) << endl; //prints "30"
}

A: The rules regarding in class initialization have changed.  Starting in C++11 you can initialize a non static class member directly in the class body.  This is just syntactic sugar though.  When you write
struct Accumulator
{
    int counter = 0;
    int operator()(int i) { return counter += i; }
};

The compiler will actually add the initialization of counter to the default constructor.  So the above code would get translated to
struct Accumulator
{
    int counter;
    Accumulator() : counter(0) {}
    int operator()(int i) { return counter += i; }
};

This initialization is also suppressed if you supply your own initialization.  If we had
struct Accumulator
{
    int counter = 0;
    int sum = 0;
    Accumulator() {}
    Accumulator(int counter) : counter(counter) {}
    int operator()(int i) { return counter += i; }
};

Then Accumulator() {} would actually be
Accumulator() : counter(0), sum(0) {}

and Accumulator(int counter) : counter(counter) {} would be
Accumulator(int counter) : counter(counter), sum(0) {}

A: That's done with the constructor, to which you can pass the initial value.
Something like:
struct Accumulator
{
    Accumulator(int initial = 0)
        : counter(initial)
    {}

    int counter;

    int operator()(int i) { return counter += i; }
};

int main(void)
{
    Accumulator acc(20);
    std::cout << acc(10) << '\n'; //prints "30"
    std::cout << acc(20) << '\n'; //prints "50"

    // Reset accumulator
    acc = Accumulator();  // Use constructors default argument
    std::cout << acc(10) << '\n'; //prints "10"
    std::cout << acc(20) << '\n'; //prints "30"
}

If you wonder why it's working without the constructor too, that's because the structure without a constructor is an aggregate and you can use aggregate initialization.
If you wonder about the initialization of the counter member, it's because it's a non-static data member and since the C++11 standard those can be initialized like that.


text:
Q: Need help updating text, javascript I am making a game in javascript for school but I ran into a problem with updating the counters. Here is the code I am having trouble with:

function drawUnits() {
  ctx.drawImage(log, 380, 5, 32, 32);
  ctx.textBaseline = "top";
  ctx.fillText(logy, 420, 21);
  ctx.textBaseline = "bottom";
  ctx.fillText("Logs", 420, 21);
}

function Dayend(message) {
  if (message == 1) {
    ctx.width = ctx.width;
    alert("You chopped some trees");
    var logy = logy + 4;
    DrawUnits()
  }
}

window.addEventListener('keydown', function(event) {
  if (event.keyCode == 85) {
    Dayend(1);
  }
});

With logy being a variable which is defined earlier and log being a picture als defined earlier.
I don't get what is wrong with the code but as soon as I press the button I do get the alert but the counter doesn't update
Thank you all, I used both your answers and changed some unrelated stuff and it magically worked again :)

A: The code is missing several close brackets, so it is not runnable. Please fix it. Also, in you comment you mention that logy is defined somewhere before the above code, but you are redefining a local variable with the sam ename in the Dayend() function. Could that be your issue, that the local logy variable is getting set instead of your global one? Try chaiging:
var logy = logy + 4;

to
logy += 4;

A: You are re-instantiating the variable logy with var. Try replacing the last few lines with this:
function Dayend(message) {
    if(message == 1){
        ctx.width = ctx.width;
        alert("You chopped some trees");
        logy = logy + 4;
        DrawUnits()
    }
}

You also need to make sure that logy is tracked on the global state, and that you aren't overwriting it somewhere else. You might be better off passing the value to DrawUnits().


text:
Q: Problem of loading new .NET CORE into Visual Studio 2017 c# .NET CORE project I have installed both .NET CORE 3.1. and preview 5.0. I see it when I type command:
dotnet --list-sdks
I see all packages

but when I want to use it in VS project in C# .NET CORE console app I cannot.

A: I have not tried .NET CORE 3.x with VS 2017 but according this page it is possible that is is supported only in VS 2019.
You might also try to restart Visual Studio. I think it loads installed frameworks only during startup.
Also check out this thread. You might find there some answers


text:
Q: Custom page template not showing on page creation I'm using underscores as the base for a theme and I can't figure out how to build custom pages templates.
I created a nosidebar.php and put this at its tope
<?php /* Template Name: WithoutSidebar */ ?>

It won't show on the page creation's dropdown, though. Only custom page I managed to make show there is front-page.php, which is already expected by WP's hierarchy.
I tried many solutions I found on Google (checking the root for style.css, etc) and none worked.
Can someone please shine a light over this?
I'm using WP 4.7.5


text:
Q: Comparison $\sum_{k=0}^{\infty} a_k$, $\sum_{k=0}^{\infty} a_{n_k}$ with $\lim_{k\rightarrow\infty}\frac{n_k}{k}=l<\infty$ We all know the Limit comparison test:

Suppose that we have two series $\sum_{k=0}^{\infty} a_k$, $\sum_{k=0}^{\infty} b_{k}$ with  $a_k, b_k \geq 0$  for all  $k$.
  Then if  $\lim_{k \to \infty} \frac{a_k}{b_k} = c$ with  $0 < c < \infty$  then either both series converge or both series diverge.

Now, we suppose that there exists a sequence $n_k$ such that $\lim_{k\rightarrow\infty}\frac{n_k}{k}=l<\infty$. Then, can we conclude that either both series converge or both series diverge? Is it an equivalent form of the Limit comparison test?

A: If $\sum a_k$ (with all $a_k\ge 0$) converges then so does $\sum a_{n_k}$, but we cannot conclude inthe other direction. For example let $n_k=2k$, $a_k=1-(-1)^k$.

A: This looks close to the Cauchy condensation test. For it to work, you would need the sequence $(a_k)$ monotonically decresing towards zero as well.
Then
$\sum_k (n_k-n_{k-1})a_{n_k}\le \sum_k a_k\le\sum_k (n_{k+1}-n_k)a_{n_k}$
However, it is not clear to me if the size of $(n_{k+1}-n_k)$ can be meaningfully bounded by $l$.


text:
Q: QML Rendering Engine: frame refresh event Performance Considerations And Suggestions article says:

As an application developer, you must strive to allow the rendering
  engine to achieve a consistent 60 frames-per-second refresh rate. 60
  FPS means that there is approximately 16 milliseconds between each
  frame in which processing can be done, which includes the processing
  required to upload the draw primitives to the graphics hardware.

Is there an event or signal or any form of callback to make the code be called with that refresh?
The goal is to eliminate the need for handling the signal from the rendering thread in the UI thread slot. If the new data arrived then it will be drawn or marked for the next refresh to be drawn (with update() call).

A: QQuickWindow has a bunch of signals for the purpose of synchronization -  beforeRendering(), afterRendering(), beforeSynchronizing(), afterSynchronizing(), frameSwapped(). Take your pick.


text:
Q: i can't navigate to router-outlet inside another I have 2 router-outlet in my project and one inside on the other the first one is the default app router-outlet and the second one is inside one of the 'home' component in which I want to show other components when I click on the toolbarso  this was the solution that I found to navigate  to the second one
html file :
   <mat-toolbar >
      Session

      <button mat-button style="background-color: #80D0D0" (click)="logout()">logout</button>

    </mat-toolbar>
    <mat-drawer-container >
      <mat-drawer-content style="color: #333333 ;background-color: white">
        <router-outlet name="second"></router-outlet>

      </mat-drawer-content>
    </mat-drawer-container>

AppRoutingModule file :
 const routes: Routes = [

  {path:'sessionag',
    component:SessionAgComponent,outlet:'second'},

];

but this is not working for me i don't know why .
did i do something wrang or it does not work like this

A: If you're not navigating to the primary router, you have to tell angular what router-outlet you want to route to.
Using the routerLink directive you can specify the outlet you want to route to:

  Session

Demo on Stackblitz

A: so what I was looking for actually is a router outlet inside another and the answer that I found is to add the component  as  children of the component in which I want to add the second router-outlet like this :
in app-routing-module
    const routes: Routes = [
      {path:'home',
    component:HomepageComponent,
    children:[
      {path:'sessionag',
        component:SessionAgComponent},
      {path:'sessiontek',
        component:SessionTekComponent},
    ]
  },
];

in the .ts file
this.router.navigate(['/home/sessionag']);

in HTML file
 <router-outlet ></router-outlet>


text:
Q: How can I dynamically require an npm dependency file loaded with webpack? I want to do something like:
var dynamicRequire = require.context('./', true);
console.log(dynamicRequire.keys());
dynamicRequire('react/foo/bar');

But the console.log only shows files from the local directory, not the npm packages. When webpack builds i can see it get included as number 234 but the mapping from that path to that number is lost. How can I accomplish this? Thanks!

A: I'm not sure, what your problem exactly is here, but I suspect, that for your purpose you have just forgotten to provide require.context with second argument, which is a flag, that decides, whether the webpack should look into your subfolders and pick your files there also. So you could use require.context('./', true, [some regexp maybe ?]).
Let me know if that's not addressing your problem.


text:
Q: TextBox Cursor is NOT blinking I have a WPF datagrid (4.0) with a custom column (derived from DataGridTextColumn).
In GenerateEditingElement I create a custom textbox control (with an additional button) and like to set the cursor into it so that the user can directly start editing.
The closest I get is that the caret is shown but is not blinking and I need an additional click to start editing.
All other stuff (binding, ...) is working nicely
Any ideas?

A: Since the caret is shown, but not blinking, then I am guessing your control has Logical Focus,  but not Keyboard Focus.
How are you setting the control as Focused?
myControl.Focus(); will give the control logical focus, but it won't respond to keyboard events because it doesn't have Keyboard focus. To give an element KeyboardFocus, use
Keyboard.Focus(myControl);

This is because WPF allows you to define multiple Focus Scopes, and each scope can have it's own focused element, however only one control in the entire application can have Keyboard Focus


text:
Q: Derivative: a special tangent I've learned in Euclidean Geometry that the tangent is a line which pass through only a point. For example, if someone ask me to find the tangent at this point $A$, I can easily say that the tangent can be drawn like this:

In higher dimensions it seems that the things are a little bit more complicated. For instance, if we have a curve (the helix)
$$\alpha(t):\mathbb R\to \mathbb R^3,\ \alpha(t)=(a\cos t,a\sin t,bt)$$
We can have a infinite lines which are tangent to a given point in the helix. However, we usually say that the tangent to a given point is the derivative $\alpha'(t)$:

What makes the derivative a so special tangent? there are a lot of tangents which passes through a given point, but we usually say that $\alpha'(t)$ is THE tangent, why?
Thanks in advance

A: First, you should be a little clearer: the "tangent at this point $A$" doesn't make sense until you say "the tangent to the circle at the point $A$", because there could be many other shapes that pass through $A$ and have a tangent there.
Next, the derivative isn't defined to be the tangent (or to "touch at only one point"); rather, it's defined by a limit
$$
f'(a) = \lim_{h \rightarrow 0} \frac{f(a+h) - f(a)}{h}
$$
whose value, if the limit exists, is the slope of a line that's tangent to the graph of $y = f(x)$ at the point $(a, f(a))$, in the sense that for nice enough functions $f$, if you look at the graph of $f$ near the point $(a, f(a))$, it's generally a smooth enough bit of curve that there's a tangent line to it in the sense that you're used to thinking about tangent lines.
The reason the derivative's defined that way is that it captures the notion of how the value $f(x)$ is changing as $x$ passes through $a$. If $f(a+h)$ happened to equal $f(a)$ for $h$ near $0$, then we could say that $f$ was "locally constant" and there's no change there, which would be reflected in the fact that the limit turns out to produce $f'(a) = 0$.
So on to 3D: we plot $\alpha(t)$, representing, for instance, the position of a bumblebee at time $t$. What should $\alpha'(a)$ represent? Some description of how $\alpha(t)$ is changing at time $t = a$. What's that mean? It means something like "in which direction, and how fast, is the bumblebee going?" If the bee is travelling in the spiral path shown in your diagram, then the arrow labelled $\alpha'(t)$ captures this notion, while some other line through the point $\alpha(t)$ -- a horizontal line, for instance -- does not. Since derivatives were developed to describe changes and rates of change, the former is the preferred line.

A: When the given curve $\gamma$ is a circle, an ellipse, or even a helix, one can put forward a "geometrically intuitive" argument what the tangent at a point $P\in\gamma$ should be. But for a curve which is not generated by some elementary geometric process, but is given by an equation, a parametric representation, or as a complicated locus, it is by no means evident how to arrive "geometrically" at the tangent. The main reason for this is that there is no concept of "tangency", or the opposite: "transversality", without entering into differential calculus somehow.


text:
Q: Android Studio: "Allocation Tracker Nothing to Show" I am trying to Identify memory leaks with the Android Studio Allocation Tracker but when i follow the description I simply get a nice empty window saying  "nothing to show"

According to the description a nice representation of where all my memory has been allocated should be shown now.
Can someone please help me? I have spend two days now trying to come up with a good way to identify memory leaks.

A: As you see in my screenshot i had pending platform and plugin updates. I updated and now it works...


text:
Q: Calling static method in one Activity from another Activity I have these methods in X.class:
    public void sendMessage(String message) {
    // Check that we're actually connected before trying anything
    if (mChatService.getState() != BluetoothChatService.STATE_CONNECTED) {
        Toast.makeText(this, R.string.not_connected, Toast.LENGTH_SHORT).show();
        return;
    }

    // Check that there's actually something to send
    if (message.length() > 0) {
        // Get the message bytes and tell the BluetoothChatService to write
        byte[] send = message.getBytes();
        mChatService.write(send);

        // Reset out string buffer to zero and clear the edit text field
        mOutStringBuffer.setLength(0);
        //mOutEditText.setText(mOutStringBuffer);
    }
}

public static void sendMessage1(String message1){

    call1.sendMessage(message1);
}

And I have the following toggleSwitch that Im clicking from another acitvity namely Y.class:
tb3.setOnClickListener(new OnClickListener() {
        public void onClick(View v){
            if (tb3.isChecked()){
                String message = "u";
                X.sendMessage1(message);
                //clearer();
            } else if (!tb3.isChecked()){
                String message = "y";
                //clearer();
            }
        }
    });

Though I'm not getting any errors while coding but when I load the app on Android and then click on this toggleswitch my app dies?
Log:
E/AndroidRuntime( 4866): java.lang.NullPointerException
E/AndroidRuntime( 4866):    at com.winacro.andRHOME.andRHOME.sendMessage1(andRHOME.java:282)
E/AndroidRuntime( 4866):    at com.winacro.andRHOME.EECA2$1.onClick(EECA2.java:57)
E/AndroidRuntime( 4866):    at android.view.View.performClick(View.java:3534)
E/AndroidRuntime( 4866):    at android.widget.CompoundButton.performClick(CompoundButton.java:104)
E/AndroidRuntime( 4866):    at android.view.View$PerformClick.run(View.java:14263)
E/AndroidRuntime( 4866):    at android.os.Handler.handleCallback(Handler.java:605)
E/AndroidRuntime( 4866):    at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 4866):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 4866):    at android.app.ActivityThread.main(ActivityThread.java:4441)
E/AndroidRuntime( 4866):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 4866):    at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 4866):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime( 4866):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/AndroidRuntime( 4866):    at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager(  273):   Force finishing activity com.winacro.andRHOME/.EECA2


text:
Q: Apache rewriting without mod_rewrite? How can Apache be rewriting URLs without mod_rewrite enabled or configured?
I'm working on a site redesign from my development server.  I was using a directory structure for site sections, but I am considering switching to URL rewriting and putting related files in the site's root.
For example, the about page has a subdirectory named about that contains an index.php which is served when the request is http://www.example.com/about.  I plan to change this so that about.php from the site's root directory is served even if the request doesn't include the php extension.
On my development server, the problem is that the URLs are already being rewritten even though I don't have an .htaccess file anywhere along the path hierarchy.
The Apache configuration is the stock Ubuntu configuration and I suspect that it's something unique to Ubuntu, but I can't find the cause.
Here are some observations I've made:

*

*/etc/apache2/httpd.conf is empty, but the configuration is in /etc/apache2/apache2.conf which in turn Includes config files from a few other directories.

*There were no .htaccess files anywhere in the hierarchy of this site.  I've checked every directory starting at /var/www

*No .conf or .load files under /etc/apache2 have any reference to rewrite other than the rewrite.load file in /etc/apache2/mods-available.

*I've set the LogWarning directive to debug.  When I access a page without the .php extension, the error log shows the URL with the extension and the access log shows it without the extension and a HTTP 200 status.  The page is served properly.

*If I do add a .htaccess file with the appropriate configuration, I get an .htaccess: Invalid command 'RewriteEngine' error. ... mod_rewrite wasn't even loaded by default.

*If I enable mod_rewrite by linking to the load file in /etc/apache2/mods-enabled it works as expected, which is to say exactly the same as if I didn't enable it.

access.log shows:
127.0.0.1 - - [16/Jan/2012:05:36:35 +0800] "GET /dev/ghodmode.com/h5bp/ HTTP/1.1" 200 3602 "http://alienware/dev/ghodmode.com/h5bp/experiments" "Mozilla/5.0 (Ubuntu; X11; Linux x86_64; rv:8.0) Gecko/20100101 Firefox/8.0"

while error.log shows:
[Mon Jan 16 05:23:23 2012] [debug] mod_deflate.c(615): [client 127.0.0.1] Zlib: Compressed 5347 to 1876 : URL /dev/ghodmode.com/h5bp/experiments.php, referer: http://alienware/dev/ghodmode.com/h5bp/

If I add an .htaccess file:
[Mon Jan 16 05:34:33 2012] [alert] [client 127.0.0.1] /var/www/dev/ghodmode.com/h5bp/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://alienware/dev/ghodmode.com/h5bp/experiments

Update
Thanks to answers provided, I've been reading and I've learned a few things.  The gist of it is that I'm using a stock Ubuntu installation of Apache2 and I haven't changed any configuration settings from the default.  So, none of the suggested causes are set.
Of course there is the chance that I've misunderstood some of the documentation.  This is the first time I've read about some of these options.
Multiviews
Multiviews provides the best explanation of this scenario, but that requires a type map or MultiViews option set for a path.  I only have one type map (/etc/apache2/mods-enabled/mime.conf) for 'var' and the MultiViews option is only set for /usr/share/apache2/icons.  So, this couldn't be it.
Redirect & RedirectMatch
Redirect & RedirectMatch would provide a good explanation for this behavior, but it requires a directive for each redirection.  I don't have any of these set and any path that I type serves the related php file if it exists.  Also, if this was the cause, I think that the access.log would generate a 3xx status instead of 200 if it was a redirect.
Alias & AliasMatch
Alias & AliasMatch, like Redirect & RedirectMatch, requires a directive to be set for each resource.  I only have an alias set for /icons/.
FallbackResource
FallbackResource identifies a single resource to serve when the requested resource isn't present.  In my case, when the requested resource isn't present it serves the resource found by appending '.php' to the end of the request.  I also double-checked and there are no FallbackResource directives set.
Here's an example of the command I use to confirm that there a particular option isn't set anywhere:
find /etc/apache2 -name "*.conf" -exec grep -li "FallbackResource" {} \;

Update #2:
There was a hole in my search for the MultiViews option. I was only looking for files with a .conf or .load extension, but some of the configuration files don't have an extension at all. The MultiViews option is set by the default site configuration file /etc/apache2/sites-enabled/000-default.
Thanks to @zneak for providing the answer first, although he did it in a comment.  And thanks to @regilero who indirectly showed me what I was missing by using a different syntax for grep from the syntax I'm used to.

A: What you call a rewrite can be done by a lot of others instructions:

*

*Redirect & RedirectMatch : for external redirection (with 301,302 or even 403 or 404 codes

*Alias & AliasMatch : for internal redirection (internal directory re-mapping for example)

*FallBackresource : to redirect every missing file to an index.php boostrap

*Option Multiviews : from mod-autoindex which is enabled by default on a lot of installations

Theses configuration things are usually not in .htaccess files by default, as .htaccess files is just a bad thing slowing down apache and allowing user to add some other rules than the one defined in VirtualHosts. Most usefull configuration stuff is in /etc/apache2/sites-enabled, /etc/apaches2/mod-enableds/ and /etc/apache2/conf.d/.
Now the strangest one is Option Multiviews make a grep -R MultiViews /etc/apache2/*. This option will map any call to http://www.example.com/foo/bar to foo/bar.php or foo/bar.html if theses directories exists in the DocumentRoot and if theses files exists (trying on all available extensions).


text:
Q: How do you correctly and programmatically recycle an app pool on an IIS server This is what I am currently doing
public static string RecycleSite(string siteName)
{
    try
    {
        using (ServerManager iisManager = new ServerManager())
        {
            SiteCollection sites = iisManager.Sites;
            foreach (Site site in sites)
            {
                if (site.Name == siteName)
                {
                    ObjectState os = iisManager.ApplicationPools[site.Applications["/"].ApplicationPoolName].Recycle();
                    return "Recycle Successful";
                }
            }
        }
        return "Recycle Unsuccessful";
    }
    catch(Exception ex)
    {
        return "Recycle Unsuccessful: " + ex;
    }

I have viewed multiple other threads, but none seem to have the answer I am look for. I want to use the Server Manager class to recycle a specific IIS site. This current solution does a "recycle" but it also kills any active connections that are still present. The IIS manager is set up so I can begin a new instance while there are persisting connections on the current instance until those connections have closed on their own.
Is my solution correct or do I need to go about recycling in a more direct way? This is part of a console application that is set to run as an admin so that my other service that is calling is can sit under a user account (security reasons). Using IIS 8.5 on Server 2012 R2.