问:
Liferay JSF theme display issue
Am newbie to Liferay and i have created the JSF plugin project. Liferay and Liferay SDK version is 7 i have using. I got issue when am deploying and running service. I have configured with with following ivy.xml.

```<code><?xml version="1.0"?>
<ivy-module
version="2.0"
xmlns:m2="http://ant.apache.org/ivy/maven"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
>
<info module="portlet_primefaces_tmpl" organisation="com.liferay">
    <extends extendType="configurations,description,info" location="../../ivy.xml" module="com.liferay.sdk" organisation="com.liferay" revision="latest.integration" />
</info>

<dependencies defaultconf="default">
    <dependency name="jboss-el" org="org.jboss.el" rev="2.0.1.GA" />
    <dependency name="jsf-api" org="com.sun.faces" rev="2.2.5" />
    <dependency name="jsf-impl" org="com.sun.faces" rev="2.2.5" />
    <dependency name="liferay-faces-bridge-api" org="com.liferay.faces" rev="4.2.5-ga6" />
    <dependency name="liferay-faces-bridge-impl" org="com.liferay.faces" rev="4.2.5-ga6" />
    <dependency name="liferay-faces-portal" org="com.liferay.faces" rev="4.2.5-ga6" />
    <dependency name="liferay-faces-util" org="com.liferay.faces" rev="4.2.5-ga6" />
    <dependency name="org.primefaces.primefaces" org="com.liferay" rev="3.5" />
    <dependency conf="test->default" name="arquillian-junit-container" org="org.jboss.arquillian.junit" rev="1.1.6.Final" />
    <dependency conf="test->default" name="arquillian-tomcat-remote-7" org="org.jboss.arquillian.container" rev="1.0.0.CR6" />
    <dependency conf="test->default" name="com.liferay.ant.arquillian" org="com.liferay" rev="1.0.0-SNAPSHOT" />
</dependencies>
</code>```

When running the service i got the exception as follows

```java.lang.ClassNotFoundException: com.liferay.portal.theme.ThemeDisplay cannot be found by jsfneon-portlet_7.0.0.1
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:394)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:357)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:349)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.liferay.faces.bridge.context.internal.BridgePortalContextLiferayCompatImpl.isLiferayNamingspacingParameters(BridgePortalContextLiferayCompatImpl.java:47)
at com.liferay.faces.bridge.context.internal.BridgePortalContextLiferayImpl.<init>(BridgePortalContextLiferayImpl.java:92)
at com.liferay.faces.bridge.filter.internal.BridgePortletRequestFactoryImpl.getRenderRequest(BridgePortletRequestFactoryImpl.java:82)
at com.liferay.faces.bridge.internal.BridgePhaseRenderImpl.<init>(BridgePhaseRenderImpl.java:77)
at com.liferay.faces.bridge.internal.BridgePhaseFactoryImpl.getBridgeRenderPhase(BridgePhaseFactoryImpl.java:52)
at com.liferay.faces.bridge.internal.BridgeImpl.doFacesRequest(BridgeImpl.java:133)
at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:258)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:359)
at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:207)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:262)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:105)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at com.liferay.portal.osgi.web.wab.extender.internal.adapter.ServletExceptionAdapter.service(ServletExceptionAdapter.java:68)
at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:50)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:115)
at com.liferay.portal.osgi.web.wab.extender.internal.adapter.FilterExceptionAdapter.doFilter(FilterExceptionAdapter.java:46)
at org.eclipse.equinox.http.servlet.internal.registration.FilterRegistration.doFilter(FilterRegistration.java:121)
at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:45)
at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:70)
at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:117)
at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:529)
at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:604)
at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:391)
at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.render(MonitoringInvokerPortlet.java:261)
at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1549)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:64)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.portlet.PortletContainerImpl._doRender(PortletContainerImpl.java:671)
at com.liferay.portlet.PortletContainerImpl.render(PortletContainerImpl.java:145)
at com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrapper.java:126)
at com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrapper.java:126)
at com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:155)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer._render(PortletRenderer.java:126)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer.render(PortletRenderer.java:73)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doProcessTemplate(RuntimePageImpl.java:444)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doDispatch(RuntimePageImpl.java:286)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.processTemplate(RuntimePageImpl.java:113)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.processTemplate(RuntimePageImpl.java:125)
at com.liferay.portal.kernel.layoutconfiguration.util.RuntimePageUtil.processTemplate(RuntimePageUtil.java:70)
at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portlet_jsp.java:747)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:115)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:523)
at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:67)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.portal.model.impl.LayoutTypeControllerImpl.includeLayoutContent(LayoutTypeControllerImpl.java:168)
at com.liferay.portal.model.impl.LayoutImpl.includeLayoutContent(LayoutImpl.java:869)
at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:339)
at com.liferay.portal.action.LayoutAction.doExecute(LayoutAction.java:178)
at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:75)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:170)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:568)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:545)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.monitoring.internal.servlet.filter.MonitoringFilter.processFilter(MonitoringFilter.java:180)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.init.servlet.filter.internal.InitFilter.processFilter(InitFilter.java:52)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.uploadservletrequest.UploadServletRequestFilter.processFilter(UploadServletRequestFilter.java:93)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:303)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:115)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:466)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318)
at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:172)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.monitoring.internal.servlet.filter.MonitoringFilter.processFilter(MonitoringFilter.java:180)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.uploadservletrequest.UploadServletRequestFilter.processFilter(UploadServletRequestFilter.java:93)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:336)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:303)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:269)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.cache.CacheFilter.processFilter(CacheFilter.java:422)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:86)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:268)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:115)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:466)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318)
at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:358)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
at com.liferay.portal.servlet.filters.urlrewrite.UrlRewriteFilter.processFilter(UrlRewriteFilter.java:65)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:115)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
```

I have stuck with this problem. And i had no idea to overcome this. I got this issue only when using as plugin project. When am using Liferay JSF project it's working fine.

答:
I was using the wrong versions of the Liferay Faces jars. https://liferayfaces.org shows the correct versions that should be used. I have edited Ivy.xml with another dependency configuration. And deleted the list of jars which is generated when deployed the JSF portlet in lib folder. And i have replaced the following jars into my lib (WEB-INF) folder.

com.liferay.faces.bridge.api-4.0.0.jar

com.liferay.faces.bridge.ext-5.0.0.jar

com.liferay.faces.bridge.impl-4.0.0.jar

com.liferay.faces.util-3.0.0.jar

commons-fileupload-1.3.1.jar

commons-io-2.4.jar

javax.faces-2.2.13.jar

javax.faces-api-2.2.jar

jboss-el-2.0.1.GA.jar

Ivy.xml is

```<code><?xml version="1.0"?>
<ivy-module
version="2.0"
xmlns:m2="http://ant.apache.org/ivy/maven"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
>
<info module="portlet_jsf_tmpl" organisation="com.liferay">
    <extends extendType="configurations,description,info" location="../../ivy.xml" module="com.liferay.sdk" organisation="com.liferay" revision="latest.integration" />
</info>

<dependencies defaultconf="default">
    <dependency name="jboss-el" org="org.jboss.el" rev="2.0.1.GA" />
    <dependency name="com.liferay.faces.bridge.impl" org="com.liferay.faces" rev="4.0.0" />
    <dependency name="com.liferay.faces.bridge.ext" org="com.liferay.faces" rev="5.0.0" />
    <dependency name="javax.faces-api" org="javax.faces" rev="2.2" />
    <dependency name="javax.faces" org="org.glassfish" rev="2.2.13" />
    <dependency name="liferay-faces-portal" org="com.liferay.faces" rev="3.2.4-ga5" />
    <dependency conf="test->default" name="arquillian-junit-container" org="org.jboss.arquillian.junit" rev="1.1.6.Final" />
    <dependency conf="test->default" name="arquillian-tomcat-remote-7" org="org.jboss.arquillian.container" rev="1.0.0.CR6" />
    <dependency conf="test->default" name="com.liferay.ant.arquillian" org="com.liferay" rev="1.0.0-SNAPSHOT" />
</dependencies>
</code>```

Now i can able to deploy and view the JSF portlet in portal.

Title: Liferay JSF theme display issue

Body:
Am newbie to Liferay and i have created the JSF plugin project. Liferay and Liferay SDK version is 7 i have using. I got issue when am deploying and running service. I have configured with with following ivy.xml.

<?xml version="1.0"?>
<ivy-module
version="2.0"
xmlns:m2="http://ant.apache.org/ivy/maven"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
>
<info module="portlet_primefaces_tmpl" organisation="com.liferay">
    <extends extendType="configurations,description,info" location="../../ivy.xml" module="com.liferay.sdk" organisation="com.liferay" revision="latest.integration" />
</info>

<dependencies defaultconf="default">
    <dependency name="jboss-el" org="org.jboss.el" rev="2.0.1.GA" />
    <dependency name="jsf-api" org="com.sun.faces" rev="2.2.5" />
    <dependency name="jsf-impl" org="com.sun.faces" rev="2.2.5" />
    <dependency name="liferay-faces-bridge-api" org="com.liferay.faces" rev="4.2.5-ga6" />
    <dependency name="liferay-faces-bridge-impl" org="com.liferay.faces" rev="4.2.5-ga6" />
    <dependency name="liferay-faces-portal" org="com.liferay.faces" rev="4.2.5-ga6" />
    <dependency name="liferay-faces-util" org="com.liferay.faces" rev="4.2.5-ga6" />
    <dependency name="org.primefaces.primefaces" org="com.liferay" rev="3.5" />
    <dependency conf="test->default" name="arquillian-junit-container" org="org.jboss.arquillian.junit" rev="1.1.6.Final" />
    <dependency conf="test->default" name="arquillian-tomcat-remote-7" org="org.jboss.arquillian.container" rev="1.0.0.CR6" />
    <dependency conf="test->default" name="com.liferay.ant.arquillian" org="com.liferay" rev="1.0.0-SNAPSHOT" />
</dependencies>

When running the service i got the exception as follows

java.lang.ClassNotFoundException: com.liferay.portal.theme.ThemeDisplay cannot be found by jsfneon-portlet_7.0.0.1
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:394)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:357)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:349)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.liferay.faces.bridge.context.internal.BridgePortalContextLiferayCompatImpl.isLiferayNamingspacingParameters(BridgePortalContextLiferayCompatImpl.java:47)
at com.liferay.faces.bridge.context.internal.BridgePortalContextLiferayImpl.<init>(BridgePortalContextLiferayImpl.java:92)
at com.liferay.faces.bridge.filter.internal.BridgePortletRequestFactoryImpl.getRenderRequest(BridgePortletRequestFactoryImpl.java:82)
at com.liferay.faces.bridge.internal.BridgePhaseRenderImpl.<init>(BridgePhaseRenderImpl.java:77)
at com.liferay.faces.bridge.internal.BridgePhaseFactoryImpl.getBridgeRenderPhase(BridgePhaseFactoryImpl.java:52)
at com.liferay.faces.bridge.internal.BridgeImpl.doFacesRequest(BridgeImpl.java:133)
at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:258)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:359)
at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:207)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:262)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:105)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at com.liferay.portal.osgi.web.wab.extender.internal.adapter.ServletExceptionAdapter.service(ServletExceptionAdapter.java:68)
at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:50)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:115)
at com.liferay.portal.osgi.web.wab.extender.internal.adapter.FilterExceptionAdapter.doFilter(FilterExceptionAdapter.java:46)
at org.eclipse.equinox.http.servlet.internal.registration.FilterRegistration.doFilter(FilterRegistration.java:121)
at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:45)
at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:70)
at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:117)
at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:529)
at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:604)
at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:391)
at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.render(MonitoringInvokerPortlet.java:261)
at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1549)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:64)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.portlet.PortletContainerImpl._doRender(PortletContainerImpl.java:671)
at com.liferay.portlet.PortletContainerImpl.render(PortletContainerImpl.java:145)
at com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrapper.java:126)
at com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrapper.java:126)
at com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:155)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer._render(PortletRenderer.java:126)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer.render(PortletRenderer.java:73)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doProcessTemplate(RuntimePageImpl.java:444)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doDispatch(RuntimePageImpl.java:286)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.processTemplate(RuntimePageImpl.java:113)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.processTemplate(RuntimePageImpl.java:125)
at com.liferay.portal.kernel.layoutconfiguration.util.RuntimePageUtil.processTemplate(RuntimePageUtil.java:70)
at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portlet_jsp.java:747)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:115)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:523)
at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:67)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.portal.model.impl.LayoutTypeControllerImpl.includeLayoutContent(LayoutTypeControllerImpl.java:168)
at com.liferay.portal.model.impl.LayoutImpl.includeLayoutContent(LayoutImpl.java:869)
at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:339)
at com.liferay.portal.action.LayoutAction.doExecute(LayoutAction.java:178)
at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:75)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:170)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:568)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:545)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.monitoring.internal.servlet.filter.MonitoringFilter.processFilter(MonitoringFilter.java:180)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.init.servlet.filter.internal.InitFilter.processFilter(InitFilter.java:52)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.uploadservletrequest.UploadServletRequestFilter.processFilter(UploadServletRequestFilter.java:93)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:303)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:115)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:466)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318)
at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:172)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.monitoring.internal.servlet.filter.MonitoringFilter.processFilter(MonitoringFilter.java:180)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.uploadservletrequest.UploadServletRequestFilter.processFilter(UploadServletRequestFilter.java:93)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:336)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:303)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:269)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.cache.CacheFilter.processFilter(CacheFilter.java:422)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:86)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:268)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:115)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:466)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318)
at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:358)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
at com.liferay.portal.servlet.filters.urlrewrite.UrlRewriteFilter.processFilter(UrlRewriteFilter.java:65)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:115)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

I have stuck with this problem. And i had no idea to overcome this. I got this issue only when using as plugin project. When am using Liferay JSF project it's working fine.

Body:
I was using the wrong versions of the Liferay Faces jars. https://liferayfaces.org shows the correct versions that should be used. I have edited Ivy.xml with another dependency configuration. And deleted the list of jars which is generated when deployed the JSF portlet in lib folder. And i have replaced the following jars into my lib (WEB-INF) folder.

com.liferay.faces.bridge.api-4.0.0.jar

com.liferay.faces.bridge.ext-5.0.0.jar

com.liferay.faces.bridge.impl-4.0.0.jar

com.liferay.faces.util-3.0.0.jar

commons-fileupload-1.3.1.jar

commons-io-2.4.jar

javax.faces-2.2.13.jar

javax.faces-api-2.2.jar

jboss-el-2.0.1.GA.jar

Ivy.xml is

<?xml version="1.0"?>
<ivy-module
version="2.0"
xmlns:m2="http://ant.apache.org/ivy/maven"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
>
<info module="portlet_jsf_tmpl" organisation="com.liferay">
    <extends extendType="configurations,description,info" location="../../ivy.xml" module="com.liferay.sdk" organisation="com.liferay" revision="latest.integration" />
</info>

<dependencies defaultconf="default">
    <dependency name="jboss-el" org="org.jboss.el" rev="2.0.1.GA" />
    <dependency name="com.liferay.faces.bridge.impl" org="com.liferay.faces" rev="4.0.0" />
    <dependency name="com.liferay.faces.bridge.ext" org="com.liferay.faces" rev="5.0.0" />
    <dependency name="javax.faces-api" org="javax.faces" rev="2.2" />
    <dependency name="javax.faces" org="org.glassfish" rev="2.2.13" />
    <dependency name="liferay-faces-portal" org="com.liferay.faces" rev="3.2.4-ga5" />
    <dependency conf="test->default" name="arquillian-junit-container" org="org.jboss.arquillian.junit" rev="1.1.6.Final" />
    <dependency conf="test->default" name="arquillian-tomcat-remote-7" org="org.jboss.arquillian.container" rev="1.0.0.CR6" />
    <dependency conf="test->default" name="com.liferay.ant.arquillian" org="com.liferay" rev="1.0.0-SNAPSHOT" />
</dependencies>

Now i can able to deploy and view the JSF portlet in portal.

ContentLicense: CC BY-SA 4.0


来源: stackexchange

问:
card flipping front flips in different direction opposite of whats declared in the css why?
I have a parent div with a class of .card and it has to children div, that rotates in opposite directions when their parent is hovered over to create a flipping card. If you hover over it and wait until the transition finishes it works fine, however if you hover over it then move the mouse of before the animation finishes the div with a class of .front rotates in the opposite direction, why and is there a way to fix this? In addition if you move the mouse on and off multiple times both children start turning at different times even though they have the same trigger- why?

https://jsfiddle.net/8pktgqpu/15/

```<code>  .card,.front,.back{
    width: 100px;
    height: 160px;
    margin: 1px;
  }
  .card{
    position: relative;
  }
  .front{
    background-color: red;
    transform: perspective(400px) rotatey(0deg);
    backface-visibility: hidden;
    transition: transform 1s ease-in-out 0s;
  }
  .back{
    backface-visibility: hidden;
    transform: perspective(400px) rotatey(180deg);
    background-color: blue;
    transition: transform 1s ease-in-out 0s;
    position: absolute;
    top: 0;
  }

  .card:hover .front{
    transform: rotatey(-180deg);
  }
  .card:hover .back{
    transform: rotatey(0deg);
  }
</code>```

答:
Try this...

.card-container {
  perspective: 1000px;
}

.card-container:hover .card, .card-container.hover .card {
  transform: rotateY(180deg);
}

.card-container, .front, .back {
  width: 100px;
  height: 160px;
  margin: 1px;
}

.card {
  transition: 1s ease-in-out 0s;
  transform-style: preserve-3d;
  position: relative;
}

.front, .back {
  backface-visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
}

.front {
  z-index: 2;
  transform: rotateY(0deg);
  background-color: red;
}

.back {
  transform: rotateY(180deg);
  background-color: blue;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="card-container">
 <div class="card">
  <div class="front">
   front
  </div>
  <div class="back">
   back
  </div>
 </div>
</div></code>```

ContentLicense: CC BY-SA 3.0

Body:
I have a parent div with a class of .card and it has to children div, that rotates in opposite directions when their parent is hovered over to create a flipping card. If you hover over it and wait until the transition finishes it works fine, however if you hover over it then move the mouse of before the animation finishes the div with a class of .front rotates in the opposite direction, why and is there a way to fix this? In addition if you move the mouse on and off multiple times both children start turning at different times even though they have the same trigger- why?

https://jsfiddle.net/8pktgqpu/15/

  .card,.front,.back{
    width: 100px;
    height: 160px;
    margin: 1px;
  }
  .card{
    position: relative;
  }
  .front{
    background-color: red;
    transform: perspective(400px) rotatey(0deg);
    backface-visibility: hidden;
    transition: transform 1s ease-in-out 0s;
  }
  .back{
    backface-visibility: hidden;
    transform: perspective(400px) rotatey(180deg);
    background-color: blue;
    transition: transform 1s ease-in-out 0s;
    position: absolute;
    top: 0;
  }

  .card:hover .front{
    transform: rotatey(-180deg);
  }
  .card:hover .back{
    transform: rotatey(0deg);
  }

Body:
Try this...

.card-container {
  perspective: 1000px;
}

.card-container:hover .card, .card-container.hover .card {
  transform: rotateY(180deg);
}

.card-container, .front, .back {
  width: 100px;
  height: 160px;
  margin: 1px;
}

.card {
  transition: 1s ease-in-out 0s;
  transform-style: preserve-3d;
  position: relative;
}

.front, .back {
  backface-visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
}

.front {
  z-index: 2;
  transform: rotateY(0deg);
  background-color: red;
}

.back {
  transform: rotateY(180deg);
  background-color: blue;
}

<div class="card-container">
 <div class="card">
  <div class="front">
   front
  </div>
  <div class="back">
   back
  </div>
 </div>
</div>


问:
How to add Watermark in Reportviewer 2010?
Currently I build vb.net application and I use report viewer, but I want to add watermark (text) at the background of my report. Thank you in advance!</p>

答: You may basically add a text box from tool box, make the color gray, increase the font size and paste all other elements over this text box.</p>


问:
Storing elements in a property using modular Javascript
```<code>var menu = {

    //The elements we'll be using in the Menu
    elements: {},
    el: this.elements, //Doesn't work

    init: function() {

        el.$header = $('header');
        el.$myDiv = $('.arrow');

        el.$myDiv.on('click', function(e){
            e.stopPropagation();
            menu.open();
        });

    },

    open: function() {

        el.$header.addClass('whatever');
        ...
</code>```

I'm trying to learn some best practices for Javascript, and I'm having trouble with references to elements. I have an object, elements, which will be populated with variables which represent elements in the DOM. These variables are added to this object when menu.init is called (when the window has loaded, otherwise it fails).

Rather than have to type menu.elements or this.elements every time, I'd rather just store it as a variable, such as el. My current implementation gives the error: Uncaught TypeError: Cannot read property 'elements' of undefined. How can I make this work?

答:
You might just have an inner function variable:

```<code>var menu = {

//The elements we'll be using in the Menu
elements: {},
init: function() {
  var el=this.elements;

    el.$header = $('header');
    el.$myDiv = $('.arrow');

    el.$myDiv.on('click', function(e){
        e.stopPropagation();
        menu.open();
    });

},
</code>```

By the way

```<code>el:this.elements
</code>```

wont work. Object properties cannot access each other on creation.

Body:
var menu = {

    //The elements we'll be using in the Menu
    elements: {},
    el: this.elements, //Doesn't work

    init: function() {

        el.$header = $('header');
        el.$myDiv = $('.arrow');

        el.$myDiv.on('click', function(e){
            e.stopPropagation();
            menu.open();
        });

    },

    open: function() {

        el.$header.addClass('whatever');
        ...

I'm trying to learn some best practices for Javascript, and I'm having trouble with references to elements. I have an object, elements, which will be populated with variables which represent elements in the DOM. These variables are added to this object when menu.init is called (when the window has loaded, otherwise it fails).

Rather than have to type menu.elements or this.elements every time, I'd rather just store it as a variable, such as el. My current implementation gives the error: Uncaught TypeError: Cannot read property 'elements' of undefined. How can I make this work?

Body:
You might just have an inner function variable:

var menu = {

//The elements we'll be using in the Menu
elements: {},
init: function() {
  var el=this.elements;

    el.$header = $('header');
    el.$myDiv = $('.arrow');

    el.$myDiv.on('click', function(e){
        e.stopPropagation();
        menu.open();
    });

},

By the way

el:this.elements

wont work. Object properties cannot access each other on creation.


问:
Update rows par lot SQL Server
I need to change a value of column in a table, so I need to do this :

```<code>update members
set frequence = 1
where frequence <> 1
</code>```

I have 7 million rows impacted, I need to make the update in batches of 100000 rows and then sleep for 2 minutes (time to replications to other datebases).

How can I do this please?

Regrads

答:
```<code>DECLARE @hasRows BIT = 1
WHILE @hasRows = 1
BEGIN
    UPDATE TOP (100000) members
    SET frequence=1
    WHERE frequence<>1
    IF @@ROWCOUNT = 0 SET @hasRows = 0

    WAITFOR DELAY '00:02'
END
</code>```

Title: Update rows par lot SQL Server

Body:
I need to change a value of column in a table, so I need to do this :

update members
set frequence = 1
where frequence <> 1

I have 7 million rows impacted, I need to make the update in batches of 100000 rows and then sleep for 2 minutes (time to replications to other datebases).

How can I do this please?

Regrads


问:
How to set month value based on count
How to get the correct month in javascript. I don't want to use any plugin for this.

var date = new Date();
var month = date.getMonth();
// value is 06 current month;

var month = date.getMonth() + 15;
// now value is 21```
</div>
</div>
</p>

<p>Here, if the getMonth() count more than 12 means how can I get the correct month.
If more than 12 means I need to increase the year also right. </p>

<p>For Example,</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>// assume current month December
var month = date.getMonth()+3;  // value is 14</code>```

I want to show the month as "03" (MARCH). Please help me how can I do this

答:
Seems like everybody's answer is incorrect.

date.getMonth() returns an integer equivalent of the month, zero-based, so new Date().getMonth() returns 5, not 6. Thus, month + 15 = 20, not 21.

from June, we add 15 months:

```<code>1. July
2. August
3. Sept
4. Oct
5. Nov
6. Dec
7. Jan
8 Feb
9 Mar
10 Apr
11 May
12 June
13 July
14 Aug
15 Sept
</code>```

So, it's September, not August!!!

var date = new Date(),
  monthNames = ["January", "February", "March", "April", "May", "June",
    "July", "August", "September", "October", "November", "December"
  ];
var month = date.getMonth(); //current month is 5, 0 based. january = 0, feb = 2, .... dec = 11
//console.log(month);
month = date.getMonth() + 15; //value becomes 20, not 21
//console.log(month);

var newDT = new Date(date.getFullYear(), month, date.getDate());
console.log("today's date is:" + date.getDate());

var newMonth = newDT.getMonth();
console.log("Current month plus 15 months is " + (newMonth + 1));
console.log("Month name is " + monthNames[newMonth]); //don't need to add 1 since our monthNames is zero-based```

Title: How to set month value based on count

Body:
How to get the correct month in javascript. I don't want to use any plugin for this.

var date = new Date();
var month = date.getMonth();
// value is 06 current month;

var month = date.getMonth() + 15;
// now value is 21

Here, if the getMonth() count more than 12 means how can I get the correct month.
If more than 12 means I need to increase the year also right.

For Example,

// assume current month December
var month = date.getMonth()+3;  // value is 14

I want to show the month as "03" (MARCH). Please help me how can I do this

Body:
Seems like everybody's answer is incorrect.

date.getMonth() returns an integer equivalent of the month, zero-based, so new Date().getMonth() returns 5, not 6. Thus, month + 15 = 20, not 21.

from June, we add 15 months:

1. July
2. August
3. Sept
4. Oct
5. Nov
6. Dec
7. Jan
8 Feb
9 Mar
10 Apr
11 May
12 June
13 July
14 Aug
15 Sept

So, it's September, not August!!!

var date = new Date(),
  monthNames = ["January", "February", "March", "April", "May", "June",
    "July", "August", "September", "October", "November", "December"
  ];
var month = date.getMonth(); //current month is 5, 0 based. january = 0, feb = 2, .... dec = 11
//console.log(month);
month = date.getMonth() + 15; //value becomes 20, not 21
//console.log(month);

var newDT = new Date(date.getFullYear(), month, date.getDate());
console.log("today's date is:" + date.getDate());

var newMonth = newDT.getMonth();
console.log("Current month plus 15 months is " + (newMonth + 1));
console.log("Month name is " + monthNames[newMonth]); //don't need to add 1 since our monthNames is zero-based


问:
mongodb input plugin using logstash elasticsearch
I am getting this error while running the conf file

```<code>D:\elastic search\logstash-1.5.3\bin>logstash -f mongo.conf
io/console not supported; tty will not be manipulated
Warning: No private key present, creating unsigned gem.
The error reported is:
  No connection string specified
</code>```

this is my conf file

```<code>input {
  mongodb {
    uri => 'mongodb://root:root@localhost:27017/mydb'
    path => '/opt/logstash-mongodb/logstash_sqlite.db'
    collection => 'bike'
    port => 27017
    unpack_mongo_id => true
    batch_size => 5000
  }
}
</code>```

答: The URI already specified with a port after the host (localhost:27017), there is no need of "port" again. Try using SSL to your URI as mongodb://username:password@host:port/db?ssl=true</p>

Body:
I am getting this error while running the conf file

D:\elastic search\logstash-1.5.3\bin>logstash -f mongo.conf
io/console not supported; tty will not be manipulated
Warning: No private key present, creating unsigned gem.
The error reported is:
  No connection string specified

this is my conf file

input {
  mongodb {
    uri => 'mongodb://root:root@localhost:27017/mydb'
    path => '/opt/logstash-mongodb/logstash_sqlite.db'
    collection => 'bike'
    port => 27017
    unpack_mongo_id => true
    batch_size => 5000
  }
}


问:
Kubernetes 1.5.4 Kube DNS Getting Deleted
When I run the deployment for Kubedns it launches successfully however, at exactly after 8 minutes of uptime, it is deleted. When it is running it works fine in resolving dns requests.  Has anyone else experienced this?  I'm starting to see this with other random deployments.

Kubernetes version
Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.4", GitCommit:"7243c69eb523aa4377bce883e7c0dd76b84709a1", GitTreeState:"clean", BuildDate:"2017-03-07T23:53:09Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.4", GitCommit:"7243c69eb523aa4377bce883e7c0dd76b84709a1", GitTreeState:"clean", BuildDate:"2017-03-07T23:34:32Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}

Environment:
Centos 7

Kernel
Linux at4d-lvk8s01 3.10.0-514.16.1.el7.x86_64 #1 SMP Wed Apr 12 15:04:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Log Messages

After deploying Kubedns:

Apr 20 13:09:33 acme-lvk8s01 kube-controller-manager[912]: I0420 13:09:33.571733     912 event.go:217] Event(api.ObjectReference{Kind:"Deployment", Namespace:"kube-system", Name:"kube-dns", UID:"98ad2b69-25ca-11e7-afbe-90b8d0f6559c", APIVersion:"extensions", ResourceVersion:"262626", FieldPath:""}): type: 'Normal' reason: 'ScalingReplicaSet' Scaled up replica set kube-dns-3777016094 to 1
Apr 20 13:09:33 acme-lvk8s01 kube-controller-manager[912]: I0420 13:09:33.576730     912 replica_set.go:479] Too few "kube-system"/"kube-dns-3777016094" replicas, need 1, creating 1
Apr 20 13:09:33 acme-lvk8s01 kube-controller-manager[912]: I0420 13:09:33.625987     912 deployment_controller.go:298] Error syncing deployment kube-system/kube-dns: Operation cannot be fulfilled on deployments.extensions "kube-dns": the object has been modified; please apply your changes to the latest version and try again
Apr 20 13:09:33 acme-lvk8s01 kube-controller-manager[912]: I0420 13:09:33.656784     912 event.go:217] Event(api.ObjectReference{Kind:"ReplicaSet", Namespace:"kube-system", Name:"kube-dns-3777016094", UID:"98b57f0f-25ca-11e7-afbe-90b8d0f6559c", APIVersion:"extensions", ResourceVersion:"262627", FieldPath:""}): type: 'Normal' reason: 'SuccessfulCreate' Created pod: kube-dns-3777016094-9jt36
Apr 20 13:09:33 acme-lvk8s01 kube-controller-manager[912]: I0420 13:09:33.702938     912 deployment_controller.go:298] Error syncing deployment kube-system/kube-dns: Operation cannot be fulfilled on deployments.extensions "kube-dns": the object has been modified; please apply your changes to the latest version and try again
Apr 20 13:10:03 acme-lvk8s01 kube-controller-manager[912]: W0420 13:10:03.960803     912 reflector.go:319] pkg/controller/garbagecollector/garbagecollector.go:768: watch of  ended with: 401: The event in requested index is outdated and cleared (the requested history has been cleared [261724/260681]) [262723]

Immediately before Kubedns is deleted:

Apr 20 13:17:49 acme-lvk8s01 kube-controller-manager[912]: I0420 13:17:49.528874     912 replica_set.go:512] Too many "kube-system"/"kube-dns-3777016094" replicas, need 0, deleting 1
Apr 20 13:17:49 acme-lvk8s01 kube-controller-manager[912]: I0420 13:17:49.528973     912 controller_utils.go:523] Controller kube-dns-3777016094 deleting pod kube-system/kube-dns-3777016094-9jt36
Apr 20 13:17:49 acme-lvk8s01 kube-controller-manager[912]: I0420 13:17:49.532985     912 event.go:217] Event(api.ObjectReference{Kind:"Deployment", Namespace:"kube-system", Name:"kube-dns", UID:"98ad2b69-25ca-11e7-afbe-90b8d0f6559c", APIVersion:"extensions", ResourceVersion:"263765", FieldPath:""}): type: 'Normal' reason: 'ScalingReplicaSet' Scaled down replica set kube-dns-3777016094 to 0
Apr 20 13:17:49 acme-lvk8s01 kube-controller-manager[912]: I0420 13:17:49.600483     912 deployment_controller.go:298] Error syncing deployment kube-system/kube-dns: Operation cannot be fulfilled on deployments.extensions "kube-dns": the object has been modified; please apply your changes to the latest version and try again
Apr 20 13:17:49 acme-lvk8s01 kube-controller-manager[912]: I0420 13:17:49.623854     912 event.go:217] Event(api.ObjectReference{Kind:"ReplicaSet", Namespace:"kube-system", Name:"kube-dns-3777016094", UID:"98b57f0f-25ca-11e7-afbe-90b8d0f6559c", APIVersion:"extensions", ResourceVersion:"263766", FieldPath:""}): type: 'Normal' reason: 'SuccessfulDelete' Deleted pod: kube-dns-3777016094-9jt36
Apr 20 13:17:52 acme-lvk8s01 kube-controller-manager[912]: I0420 13:17:52.642886     912 garbagecollector.go:761] none of object [v1/Pod, namespace: kube-system, name: kube-dns-3777016094-9jt36, uid: 98d5d128-25ca-11e7-afbe-90b8d0f6559c]'s owners exist any more, will garbage collect it
Apr 20 13:17:52 acme-lvk8s01 kube-controller-manager[912]: I0420 13:17:52.665171     912 deployment_controller.go:322] Deployment has been deleted kube-system/kube-dns
Apr 20 13:18:04 acme-lvk8s01 kube-controller-manager[912]: W0420 13:18:04.972362     912 reflector.go:319] pkg/controller/garbagecollector/garbagecollector.go:768: watch of  ended with: 401: The event in requested index is outdated and cleared (the requested history has been cleared [262818/262725]) [263817]

答:
After I commented out the following line the deployment was stable.

kubernetes.io/cluster-service: "true"


问:
k-means with a centroid constraint
I'm working on a data science project for my intro to Data Science class, and we've decided to tackle a problem relating to desalination plants in california: "Where should we place k plants to minimize the distance to zip codes?"

The data that we have so far is, zip, city, county, pop, lat, long, amount of water.

The issue is, I can't find any resources on how to force the centroid to be constrained to staying on the coast. What we've thought of so far is:
Use a normal kmeans algorithm, but move the centroid to the coast once clusters have settled (bad)
Use a normal kmeans algorithm with weights, making the coastal zips have infinite weight (I've been told this isn't a great solution)

What do you guys think?

答:
K-means does not minimize distances.

It minimizes squared errors, which is quite different.
The difference is roughly that of the median, and the mean in 1 dimensional data. The error can be massive.

Here is a counter example, assuming we have the coordinates:

```<code>-1 0
+1 0
 0 -1
 0 101
</code>```

The center chosen by k-means would be 0,25. The optimal location is 0,0.
The sum of distances by k-means is > 152, the optimum location has distance 104. So here, the centroid is almost 50% worse than the optimum! But the centroid (= multivariate mean) is what k-means uses!

k-means does not minimize the Euclidean distance!

This is one variant how "k-means is sensitive to outliers".

It does not get better if you try to constrain it to place "centers" on the coast only...

Also, you may want to at least use Haversine distance, because in California, 1 degree north != 1 degree east, because it's not at the Equator.

Furthermore, you likely should not make the assumption that every location requires its own pipe, but rather they will be connected like a tree. This greatly reduces the cost.

I strongly suggest to treat this as a generic optimization problem, rather than k-means. K-means is an optimization too, but it may optimize the wrong function for your problem...

Title: k-means with a centroid constraint

Body:
K-means does not minimize distances.

It minimizes squared errors, which is quite different.
The difference is roughly that of the median, and the mean in 1 dimensional data. The error can be massive.

Here is a counter example, assuming we have the coordinates:

-1 0
+1 0
 0 -1
 0 101

The center chosen by k-means would be 0,25. The optimal location is 0,0.
The sum of distances by k-means is > 152, the optimum location has distance 104. So here, the centroid is almost 50% worse than the optimum! But the centroid (= multivariate mean) is what k-means uses!

k-means does not minimize the Euclidean distance!

This is one variant how "k-means is sensitive to outliers".

It does not get better if you try to constrain it to place "centers" on the coast only...

Also, you may want to at least use Haversine distance, because in California, 1 degree north != 1 degree east, because it's not at the Equator.

Furthermore, you likely should not make the assumption that every location requires its own pipe, but rather they will be connected like a tree. This greatly reduces the cost.

I strongly suggest to treat this as a generic optimization problem, rather than k-means. K-means is an optimization too, but it may optimize the wrong function for your problem...


问:
Will my buffer used by all connections?
I have a main which creates an io_service and passes them to an instance of TcpServer.

TcpServer has a member std::array<char, 8192> m_buffer. It has 4 methods: the constructor, startAccept, handleAccept and handleRead.
The constructor only initializes some members and calls startAccept.

startAccept creates a shared pointer of TcpConnection which extends std::enable_shared_from_this<TcpConnection. After that start accept calls m_acceptor.async_accept and binds the accept to the handleAccept method mentioned before.

And this is my handleAccept method. It calls async_read_some with the boost::asio::buffer which uses the member variable declared in TcpServer.

```<code>void TcpServer::handleAccept(std::shared_ptr<TcpConnection> newConnection, const boost::system::error_code &error)
{
    if (!error) {
        //newConnection->start();

        std::cout << "Accepting new connection" << std::endl;
        newConnection->getSocket().async_read_some(
            boost::asio::buffer(m_buffer),
            boost::bind(&TcpServer::handleRead, this, newConnection, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)
        );
    }

    startAccept();
}
</code>```

I am not sure, but if there are multiple connections, all of them will use the same buffer object, right? And they will probably overwrite it, won't they?

答:
Yes, all connections will use same buffer, that is defined in TcpServer. You actually should store buffer in connection, rather than in server.

boost::asio::buffer will use that overload. So, data from read will be stored to your m_buffer. You should store your buffer in connection, or use some synchronization (i.e. some boolean flag, like is_in_read, but that is bad idea).

Title: Will my buffer used by all connections?

Body:
I have a main which creates an io_service and passes them to an instance of TcpServer.

TcpServer has a member std::array<char, 8192> m_buffer. It has 4 methods: the constructor, startAccept, handleAccept and handleRead.
The constructor only initializes some members and calls startAccept.

startAccept creates a shared pointer of TcpConnection which extends std::enable_shared_from_this<TcpConnection. After that start accept calls m_acceptor.async_accept and binds the accept to the handleAccept method mentioned before.

And this is my handleAccept method. It calls async_read_some with the boost::asio::buffer which uses the member variable declared in TcpServer.

void TcpServer::handleAccept(std::shared_ptr<TcpConnection> newConnection, const boost::system::error_code &error)
{
    if (!error) {
        //newConnection->start();

        std::cout << "Accepting new connection" << std::endl;
        newConnection->getSocket().async_read_some(
            boost::asio::buffer(m_buffer),
            boost::bind(&TcpServer::handleRead, this, newConnection, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)
        );
    }

    startAccept();
}

I am not sure, but if there are multiple connections, all of them will use the same buffer object, right? And they will probably overwrite it, won't they?


问:
How to access Interactive Generator block (IG) in Vector CANoe CAPL?
I want to access IG block in CAPL,e.g activate/deactivate message sending, set signal value. but I didn't find this kind of capl function.</p>

答:
You need to declare you're own message in CAPL, then you should use function "output" to send it on CAN. Below example send message with ID 0x100 with 100ms cycle. </p>

```<code>enter code here
variables
{
  msTimer timer200ms;
  msTimer timer100ms;
  message 0x100 msg = {
    DLC = 8,
    byte(0) = 0x00, byte(1) = 0x00, byte(2) = 0x00, byte(3) = 0x00,
    byte(4) = 0x00, byte(5) = 0x00, byte(6) = 0x00, byte(7) = 0x00
 };
  byte myByte[8];
}

on timer timer200ms{
  int i=0, j=0;

  if(i<7){
    if(j<256){
      myByte[i] = j;
      write("frame %d have been change for %d", i, j);
      j++;
      if(j==255){
        i++;
        j=0;
      }
    }
  }
  else{
   cancelTimer(timer200ms);
  }
}

on timer timer100ms{
    msg.byte(0) = myByte[0];
    msg.byte(1) = myByte[1];
    msg.byte(2) = myByte[2];
    msg.byte(3) = myByte[3];
    msg.byte(4) = myByte[4];
    msg.byte(5) = myByte[5];
    msg.byte(6) = myByte[6];
    msg.byte(7) = myByte[7];
    output(msg);
}

on start{
  setTimerCyclic(timer100ms, 100);
  setTimerCyclic(timer200ms, 100);
}
</code>```

Body:
You need to declare you're own message in CAPL, then you should use function "output" to send it on CAN. Below example send message with ID 0x100 with 100ms cycle.

enter code here
variables
{
  msTimer timer200ms;
  msTimer timer100ms;
  message 0x100 msg = {
    DLC = 8,
    byte(0) = 0x00, byte(1) = 0x00, byte(2) = 0x00, byte(3) = 0x00,
    byte(4) = 0x00, byte(5) = 0x00, byte(6) = 0x00, byte(7) = 0x00
 };
  byte myByte[8];
}

on timer timer200ms{
  int i=0, j=0;

  if(i<7){
    if(j<256){
      myByte[i] = j;
      write("frame %d have been change for %d", i, j);
      j++;
      if(j==255){
        i++;
        j=0;
      }
    }
  }
  else{
   cancelTimer(timer200ms);
  }
}

on timer timer100ms{
    msg.byte(0) = myByte[0];
    msg.byte(1) = myByte[1];
    msg.byte(2) = myByte[2];
    msg.byte(3) = myByte[3];
    msg.byte(4) = myByte[4];
    msg.byte(5) = myByte[5];
    msg.byte(6) = myByte[6];
    msg.byte(7) = myByte[7];
    output(msg);
}

on start{
  setTimerCyclic(timer100ms, 100);
  setTimerCyclic(timer200ms, 100);
}


问:
Referer does not send when playing HLS videos in Android
The HLS streaming files are composed by 1 .m3u8 file and N .ts files.

We use the videojs to play the HLS streaming files. The referer header will only be sent for .m3u8 file and will not be sent in reading .ts files in Chrome of Android.

I have the referer check to prevent the hotlinking when users access the .m3u8 and .ts files, but it will be broken in Chrome of Android.

Is there any approach to send the referer header for .ts files in Android Chrome?
Thank you.

答: Not with Android's native HLS playback but if you use videojs-contrib-hls to play HLS the header will be set: https://github.com/videojs/videojs-contrib-hls#overridenative</p>


问:
Visual studio project dependency to other project doesn't copy exe
I have a C# solution (visual studio 2017) with two projects lets say A and B, both compiled to exe. Project A depends on project B's exe, I though a dependency to project B would solve this. However, the exe doesn't get copied automatically when build.

Does the dependencies not work for exe's ? Is the only solution to make an post build step ?

答:
Have a look at the Properties of your dependencies and set "Local Copy" for your exe, this should copy the exe to your A.exe's bin folder.

Edit:
It's the german version, but should look like this:


问:
How to set daterange from FullCalendar?
I'm using FullCalendar and in that I want the functionality to select one date and from that a number of dates should be selected automatically (and I want this with the dates not the events).

I can't use jQuery UI because of some conflict issues. So I have used FullCalendar and want that functionality. Ao can any one give me any suggestions how to do this?

The kind of functionality I want with the FullCalendar is like this [jsfiddle](http://jsfiddle.net/t6y8bucx/).

答:
You can use below fullcalendar js to select and highlights multiple dates</p>

```<code>  var date = new Date();
  var d = date.getDate(),
      m = date.getMonth(),
      y = date.getFullYear();
  $('#calendar').fullCalendar({
    header: {
      left: 'prev,next today',
      center: 'title',
      right: 'month,agendaWeek,agendaDay'
    },
    buttonText: {
      today: 'today',
      month: 'month',
      week: 'week',
      day: 'day'
    },
    events: eventsscript,
    selectable: true,
    selectHelper: true,

select: function (start, end, jsEvent, view) {
      $("#calendar").fullCalendar('addEventSource', [{
          start: start,
          end: end,
          rendering: 'background',
          block: true,
      }, ]);
      $("#calendar").fullCalendar("unselect");
    },
    selectOverlap: function(event) {
        return ! event.block;
    }
</code>```

Title: How to set daterange from FullCalendar?

Body:
You can use below fullcalendar js to select and highlights multiple dates

  var date = new Date();
  var d = date.getDate(),
      m = date.getMonth(),
      y = date.getFullYear();
  $('#calendar').fullCalendar({
    header: {
      left: 'prev,next today',
      center: 'title',
      right: 'month,agendaWeek,agendaDay'
    },
    buttonText: {
      today: 'today',
      month: 'month',
      week: 'week',
      day: 'day'
    },
    events: eventsscript,
    selectable: true,
    selectHelper: true,

select: function (start, end, jsEvent, view) {
      $("#calendar").fullCalendar('addEventSource', [{
          start: start,
          end: end,
          rendering: 'background',
          block: true,
      }, ]);
      $("#calendar").fullCalendar("unselect");
    },
    selectOverlap: function(event) {
        return ! event.block;
    }


问:
Path to Resources folder in plugin on OS X
I'm writing a FileMaker Pro plugin for OS X, and I need to be able to access a file in the /Applications/FileMaker Pro 11/Extensions/blah.fmplugin/Contents/Resources directory.  (But this could be /apps/FileMaker Pro 11 Advanced/Extensions/xyz.fmplugin/Contents/Resources or something else, depending on where the user installed FMP and whether they renamed the plugin etc.)  Since I can't control where the user has installed FMP, or whether they are running FMP or FMPA or whether they have renamed my plugin (although this is less likely than the FMP vs FMPA situation), I do not know the path to the plugin's bundle.

I've found answers like this: Relative Paths Not Working in Xcode C++ but that gives me the path to the Resources folder in the FileMaker.app instead of in my plugin.

i.e. I get /Applications/FileMaker Pro 11/FileMaker Pro.app/Contents/Resources instead of the path to the Resources folder in my plugin.

Is there something I need to configure in Xcode to get the above solution to work?  Or is there some other way to get at the path?  The CFBundleGetMainBundle() call makes it sound like it is meant to return the bundle of the app itself rather than the plugin.

I have found some possibilities based on the Bundle Programming Guide and CFBundleGetBundleWithIdentifier (mentioned by mipadi), but I haven't been able to figure out yet exactly what functions I need and what the prerequisites are.

答: You can use CFBundleCreate if you know the path to your bundle; or you can get the bundle using the bundle identifier via CFBundleGetBundleWithIdentifier.

ContentLicense: CC BY-SA 2.5


问:
matching a word (case insensitive) to a list and replace it to the word in the list - C# Regex
lets say my string is "this is a string"

my list is {"tHis", "WoRd, "a", "iS"}

and my regex patern is {"tHis" | "WoRd" | "a" | "iS"}

The desired result is "tHis iS a string"

the only idea i have is looping over the entire list and test it one by one against a substring

答:
Quick and dirty solution:

```<code>var dict = words.ToDictionary(x => x, StringComparer.CurrentCultureIgnoreCase);

str = Regex.Replace(str, @"\b.+?\b", x =>
{
    string replace;
    dict.TryGetValue(x.Value, out replace);
    return replace ?? x.Value;
});
</code>```

Note that the regex pattern is suboptimal, and will work only if the words are composed only by letters and digits. The dict can be reused (so you should cache it). I'm using the like ... a hash table so you are faster at retrieving the replacement for an input word suggestion by @grek40.

Body:
Quick and dirty solution:

var dict = words.ToDictionary(x => x, StringComparer.CurrentCultureIgnoreCase);

str = Regex.Replace(str, @"\b.+?\b", x =>
{
    string replace;
    dict.TryGetValue(x.Value, out replace);
    return replace ?? x.Value;
});

Note that the regex pattern is suboptimal, and will work only if the words are composed only by letters and digits. The dict can be reused (so you should cache it). I'm using the like ... a hash table so you are faster at retrieving the replacement for an input word suggestion by @grek40.


答: Thank you Psidom and Scott Boston. You're right that the multiindex is there, it just prints as tuples before the data frame is filled. I'll leave this question here because it would have been really handy for me about 24 hours ago. (I'm new here though, so if this counts as a non-question and I should rather delete it, let me know!)</p>

Title: Is it possible to assign a MultiIndex to an empty DataFrame?

Body:
I've created a MultiIndex and want to create an empty data frame with the MultiIndex as the column labels and then fill the matrix later, but it just returns a regular index with tuples. This code

import pandas as pd

sizes = ['0_200', '200_700', '700_1400', '1400_2300', '2300_4000']
years = [2016, 2020, 2025, 2030, 2035, 2040, 2045, 2050]

multidx = pd.MultiIndex.from_product([sizes, years], names=['size', 'year'])
print(multidx)
df = pd.DataFrame(columns=multidx)
print(df)

yields

MultiIndex(levels=[['0_200', '1400_2300', '200_700', '2300_4000', '700_1400'], [2016, 2020, 2025, 2030, 2035, 2040, 2045, 2050]],
           labels=[[0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3], [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7]],
           names=['size', 'year'])

Empty DataFrame
Columns: [(0_200, 2016), (0_200, 2020), (0_200, 2025), (0_200, 2030), (0_200, 2035), (0_200, 2040), (0_200, 2045), (0_200, 2050), (200_700, 2016), (200_700, 2020), (200_700, 2025), (200_700, 2030), (200_700, 2035), (200_700, 2040), (200_700, 2045), (200_700, 2050), (700_1400, 2016), (700_1400, 2020), (700_1400, 2025), (700_1400, 2030), (700_1400, 2035), (700_1400, 2040), (700_1400, 2045), (700_1400, 2050), (1400_2300, 2016), (1400_2300, 2020), (1400_2300, 2025), (1400_2300, 2030), (1400_2300, 2035), (1400_2300, 2040), (1400_2300, 2045), (1400_2300, 2050), (2300_4000, 2016), (2300_4000, 2020), (2300_4000, 2025), (2300_4000, 2030), (2300_4000, 2035), (2300_4000, 2040), (2300_4000, 2045), (2300_4000, 2050)]
Index: []
[0 rows x 40 columns]

I'm using Spyder 3.1.4, Python 3.6.0 64bits on Windows. Pandas version 0.19.2.


问:
MySQL query is not coming back - performance enhancements?
I have a shopware database which has the structure:

```<code>s_articles: all products
id | name | mode

s_order: all orders
id | ordertime | userId | status

s_order_details: all line items for an order
id | orderId | articleId
</code>```

Now I want to achieve the following: I want to now how many users bought a product in the last 90 days which have bought the same product also  earlier than the last 90 days.

I do it like this: I get all articles, then I get count all customers who have bought the article before the last 90 days "boughtBefore90", then I have another sub-select with another sub-select where I collect all the users who have bought the product in the last 90 days  and have bought it earlier than that as well and save it in "boughtLast90".

Then I calcucate the retention rate. This works well with one product, but not with the whole articles database. Is there any way to write this sql with better performance in mind?

My query looks like this:

```<code>select articleId, articleName, boughtBefore90, boughtLast90, boughtLast90/boughtBefore90 as 'retention'
FROM

(select
    s_articles.id as 'articleId',
    s_articles.name as 'articleName',
    (select count(*)
        FROM s_order_details as s_order_details_2
        join s_order as s_order_2 on s_order_2.Id = s_order_details_2.orderId
        where s_order_details_2.articleId = s_articles.id
        and (s_order_2.status = 0 or s_order_2.status = 2)
        and s_order_2.ordertime > '2017-01-01 00:00:00'
        and s_order_2.ordertime <  '2017-03-09 23:59:59'
    ) as 'boughtBefore90',
    (select count(*) from s_order_details as s_order_details_3
        join s_order as s_order_3 on s_order_3.id = s_order_details_3.orderId
        where s_order_3.ordertime > '2017-03-10 00:00:00'
        and s_order_3.ordertime < '2017-06-07 23:59:59'
        and s_order_details_3.articleId = s_articles.id
        and (s_order_3.status = 0 or s_order_3.status = 2)
        AND s_order_3.userId = (
            select DISTINCT(s_order_4.userId) from s_order_details as s_order_details_4
            join s_order as s_order_4 on s_order_4.id = s_order_details_4.orderId
            where s_order_4.ordertime > '2017-01-01 00:00:00'
            and s_order_4.ordertime < '2017-03-09 23:59:59'
            and s_order_details_4.articleId = s_articles.id
            and s_order_3.userId = s_order_4.userId
            and (s_order_4.status = 0 or s_order_4.status = 2))
    ) as 'boughtLast90'
    from
    s_articles
    join s_order_details on s_order_details.articleID = s_articles.id
    join s_order on s_order.id = s_order_details.orderId
    WHERE s_articles.mode = 0
    AND s_order_details.modus = 0
    AND (s_order.status = 2 or s_order.status = 0)
    group by s_articles.id) as resulttable;
</code>```

Thank you!

答:
This seems like a pretty simple query.  Here is the list of customers and articles:

```<code>select o.customerid, od.articleid
from s_orders o join
     s_order_details od
     on od.orderid = o.id
group by o.customerid, od.articleid
having max(o.ordertime) > curdate() - interval 90 days and
       min(o.ordertime) <= curdate() - interval 90 days;
</code>```

If you want a count, use this as a subquery and use either count(*) (for customer/article pairs) or count(distinct customerid) (for the number of customers).

Body:
I have a shopware database which has the structure:

s_articles: all products
id | name | mode

s_order: all orders
id | ordertime | userId | status

s_order_details: all line items for an order
id | orderId | articleId

Now I want to achieve the following: I want to now how many users bought a product in the last 90 days which have bought the same product also  earlier than the last 90 days.

I do it like this: I get all articles, then I get count all customers who have bought the article before the last 90 days "boughtBefore90", then I have another sub-select with another sub-select where I collect all the users who have bought the product in the last 90 days  and have bought it earlier than that as well and save it in "boughtLast90".

Then I calcucate the retention rate. This works well with one product, but not with the whole articles database. Is there any way to write this sql with better performance in mind?

My query looks like this:

select articleId, articleName, boughtBefore90, boughtLast90, boughtLast90/boughtBefore90 as 'retention'
FROM

(select
    s_articles.id as 'articleId',
    s_articles.name as 'articleName',
    (select count(*)
        FROM s_order_details as s_order_details_2
        join s_order as s_order_2 on s_order_2.Id = s_order_details_2.orderId
        where s_order_details_2.articleId = s_articles.id
        and (s_order_2.status = 0 or s_order_2.status = 2)
        and s_order_2.ordertime > '2017-01-01 00:00:00'
        and s_order_2.ordertime <  '2017-03-09 23:59:59'
    ) as 'boughtBefore90',
    (select count(*) from s_order_details as s_order_details_3
        join s_order as s_order_3 on s_order_3.id = s_order_details_3.orderId
        where s_order_3.ordertime > '2017-03-10 00:00:00'
        and s_order_3.ordertime < '2017-06-07 23:59:59'
        and s_order_details_3.articleId = s_articles.id
        and (s_order_3.status = 0 or s_order_3.status = 2)
        AND s_order_3.userId = (
            select DISTINCT(s_order_4.userId) from s_order_details as s_order_details_4
            join s_order as s_order_4 on s_order_4.id = s_order_details_4.orderId
            where s_order_4.ordertime > '2017-01-01 00:00:00'
            and s_order_4.ordertime < '2017-03-09 23:59:59'
            and s_order_details_4.articleId = s_articles.id
            and s_order_3.userId = s_order_4.userId
            and (s_order_4.status = 0 or s_order_4.status = 2))
    ) as 'boughtLast90'
    from
    s_articles
    join s_order_details on s_order_details.articleID = s_articles.id
    join s_order on s_order.id = s_order_details.orderId
    WHERE s_articles.mode = 0
    AND s_order_details.modus = 0
    AND (s_order.status = 2 or s_order.status = 0)
    group by s_articles.id) as resulttable;

Thank you!

Body:
This seems like a pretty simple query.  Here is the list of customers and articles:

select o.customerid, od.articleid
from s_orders o join
     s_order_details od
     on od.orderid = o.id
group by o.customerid, od.articleid
having max(o.ordertime) > curdate() - interval 90 days and
       min(o.ordertime) <= curdate() - interval 90 days;

If you want a count, use this as a subquery and use either count(*) (for customer/article pairs) or count(distinct customerid) (for the number of customers).


问:
How to convert between different color maps on OpenCV?
I have a set of thermal images which are encoded with different types of color maps.

I want to use a constant color map to make fault intelligence easier.
Please guide me on how to go about this.

答: You can use cvtcolor to HSV, and then manually change Hue. After you change hue, you can cvt color back to rbg.</p>


问:
C# selecting data from a SQL database
Having problems selecting data from my database, any clue as to what is wrong as I've been staring at this for for a solid 2 hours.... (have made a login system to which can write and use data but can't search for it)

答:
The problem is with SQL Query you are trying to execute.

Make sure if you are passing correct table name:

```<code>SELECT * FROM TABLE WHERE ...
</code>```

Table is a keyword in SQL Server so it cannot be use like this in query.

Event if you have a table in db with name 'Table' then use following query

```<code>    SELECT * FROM [TABLE] WHERE ...
</code>```

Title: C# selecting data from a SQL database

Body:
The problem is with SQL Query you are trying to execute.

Make sure if you are passing correct table name:

SELECT * FROM TABLE WHERE ...

Table is a keyword in SQL Server so it cannot be use like this in query.

Event if you have a table in db with name 'Table' then use following query

    SELECT * FROM [TABLE] WHERE ...


答:
Table is a keyword on SQL you cant use it as is. If indeed you have named one of your tables as table, which I highly recommended not to, you must use brackets:

```<code>Select * from [Table]
</code>```

Title: C# selecting data from a SQL database

Body: Having problems selecting data from my database, any clue as to what is wrong as I've been staring at this for for a solid 2 hours.... (have made a login system to which can write and use data but can't search for it)

Body:
Table is a keyword on SQL you cant use it as is. If indeed you have named one of your tables as table, which I highly recommended not to, you must use brackets:

Select * from [Table]


问:
How to round money in Twig to save zero in the end?
For example I have 19.796 and I need to round it up  so I use it like this {% set final_sum = sum + (sum / 100 * 21) | number_format(2, 'ceil') %} and it returns me 19.8 but I need 19.80 with zero on the end.

答:
The second parameter of number_format is decimal point

I don't know twig but a look in the docs tell me that you should try this code

```<code>{% set final_sum = ceil(sum + (sum / 100 * 21))|number_format(2) %}
</code>```

Body:
The second parameter of number_format is decimal point

I don't know twig but a look in the docs tell me that you should try this code

{% set final_sum = ceil(sum + (sum / 100 * 21))|number_format(2) %}


问:
Rails - uniqueness of email
In Rails, we can do uniqueness:true. However for email service providers like Google, it's possible to have:

```<code>myemail+123@gmail.com
my.email@gmail.com
myemail@gmail.com
</code>```

And all of them are actually a single email. Is there any way (beside using Regex to check) to do the checking here?

答:
The part before the @ symbol is called local-part and every email-related RFC defines it as an opaque value, which is an identifier for a mailbox. For example, RFC-5322:

The local-part portion is a domain-dependent string.  In addresses,
it is simply interpreted on the particular host as a name of a
particular mailbox.

If you were to implement this custom handling of tags and dots, you'd be going against RFC. This is never a good idea.

Title: Rails - uniqueness of email

Body:
In Rails, we can do uniqueness:true. However for email service providers like Google, it's possible to have:

myemail+123@gmail.com
my.email@gmail.com
myemail@gmail.com

And all of them are actually a single email. Is there any way (beside using Regex to check) to do the checking here?