text:
Q: Klov installation failed Currently, I am using klov tool to generate reports.
First I am installed MongoDB 3.2 then I start the MongoDB server.
Then I am trying to install klov 0.1.0 on command prompt
Using: java -jar klov-0.1.0.jar command
when the jar file executed it gives an exception: "APPLICATION FAILED TO START"
      .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::       (v1.5.10.RELEASE)

2018-05-03 11:37:02.009  INFO 9308 --- [           main] com.aventstack.klov.Application          : Starting Application v0.1.0 on CS69-PC with PID 9308 (E:\klov-0.1.0\klov-0.1.0.jar started by ADMIN in E:\klov-0.1.0)
2018-05-03 11:37:02.017  INFO 9308 --- [           main] com.aventstack.klov.Application          : No active profile set, falling back to default profiles: default
2018-05-03 11:37:02.233  INFO 9308 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1698c449: startup date [Thu May 03 11:37:02 IST 2018]; root of context hierarchy2018-05-03 11:37:13.732  INFO 9308 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/auth/signout],methods=[GET]}" onto public java.lang.String com.aventstack.klov.controllers.UserController.signout(javax.servlet.http.HttpSession)
2018-05-03 11:37:13.736  INFO 9308 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-05-03 11:37:13.740  INFO 9308 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-05-03 11:37:13.808  INFO 9308 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-05-03 11:37:13.812  INFO 9308 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-05-03 11:37:13.844  INFO 9308 --- [           main] .m.m.a.ExceptionHandlerExceptionResolver : Detected @ExceptionHandler methods in repositoryRestExceptionHandler
2018-05-03 11:37:13.950  INFO 9308 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-05-03 11:37:14.440  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerAdapter   : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1698c449: startup date [Thu May 03 11:37:02 IST 2018]; root of context hierarchy
2018-05-03 11:37:14.469  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/{id}/{property}/{propertyId}],methods=[DELETE],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<org.springframework.hateoas.ResourceSupport> org.springframework.data.rest.webmvc.RepositoryPropertyReferenceController.deletePropertyReferenceId(org.springframework.data.rest.webmvc.RootResourceInformation,java.io.Serializable,java.lang.String,java.lang.String) throws java.lang.Exception
2018-05-03 11:37:14.474  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/{id}/{property}],methods=[GET],produces=[application/x-spring-data-compact+json || text/uri-list]}" onto public org.springframework.http.ResponseEntity<org.springframework.hateoas.ResourceSupport> org.springframework.data.rest.webmvc.RepositoryPropertyReferenceController.followPropertyReferenceCompact(org.springframework.data.rest.webmvc.RootResourceInformation,java.io.Serializable,java.lang.String,org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler) throws java.lang.Exception
2018-05-03 11:37:14.476  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/{id}/{property}],methods=[DELETE],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<? extends org.springframework.hateoas.ResourceSupport> org.springframework.data.rest.webmvc.RepositoryPropertyReferenceController.deletePropertyReference(org.springframework.data.rest.webmvc.RootResourceInformation,java.io.Serializable,java.lang.String) throws java.lang.Exception
2018-05-03 11:37:14.478  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/{id}/{property}],methods=[PATCH || PUT || POST],consumes=[application/json || application/x-spring-data-compact+json || text/uri-list],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<? extends org.springframework.hateoas.ResourceSupport> org.springframework.data.rest.webmvc.RepositoryPropertyReferenceController.createPropertyReference(org.springframework.data.rest.webmvc.RootResourceInformation,org.springframework.http.HttpMethod,org.springframework.hateoas.Resources<java.lang.Object>,java.io.Serializable,java.lang.String) throws java.lang.Exception
2018-05-03 11:37:14.483  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/{id}/{property}/{propertyId}],methods=[GET],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<org.springframework.hateoas.ResourceSupport> org.springframework.data.rest.webmvc.RepositoryPropertyReferenceController.followPropertyReference(org.springframework.data.rest.webmvc.RootResourceInformation,java.io.Serializable,java.lang.String,java.lang.String,org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler) throws java.lang.Exception
2018-05-03 11:37:14.486  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/{id}/{property}],methods=[GET],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<org.springframework.hateoas.ResourceSupport> org.springframework.data.rest.webmvc.RepositoryPropertyReferenceController.followPropertyReference(org.springframework.data.rest.webmvc.RootResourceInformation,java.io.Serializable,java.lang.String,org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler) throws java.lang.Exception
2018-05-03 11:37:14.495  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/search],methods=[GET],produces=[application/hal+json || application/json]}" onto public org.springframework.data.rest.webmvc.RepositorySearchesResource org.springframework.data.rest.webmvc.RepositorySearchController.listSearches(org.springframework.data.rest.webmvc.RootResourceInformation)
2018-05-03 11:37:14.497  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/search/{search}],methods=[GET],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.data.rest.webmvc.RepositorySearchController.executeSearch(org.springframework.data.rest.webmvc.RootResourceInformation,org.springframework.util.MultiValueMap<java.lang.String, java.lang.Object>,java.lang.String,org.springframework.data.rest.webmvc.support.DefaultedPageable,org.springframework.data.domain.Sort,org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler,org.springframework.http.HttpHeaders)
2018-05-03 11:37:14.499  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/search/{search}],methods=[OPTIONS],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> org.springframework.data.rest.webmvc.RepositorySearchController.optionsForSearch(org.springframework.data.rest.webmvc.RootResourceInformation,java.lang.String)
2018-05-03 11:37:14.501  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/search/{search}],methods=[HEAD],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> org.springframework.data.rest.webmvc.RepositorySearchController.headForSearch(org.springframework.data.rest.webmvc.RootResourceInformation,java.lang.String)
2018-05-03 11:37:14.515  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/search],methods=[HEAD],produces=[application/hal+json || application/json]}" onto public org.springframework.http.HttpEntity<?> org.springframework.data.rest.webmvc.RepositorySearchController.headForSearches(org.springframework.data.rest.webmvc.RootResourceInformation)
2018-05-03 11:37:14.517  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/search],methods=[OPTIONS],produces=[application/hal+json || application/json]}" onto public org.springframework.http.HttpEntity<?> org.springframework.data.rest.webmvc.RepositorySearchController.optionsForSearches(org.springframework.data.rest.webmvc.RootResourceInformation)
2018-05-03 11:37:14.519  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/search/{search}],methods=[GET],produces=[application/x-spring-data-compact+json]}" onto public org.springframework.hateoas.ResourceSupport org.springframework.data.rest.webmvc.RepositorySearchController.executeSearchCompact(org.springframework.data.rest.webmvc.RootResourceInformation,org.springframework.http.HttpHeaders,org.springframework.util.MultiValueMap<java.lang.String, java.lang.Object>,java.lang.String,java.lang.String,org.springframework.data.rest.webmvc.support.DefaultedPageable,org.springframework.data.domain.Sort,org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler)
2018-05-03 11:37:14.526  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/ || /rest],methods=[GET],produces=[application/hal+json || application/json]}" onto public org.springframework.http.HttpEntity<org.springframework.data.rest.webmvc.RepositoryLinksResource> org.springframework.data.rest.webmvc.RepositoryController.listRepositories()
2018-05-03 11:37:14.529  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/ || /rest],methods=[OPTIONS],produces=[application/hal+json || application/json]}" onto public org.springframework.http.HttpEntity<?> org.springframework.data.rest.webmvc.RepositoryController.optionsForRepositories()
2018-05-03 11:37:14.530  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/ || /rest],methods=[HEAD],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.data.rest.webmvc.RepositoryController.headForRepositories()
2018-05-03 11:37:14.537  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/{id}],methods=[GET],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<org.springframework.hateoas.Resource<?>> org.springframework.data.rest.webmvc.RepositoryEntityController.getItemResource(org.springframework.data.rest.webmvc.RootResourceInformation,java.io.Serializable,org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler,org.springframework.http.HttpHeaders) throws org.springframework.web.HttpRequestMethodNotSupportedException
2018-05-03 11:37:14.541  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/{id}],methods=[PUT],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<? extends org.springframework.hateoas.ResourceSupport> org.springframework.data.rest.webmvc.RepositoryEntityController.putItemResource(org.springframework.data.rest.webmvc.RootResourceInformation,org.springframework.data.rest.webmvc.PersistentEntityResource,java.io.Serializable,org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler,org.springframework.data.rest.webmvc.support.ETag,java.lang.String) throws org.springframework.web.HttpRequestMethodNotSupportedException
2018-05-03 11:37:14.547  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/{id}],methods=[HEAD],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.data.rest.webmvc.RepositoryEntityController.headForItemResource(org.springframework.data.rest.webmvc.RootResourceInformation,java.io.Serializable,org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler) throws org.springframework.web.HttpRequestMethodNotSupportedException
2018-05-03 11:37:14.549  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/{id}],methods=[PATCH],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<org.springframework.hateoas.ResourceSupport> org.springframework.data.rest.webmvc.RepositoryEntityController.patchItemResource(org.springframework.data.rest.webmvc.RootResourceInformation,org.springframework.data.rest.webmvc.PersistentEntityResource,java.io.Serializable,org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler,org.springframework.data.rest.webmvc.support.ETag,java.lang.String) throws org.springframework.web.HttpRequestMethodNotSupportedException,org.springframework.data.rest.webmvc.ResourceNotFoundException
2018-05-03 11:37:14.551  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}],methods=[OPTIONS],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.data.rest.webmvc.RepositoryEntityController.optionsForCollectionResource(org.springframework.data.rest.webmvc.RootResourceInformation)
2018-05-03 11:37:14.553  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}],methods=[HEAD],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.data.rest.webmvc.RepositoryEntityController.headCollectionResource(org.springframework.data.rest.webmvc.RootResourceInformation,org.springframework.data.rest.webmvc.support.DefaultedPageable) throws org.springframework.web.HttpRequestMethodNotSupportedException
2018-05-03 11:37:14.561  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/{id}],methods=[OPTIONS],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.data.rest.webmvc.RepositoryEntityController.optionsForItemResource(org.springframework.data.rest.webmvc.RootResourceInformation)
2018-05-03 11:37:14.564  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}],methods=[POST],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<org.springframework.hateoas.ResourceSupport> org.springframework.data.rest.webmvc.RepositoryEntityController.postCollectionResource(org.springframework.data.rest.webmvc.RootResourceInformation,org.springframework.data.rest.webmvc.PersistentEntityResource,org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler,java.lang.String) throws org.springframework.web.HttpRequestMethodNotSupportedException
2018-05-03 11:37:14.568  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}],methods=[GET],produces=[application/x-spring-data-compact+json || text/uri-list]}" onto public org.springframework.hateoas.Resources<?> org.springframework.data.rest.webmvc.RepositoryEntityController.getCollectionResourceCompact(org.springframework.data.rest.webmvc.RootResourceInformation,org.springframework.data.rest.webmvc.support.DefaultedPageable,org.springframework.data.domain.Sort,org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler) throws org.springframework.data.rest.webmvc.ResourceNotFoundException,org.springframework.web.HttpRequestMethodNotSupportedException
2018-05-03 11:37:14.573  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}],methods=[GET],produces=[application/hal+json || application/json]}" onto public org.springframework.hateoas.Resources<?> org.springframework.data.rest.webmvc.RepositoryEntityController.getCollectionResource(org.springframework.data.rest.webmvc.RootResourceInformation,org.springframework.data.rest.webmvc.support.DefaultedPageable,org.springframework.data.domain.Sort,org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler) throws org.springframework.data.rest.webmvc.ResourceNotFoundException,org.springframework.web.HttpRequestMethodNotSupportedException
2018-05-03 11:37:14.575  INFO 9308 --- [           main] o.s.d.r.w.RepositoryRestHandlerMapping   : Mapped "{[/rest/{repository}/{id}],methods=[DELETE],produces=[application/hal+json || application/json]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.data.rest.webmvc.RepositoryEntityController.deleteItemResource(org.springframework.data.rest.webmvc.RootResourceInformation,java.io.Serializable,org.springframework.data.rest.webmvc.support.ETag) throws org.springframework.data.rest.webmvc.ResourceNotFoundException,org.springframework.web.HttpRequestMethodNotSupportedException
2018-05-03 11:37:14.585  INFO 9308 --- [           main] o.s.d.r.w.BasePathAwareHandlerMapping    : Mapped "{[/rest/profile/{repository}],methods=[GET],produces=[application/alps+json || */*]}" onto org.springframework.http.HttpEntity<org.springframework.data.rest.webmvc.RootResourceInformation> org.springframework.data.rest.webmvc.alps.AlpsController.descriptor(org.springframework.data.rest.webmvc.RootResourceInformation)
2018-05-03 11:37:14.589  INFO 9308 --- [           main] o.s.d.r.w.BasePathAwareHandlerMapping    : Mapped "{[/rest/profile/{repository}],methods=[OPTIONS],produces=[application/alps+json]}" onto org.springframework.http.HttpEntity<?> org.springframework.data.rest.webmvc.alps.AlpsController.alpsOptions()
2018-05-03 11:37:14.593  INFO 9308 --- [           main] o.s.d.r.w.BasePathAwareHandlerMapping    : Mapped "{[/rest/profile/{repository}],methods=[GET],produces=[application/schema+json]}" onto public org.springframework.http.HttpEntity<org.springframework.data.rest.webmvc.json.JsonSchema> org.springframework.data.rest.webmvc.RepositorySchemaController.schema(org.springframework.data.rest.webmvc.RootResourceInformation)
2018-05-03 11:37:14.596  INFO 9308 --- [           main] o.s.d.r.w.BasePathAwareHandlerMapping    : Mapped "{[/rest/profile],methods=[OPTIONS]}" onto public org.springframework.http.HttpEntity<?> org.springframework.data.rest.webmvc.ProfileController.profileOptions()
2018-05-03 11:37:14.598  INFO 9308 --- [           main] o.s.d.r.w.BasePathAwareHandlerMapping    : Mapped "{[/rest/profile],methods=[GET]}" onto org.springframework.http.HttpEntity<org.springframework.hateoas.ResourceSupport> org.springframework.data.rest.webmvc.ProfileController.listAllFormsOfMetadata()
2018-05-03 11:37:14.895  INFO 9308 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2018-05-03 11:37:15.025 ERROR 9308 --- [           main] o.apache.catalina.core.StandardService   : Failed to start connector [Connector[HTTP/1.1-80]]

org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-80]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
        at org.apache.catalina.core.StandardService.addConnector(StandardService.java:225) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
        at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:250) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
        at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:193) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:297) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:145) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) [spring-context-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
        at com.aventstack.klov.Application.main(Application.java:45) [classes!/:0.1.0]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_121]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_121]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_121]
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [klov-0.1.0.jar:0.1.0]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [klov-0.1.0.jar:0.1.0]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [klov-0.1.0.jar:0.1.0]
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [klov-0.1.0.jar:0.1.0]
Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed
        at org.apache.catalina.connector.Connector.startInternal(Connector.java:1021) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
        ... 21 common frames omitted
Caused by: java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_121]
        at sun.nio.ch.Net.bind(Unknown Source) ~[na:1.8.0_121]
        at sun.nio.ch.Net.bind(Unknown Source) ~[na:1.8.0_121]
        at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) ~[na:1.8.0_121]
        at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) ~[na:1.8.0_121]
        at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:210) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
        at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1150) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
        at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:591) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
        at org.apache.catalina.connector.Connector.startInternal(Connector.java:1018) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
        ... 22 common frames omitted

2018-05-03 11:37:15.051  INFO 9308 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2018-05-03 11:37:15.088  INFO 9308 --- [           main] utoConfigurationReportLoggingInitializer :

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2018-05-03 11:37:15.099 ERROR 9308 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

The Tomcat connector configured to listen on port 80 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 80, or configure this application to listen on another port.

2018-05-03 11:37:15.105  INFO 9308 --- [           main] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1698c449: startup date [Thu May 03 11:37:02 IST 2018]; root of context hierarchy
2018-05-03 11:37:15.114  INFO 9308 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2018-05-03 11:37:15.129  INFO 9308 --- [           main] org.mongodb.driver.connection            : Closed connection [connectionId{localValue:2, serverValue:5}] to localhost:27017 because the pool has been closed.

Please give me any suggestions or solution

A: Well the error is that:
"The Tomcat connector configured to listen on port 80 failed to start. The port may already be in use or the connector may be misconfigured."
In the Klov folder locate and open application.properties
# klov
application.name=LibraBank
application.display.proLabels=false
server.port=80

Change the server.port=80 to any other port e.g. server.port=2571


text:
Q: How can i access javaScript variable in current jsp page <script>

    $(document).ready(function(){
      $("#comboBox1").change(function() {
        var text2 = $(this).children(':selected').text();
    var value2 = $(this).val();
      });
    });
</script>

<body>
<form>
<select id="comboBox1">
  <option value="val1">opt1</option>
  <option value="val2">opt2</option>
</select>

//Here i have class called MyUtill that has method findArray with require 1 parameter
// i need to pass combo selected value from the javascript variable value2 so how can i get that variable in my scriptlate
<%
Map<String,String> myMap = MyUtil.findArray(variable);   // variable require javascript value2 variable so how can i get
%>

</form>
</body>

redpajama_set_name: RedPajamaStackExchange


text:
Q: Bootstrap - dropdown menu not working? My dropdown menu in Bootstrap doesnt appear to be working - can anyone alert me to the problem? Right now it displays the dropdown, but clicking it does nothing. Thanks!
JS:
$(document).ready( function() {
$('.dropdown-toggle').dropdown();
});

HTML:

                Title

Profile

Statistics

Reader

                    Options

Action

Another action

Something else here

Separated link

A: putting

file at the last after the
  solved this problem for me .

this is how i use write it now and no problem

A: Double importing jquery can cause Error

OR

A: Check if you're referencing jquery.js BEFORE bootstrap.js and bootstrap.js is loaded only once. That fixed the same error for me:

A: This is a Rails specific answer, but I had this same problem with Bootstrap dropdown menus in my Rails app. What fixed it was adding this to app/assets/javascripts/application.js:
//= require bootstrap
Hope that helps someone.

A: I had to download the source files instead of just the compressed files that it says to use for quick start on the bootstrap website

A: I had a similar problem. The version of bootstrap.js that visual studio seems to be hosed. I just pointed to this URL instead:
    <link id="active_style" rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/3.1.1/cosmo/bootstrap.min.css">

For completeness, here's the HTML and javascript

                        Theme

Amelia

Cerulean

Cyborg

Cosmo

Darkly

Flatly

Lumen

Simplex

Slate

Spacelab

Superhero

United

Yeti

Javascript
$('#theme li').click(function () {
        //alert('item: ' + $(this).text());
        switch_style($(this).text());
    });

Hope it helps someone

A: I've scratched my head for the last few hours and only figured it is due to difference between bs4 and bs5, namely you should replace data-toggle="dropdown"  in bs4 with data-bs-toggle="dropdown" in bs5 and vice versa, hope that helps

A: If I am getting you correctly, when you say that clicking does nothing, do you mean that it does not point to your URL?
In the anchor tag it looks like you did not pass your file path to the href attribute. So, replace the # with your actual path for the file that you want to link.

Action

Another action

Something else here

Separated link

I hope this helps with your issue.

A: you are missing the "btn btn-navbar" section. For example:

Take a look to navbar documentation in:
Twitter Bootstrap

A: If you are using electron or other chromium frame, you have to include jquery within window explicitly by:

A: When i checked i saw display: none; value is in the .dropdown-menu bootstrap css class. Hence i removed it.

A: put following code in your page
  Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);
    function EndRequest(sender, args) {
        if (args.get_error() == undefined) {
        $('.dropdown-toggle').dropdown();
        }
    }


text:
Q: What verb or phrase do you use to describe situation where someone chooses to ignore bad treatment from others such as mocking or insulting? What verb or phrase do you use to describe situation where someone chooses to ignore or not to react to bad treatment from others such as mocking or insulting? Can I use the phrase pay attention? For example:

The bullies called him names, but he decided not to pay attention to that, which made the bullies stop.

If that is not something you would say, could you provide formal and informal phrases or verbs to communicate the message?

A:
What verb or phrase do you use to describe situation where someone chooses to ignore or not to react to bad treatment from others.

I personally use the phrase "put aside something" to describe such situations.
Put aside something:

to ignore or not deal with something:

There are other phrases which can be used:

*

*Close your ears to something.

*Don't mind someone.

Can I use the phrase pay attention?

Yes, you can. It perfectly suits here.


text:
Q: Failed to start Crash recovery kernel arming When trying to login into CentOS 7 either through the Gnome GUI or the login shell, I get this:
After a second, I get booted backed to the login shell, or login screen of Gnome.
I've tried booting using the 'CentOS...recovery...' option during boot up, but same thing happens.
What should I do?
Edit: basically, I'd like to know how to run systmctl (to do what the error suggested) when I can't login into my accounts.


text:
Q: Value of Age didn't appear in my project I have this model:
 [DisplayName("Date of Birth:")]
    [Required(ErrorMessage = "Birth Date is Required.")]
    [DisplayFormat(NullDisplayText = "No Date of Birth is Selected.")]
    public DateTime BirthDate { get; set; }

    [DisplayName("Age:")]
    public int Age
    {
        get
        {
            DateTime now = DateTime.Today;
            int age = now.Year - BirthDate.Year;
            if (BirthDate > now.AddYears(-age)) age--;
            return age;
        }

    }

And in My Partial View:

 @Html.LabelFor(model => model.BirthDate)
 @Html.TextBoxFor(model => model.BirthDate, new { @class = "date" })
 @Html.ValidationMessageFor(model => model.BirthDate)

 @Html.LabelFor(model => model.Age)
 @Html.DisplayTextFor(model => model.Age)
 @Html.ValidationMessageFor(model => model.Age)

And once the Birthday is filled the Age doesn't display the calculated age.
Let me know if I'm missing something?

A: I'm pretty sure you need to supply both a setter and getter for binding to work properly.
Try adding the setter for Age, even if it doesn't do anything.


text:
Q: Practical difference between canonical and grand canonical ensembles I'm currently doing some calculations which require evaluating various standard thermal expectation values in the canonical ensemble (both bosons and fermions). Now, in order to make my theoretical machinations easier, I am actually using the grand canonical ensemble, where the chemical potential acts as a Lagrange multiplier enforcing the constraint $\langle \hat{N} \rangle = N$, where $N/V$ is the fixed density of the physical system. The justification for this is that the relative fluctuations in $\langle \hat{N} \rangle$ should vanish in the thermodynamic limit, in which case I expect fixing the average number to be physically equivalent to fixing the number once and for all. (Also, this approach seems to be adopted by a several presumably trustworthy references, see for example Simons & Altland Section 6.3.) This intuition seems reasonable, but I wonder if matters may be more subtle than this argument implies.

Do thermal averages in the thermodynamic limit of the grand canonical and canonical ensembles coincide?

I'm hoping for either a more rigorous justification supporting this procedure, or examples where it can go horribly wrong. Pointers to appropriate references would also be much appreciated.

A: As you know, the thermodynamic limit requires the system to grow to infinite size while keeping the same density, which lets you neglect surface effects. It also requires the lack of long-range interactions so that distant parts can act independently. So, you need to neglect gravitational interactions, allow the system to be charge neutral, etc.
Even in the thermodynamic limit, the different ensembles can behave differently near phase transitions. For example, if you park the grand canonical ensemble at a liquid-gas boundary, then the system is free to be filled with liquid or gas or a mixture. So, you get a giant and non-negligible fluctuation in the system's energy and particle number. By comparison the phase transition is extended in the canonical ensemble, with a range over which you have a liquid-gas mixture. Another example is the boson condensate: once the condensate has occurred, the total particle number in the grand canonical ensemble has a geometric distribution (!) and so there are giant fluctuations.
There are probably some other issues but I can't think of them off the top of my head. Anyway, just avoid long-range interactions, extreme conditions, and critical phenomena, and your calculations should be fine.


text:
Q: Qt application with QSqlDatabase does not work properly when building it with macdeployqt In my application I am using a QSqlDatabase to store some information. I did built it successfully with the following command (no errors even with verbose=3):
macdeployqt AppName.app/ -dmg -qmldir=~/dev/AppName/qml

Before that I successfully installed mysql55 using port
sudo port install mysql55

If I try to run my application it does not crash, but it also does not anything which involves database access.
This is my code for opening a database etc:
#include <QSqlQuery>
#include <QSqlDriver>

const QString DATABASE_NAME = "com.company.program.db";

MyClass::MyClass(QObject *parent) : QObject(parent) {
    mDB = QSqlDatabase::addDatabase("QSQLITE");

    #ifdef Q_OS_LINUX
    QString path(QDir::home().path());
    path.append(QDir::separator()).append(DATABASE_NAME);
    path = QDir::toNativeSeparators(path);
    mDB.setDatabaseName(path);           // NOTE: We have to store database file into user home folder in Linux
    #else
    mDB.setDatabaseName(DATABASE_NAME);  // NOTE: File exists in the application private folder, in Symbian Qt implementation
    #endif

    bool notOpened = !mDB.open();

    QMessageBox::critical(0, "MyClass", mDB.lastError().databaseText()); // always is 'out of memory'

    if (notOpened) emit failedToOpen();
    else {
        // some initialization
    }
}

MyClass::~MyClass() {
    mDB.close();
}

Has anyone experienced the same issues / a fix for this one?
Note: I am using Mac OS X 10.9 and Qt5.3.2

A: The Database Drivers are loaded at run-time. You won't get any database-config related errors during the compilation process, if the db-driver paths' are not correct.
The paths' can't even be incorrect, as you build on a machine where Qt is installed.
On Windows this occurs often, when the exe can't access files in plugins\sqldrivers.
Is there something like Linux's 'strace' on MAC? If yes, you could trace, in which paths your exe attempts to find driver plugins.
I always copy the entire plugin directory in installer and deploy it in the root-directory of the executable e.g. C:\Program Files (x86)\\plugins
Hope it helps.

A: I managed to fix the out of memory error by executing this code:
#ifdef Q_OS_MAC
    QString databaseName = QApplication::applicationDirPath().append("/").append(DATABASE_NAME);
    mDB.setDatabaseName(databaseName);
#endif


text:
Q: Using MYSQL FULL TEXT to search a term with similar values If i am search a term 'will come', then the result will show all the entries similar with the search term.
For example:

Search Term: will come
Records:
1. It will come.
2. tomorrow rain will come.
3. it should come
4. come on
5. tomorrow bus will come.
Result: 1, 2, 5

I will try with the query SELECT * FROM user WHERE MATCH(name) AGAINST('+will +come' IN BOOLEAN MODE); but i get all the entries(1,2,3,4,5) as result.

A: This is too long to put into a comment.  The "wildcard" operator is only used for suffixes.  This is well described in the documentation:

*

**

  The asterisk serves as the truncation (or wildcard) operator. Unlike
  the other operators, it is appended to the word to be affected. Words
  match if they begin with the word preceding the * operator.

There is not an easy way to do what you want in MySQL, because it does not support synonym lists.  Nor does it provide easy access to the dictionary created by the full text search.


text:
Q: How to find the word with dot using regex in Java? I am a new to Java. I want to search for a string in text file. Suppose the file contains:

Hi, I am learning Java.

I am using this below pattern to search through every exact word.
Pattern p = Pattern.compile("\\b"+search string+"\\b", Pattern.CASE_INSENSITIVE);

It works fine but it doesn't find "java." How to find both patterns. i.e with boundary symbols and with "." at end of the string. Does anyone have any ideas on how I can solve this problem?

A: You should parse your search string in order to change the dot . into a RegEx dot: \\.. Note that a single dot is a metacharacter in Regular Expressions and means any character. For example, you can replace all the dots in your String for \\.
If you don't want to do all that job, then just send java\\. as your search string
More info:

*

*Using Regular Expressions in Java

*Java Regex Tutorial

*Java Regular Expressions
Code example:
public static void main(String[] args) {
    String fileContent = "Hi i am learning java.";
    String searchString = "java";
    Pattern p = Pattern.compile(searchString);
    Matcher m = p.matcher(fileContent );
    while(m.find()) {
        System.out.println(m.start() + " " + m.group());
    }
}

It would print: 17 java
public static void main(String[] args) {
    String fileContent = "Hi i am learning java.";
    String searchString = "java\\.";
    Pattern p = Pattern.compile(searchString);
    Matcher m = p.matcher(fileContent );
    while(m.find()) {
        System.out.println(m.start() + " " + m.group());
    }
}

It would print: 17 java. (note the dot in the end)
EDIT: As a very basic solution, since the only problem you have is with the dot, you can replace all the dots in your string with \\.
public static void main(String[] args) {
    String fileContent = "Hi i am learning java.";
    String searchString = "java.";
    //this will do the trick even if the "searchString" doesn't contain a dot inside
    searchString = searchString.replaceAll("\\.", "\\.");
    Pattern p = Pattern.compile(searchString);
    Matcher m = p.matcher(fileContent );
    while(m.find()) {
        System.out.println(m.start() + " " + m.group());
    }
}

A: "\\b" + searchstring + "(?:\\.|\\b)"

If you want to stipulate that the dot must be followed by a non-word character or the end of the string, you could add a positive look-ahead
"\\b" + searchstring + "(?:\\.(?=\\W|$)|\\b)"

A: Pattern p = Pattern.compile(".*\\W*" + searchWord + "\\W*.*", Pattern.CASE_INSENSITIVE);

To be absolutely sure, the above says "find me a bit of text that starts with 0 or more characters, followed by 0 or more non-word characters specifically (\W* - the word boundary) followed by the search word, followed by the next word boundary followed by anything else".
This will caters for situations where the search word is at the beginning of the file, at the very end, or between punctuation eg: "hi,I am learning,java.".
Hope this helps...


text:
Q: How to get a reference to data inside a mutable singleton without cloning? I store a Params structure into a SERVICES singleton. With the get_params() function, I get the Params structure back, but we must clone the structure's items in order to use it.
use lazy_static::lazy_static; // 1.4.0
use std::collections::HashMap;
use std::sync::Mutex;

#[derive(Debug)]
pub struct Params {
    pub verbose: bool,
    pub config_file: String,
}

lazy_static! {
    #[derive(Debug)]
    static ref SERVICES : Mutex<HashMap<&'static str, Params>> = Mutex::new( {
         HashMap::new()
    });
}

// OK
pub fn get_params() -> Params {
    let serv_map = &SERVICES.lock().unwrap();

    let cf: String = serv_map.get("params").unwrap().config_file.clone(); // clone here :(
    let verbose = serv_map.get("params").unwrap().verbose;

    Params {
        verbose,
        config_file: cf,
    }
}

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let params = Params {
        verbose: true,
        config_file: "/user/toto.yml".to_string(),
    };

    {
        SERVICES.lock().unwrap().insert("params", params);
    }

    let pp = get_params();

    if pp.verbose {
        dbg!(&pp.config_file, pp.verbose);
    }
    Ok(())
}

playground
I would like to be able to read the Params data from the singleton, without cloning, using a routine like:
/*
 Cannot compile
*/
pub fn get_params_ref<'lt>() -> &'lt Params {
    let serv_map: &'lt HashMap<&'static str, Params> = &SERVICES.lock().unwrap();

    let pp = &serv_map.get("params").unwrap();

    pp
}

I get:
error[E0716]: temporary value dropped while borrowed
  --> src/main.rs:22:57
   |
21 | pub fn get_params_ref<'lt>() -> &'lt Params {
   |                       --- lifetime `'lt` defined here
22 |     let serv_map: &'lt HashMap<&'static str, Params> = &SERVICES.lock().unwrap();
   |                   ----------------------------------    ^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
   |                   |
   |                   type annotation requires that borrow lasts for `'lt`
...
27 | }
   | - temporary value is freed at the end of this statement

I understand why Rust cannot compile this, but is there a solution to get an immutable reference to the Params structure?

A: As written, you cannot return references to elements of SERVICES because the compiler doesn't know how long those will live: another part of your code could remove a service!
Assuming you only ever add elements to SERVICES but never remove any element then because they are global it's OK to leak them:
Change the definition of Params to
#[derive(Debug)]
pub struct Params {
    pub verbose: bool,
    pub config_file: &'static str,
}

And initialize your parameters' config_file using Box::leak(String::from("foo").into_boxed_str()).
Leaked memory will be reclaimed by your OS when your program shuts down.
See also:

*

*How to convert a String into a &'static str


text:
Q: passing a different $model into renderPartial I'm using Yii 1.1.15 and am calling a view from 1 modules to another, and want to pass in the calculator model as $model so i can access the attributeLabels()
in my 1st modules view i have this code
<?php $this->renderPartial('application.modules.calculators.views.calculators._no_header-calculator', array('model'=>CalculatorsForm::model(), 'form'=>$form), false); ?>

and in _no_header-calculator i have this
<?php echo $form->labelEx($model,'yearloan'); ?>

problem is i'm getting this error, any idea why?
include(CalculatorsForm.php): failed to open stream: No such file or directory

A: try including the model 1st then use new CalculatorsForm
<?php

Yii::import('application.modules.calculators.models.CalculatorsForm');

$this->renderPartial('application.modules.calculators.views.calculators._no_header-calculator', array('model'=>new CalculatorsForm, 'form'=>$form), false);

?>


text:
Q: Movendo e removendo elementos HTML com jQuery Estou tendo problemas com relação ao código abaixo. No caso eu tenho dois menus, o menu menuAprendido e o menu menuAprender e eu tenho que adicionar objetos no menuAprender e movê-los para o menuAprendido, até aí tudo bem. O problema é que ao clicar no botão mover, eu consigo adicionar o item ao menuAprendido mas não sei como removê-lo do menuAprender e ,consequentemente, não sei como, ao apertar o botão remover, remover algum item especifico do menuAprender.
Sei que existe um comando $('algumacoisa').remove();, mas não consegui usá-lo para excluir um objeto especifico do menu.

/**
 * Created by Erick on 24/10/2014.
 */

$(document).ready(function() {
    var array = new Array();

    $("#okbtn").click(function() {
        var item = $(".inputTema").val();
        if(item == "") return;

        item = "
" + item + "
";

        array.push(item);

        $("#menuAprender").append(item);
        confirm('Assunto adicionado com sucesso');

    });

    $("#moverbtn").click(function() {
        var assunto = prompt('digite o assunto que deseja mover para a lista de assuntos que já aprendeu!');
        if(assunto == "") return;

        assunto = "
" + assunto + "
";

        for(var i = 0; i < array.length; i++) {
            var j = ("#" + i).val();
            if(assunto === array[i]) {
                $("#menuAprendido").append(assunto);
                confirm('Assunto movido com sucesso');
            }
        }

    });

    $("#removerbtn").click(function() {
        var assunto = prompt('digite o assunto que deseja remover da lista de assuntos que deseja aprender!');
        if(item == "") return;

        assunto = "
" + assunto + "
";

        for(var i = 0; i < array.length; i++) {
            if(assunto === array[i]) {
                confirm('Assunto removido com sucesso');
            }
        }

    });

});

<!DOCTYPE html>

        <meta charset="UTF-8">
        <title>SI1</title>
        <link rel="stylesheet" href="css/bootstrap.css">

Sistemas de Informação 1

Obrigado por ter se cadastrado na disciplina.

Caso deseje você pode nos mostrar o que deseja aprender ou já aprendeu.

Assuntos que eu gostaria de aprender.

<input type="text" class="inputTema"><button type="submit" id="okbtn">OK</button>

                        <button type="submit" id="moverbtn">mover</button>
                        <button type="submit" id="removerbtn">remover</button>

Assuntos que já aprendi.

                            <button type="submit">Voltar para a página inicial</button>

A: Eu sugiro uma abordagem diferente: em vez de criar um novo div para inserir no #menuAprendido, encontre o item já existente no outro menu e mova de um lugar para outro. Assim não seria necessário nenhum remove().
O código é algo assim:
$("#moverbtn").click(function() {
    var assunto = prompt('digite o assunto que deseja mover para a lista de assuntos que já aprendeu!');
    if(assunto == "") return;

    var item = $('#menuAprender .list-group-item:contains("' + assunto + '")');
    $("#menuAprendido").append(item);
    alert('Assunto movido com sucesso');
});

No comando de remoção, a lógica é a mesma: selecione o item a ser removido, em vez de criar uma nova div:
$("#removerbtn").click(function() {
    var assunto = prompt('digite o assunto que deseja remover da lista de assuntos que deseja aprender!');
    if(assunto == "") return;

    var item = $('#menuAprender .list-group-item:contains("' + assunto + '")');
    item.remove();
    alert('Assunto removido com sucesso');
});

Como apontado em comentário abaixo, o código acima ainda tem um problema: se o conteúdo de dois ou mais itens corresponder parcialmente ao que foi digitado, mais elementos serão movidos. Dá para solucionar pegando todos os elementos e filtrando o conjunto pelo texto exato. Para isso é preciso trocar nas duas funções acima a linha que define o item por:
var item = $('#menuAprender .list-group-item').filter(function(i, el) {
    return $(el).text() === assunto;
});

Referências

*

*seletor :contains()

*método filter


text:
Q: Android Data binding : Cannot resolve symbol I have tried to use the beta features(data binding) in the android studio. After following the guides from the android studio, I can find the related class DataBindingInfo in the android studio. But the databinding class does not generate after I create the project. Can someone help?
build.gradle for the app module
apply plugin: 'com.android.application'

apply plugin: 'com.android.databinding'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.example.pigfamily.myapplication"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
}

build.gradle for the project
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        dependencies {
            classpath "com.android.tools.build:gradle:1.3.0"
            classpath "com.android.databinding:dataBinder:1.0-rc1"
        }
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">

    <data>

        <variable
            name="user"
            type="com.example.pigfamily.myapplication.User" />
    </data>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
 >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{user.name}" />

    </LinearLayout>
</layout>

MainActivity.java
package com.example.pigfamily.myapplication;

import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ActivityMainBinding //cannot resolve the symbol here
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

A: to implement binding, make sure that:

*

*in the app.gradle, enable dataBinding:
 apply plugin: 'com.android.application'
 ...

 android {
     ...
     buildFeatures {
         dataBinding true
     }
     ...
 }

 dependencies {
     ...
 }

*wrap the existing XML layout in a <layout> element:
 <layout
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools">

     <!-- note: xmlns above only needed if used in original XML -->
     <!-- original XML here -->

 </layout>

*in Activity/Fragment, use the Binding
 // inflating xml_layout_name.xml...
 val binding = XmlLayoutNameBinding.inflate(LayoutInflater.from(context))

*if is unable to resolve the XxxBinding class (even though it can resolve XxxBindingImpl)

*

*first try changing a character in ANY XML layout with the  tag

*if that doesn't work, restart Android Studio, sync & rebuild project

A: enable dataBinding in your App Level build.gradle file
android {
    ...
    dataBinding{
        enabled=true
    }
}

A: I had this same problem.  I was digging through gradle settings, cleaning, rebuilding... nothing worked.  Finally all I had to do was restart Android Studio
https://www.bignerdranch.com/blog/descent-into-databinding/

As of this writing, this integration needs a little jump-start to get
  going. To make ListItemCrimeBinding available after adding the
   tag, you must restart Android Studio, then rebuild the
  project.

A:
Add on build.gradle(:app) viewBinding true

android {
  buildFeatures {
        viewBinding true
    }

}

A: Either click sync if a dialogue pops up, hit the sync button next to save, or restart Android Studio.

A: If clear Project and Rebuild Project don't work for you try the simple solution. It sometimes doesn't work when you clone a project from remote git branches.You need to just close your project and delete the .gradle and .idea folder of your android project. Then reopen the project.

A: For me I had to add:
buildFeatures {
    viewBinding true
}

to my build.gradle file, then run File->Sync Project With Gradle Files

A: In my case, my layout file had some errors and therefore AS was not creating the binding class. I could find it by expecting the XML file and seeing the error messages.

A: be sure you add data binding in your build.gradle
and after that sync project after that Restart and clear caches from the file in android studio. this way solve my problem

A: For my case I added :
         dataBinding {
                  enabled=true
         }

Then went to File > Settings >
  Gradle > Untick offline work> Apply>
  Ok
  Then cleaned my project.

A: I've seen this answer nowhere so I suggest:
if you added some activity from context menu by clicking on some package like 'data' or 'ui', Android Studio saved path to binding like so:
import com.damian.yourappname.ui.databinding.ActivitySearchBinding;
I tested it a few times with my previous projects and it occurs only when sample activity like ScrollingActivity is added to a package other package for all classes.
import com.damian.yourappname.databinding.ActivitySearchBinding;
So best way is just creating sample activity in root folder and after gradle sync moving  to some package

A: I found a way without restart or invalidate cache. I thing this because binding need to restart or something, so I re-write private ActivityMainBinding binding; and viewBinding work again.
I don't know why this work but this save my time than restart/invalidate cache

A: In my case i deleted build, build-cache folders in project scope, then build folder in app module. Afterwards restarted PC and it started working

A: 1.Add Below in app gradle
 dataBinding {
        enabled = true
    }

2.In xml layout write below code
<layout
    xmlns:android="http://schemas.android.com/apk/res/android">
  <data></data>
</layout>

UPDATED:
CLEAN AND REBUILD THE PROJECT


text:
Q: Using FileReader & DOMParser in AngularJS I have a user uploaded file using AngularJS and like to manipulate the file contents using XML. However, I have a difficulty in the DOMParser recognising the text file.
index.html
  <div ng-controller = "myCtrl">
      <input type="file" file-model="myFile"/>
      <button ng-click="uploadFile()">upload me</button>
  </div>

app.js
 myApp.controller('myCtrl', ['$scope', 'fileUpload', function($scope, fileUpload){

     $scope.uploadFile = function(){
     var file = $scope.myFile;

     reader = new FileReader();
     reader.onload = function() {
     showout.value = this.result;
     txtFile = showout.value;

     console.log(txtFile);
     };

    reader.readAsText(file);
    parser=new DOMParser();

    xmldoc = parser.parseFromString(txtFile,"text/xml");
    console.log(xmlDoc);

In this example, the txtFile is correctly printed to the console, within the Reader.onLoad. However, xmlDoc shows as undefined.
I should I be referencing the file and converting it so that it can be read by DOMParser?
NOTE: if I replace txtFile in ... xmldoc = parser.parseFromString("bob","text/xml"), the code works.
Thanks in advance.

A: I know this is old but I want drop a working example here in case people still come across this
var parser = new DOMParser();
var reader = new FileReader();
reader.readAsText(file, "UTF-8");
reader.onload = function (evt) {
    var data = parser.parseFromString(evt.target.result, "application/xml");
    console.log(data);
};


text:
Q: How do I make the carousel indicators in angular ui use thumbnails from a model in a controller? I'm using the angular ui bootstrap carousel and I want to make the indicators thumbnails. I have a controller that looks like this (from the demo):
function carouselCtrl($scope) {
  $scope.myInterval = 5000;
  $scope.imgPath="img/slideshow/"
  var slides = $scope.slides = [{
    'imgName':'iguanas.jpg',
    'caption':'Marine iguanas in the Galapagos National Park on Santa Cruz Island, on September 15, 2008.',
    'author':'(Reuters/Guillermo Granja)'
  },{
    'imgName':'eruption.jpg',
    'caption':'In June of 2009, the Cerro Azul volcano on Isabela Island was in an active phase, spewing molten lava into the air, spilling it across its flanks, and widening existing lava flows.',
    'author':'(Reuters/Parque Nacional Galapagos)'
  },{
    'imgName':'bluefoot.jpg',
    'caption':'A close-up of a pair of Booby feet, photographed in March of 2008. ',
    'author':'(CC BY Michael McCullough)'
  }];

}

and the template looks like this:

 1">

     1">‹
     1">›

I want to do something like this:

but I must be out of scope or something... Does anyone know any angular carousels that have a thumbnail option or how I can get this to work?

A: The slide array in the carousel template actually don't refer to the slides array you have defined in your app controller.
In the carousel template slides refer to a bunch of dom elements enhanced with internal properties. That's why any access to properties you have defined in our objects will failed when executed (scope issue as you guessed already).
If you want to stick to the carousel from angular-ui I would recommend a slightly different approach and go for css styling something like that:
  //Default styles for indicator elements
  .carousel-indicators li {
    background-size : 42px 22px;
    width : 42px;
    height: 22px;
    background-repeat : no-repeat;
    background-position : center;
    cursor : pointer;
  }

  // Then Specify a background image for every slide
  .carousel-indicators li:nth-child(1){
    background-image: url(http://cache.wallpaperdownloader.com/bing/img/WeddedRocks_20100418.jpg);
  }

  ...

You can see a working Plunker here.

A: It's very possible and it's very simple. First you must pass the model of every slide in the actual directive as indicated in the docs for the uib-slide settings. And then you must override the template using the template-url directive. Don't forget to declare the template.
So the html should look like this:

<uib-carousel active="active" interval="interval" template-url="carousel-with-thumbs.html">
<uib-slide ng-repeat="slide in slides track by $index" index="$index" actual="slide">

{{slide.title}}

{{slide.text}}

</uib-slide>
</uib-carousel>

Take a moment to analyse the carousel-indicators ordered list:

 1">

        slide {{ $index + 1 }} of {{ slides.length }}, currently active

Look how each slide model has another slide sub-model which is the transcluded scope of the slide model passed
through the actual directive. And then, nested again, the actual model containing all the data of each slide:

And of course for the big finale, the controller should look like this:
(function(){
    'use strict';
    angular
        .module('app', ['ui.bootstrap'])
        .controller('carousel', carousel);

        carousel.$inject = ['$scope'];

        function carousel($scope){
            $scope.active = 0;
            $scope.interval = 5000;
            $scope.slides = [
                {title: "Any title", text: "This is a text for the slide", image: "path/to/the/image/image.jpg", thumb:  "path/to/the/image/thumbs/thumb.jpg"},
                {title: "Any title", text: "This is a text for the slide", image: "path/to/the/image/image.jpg", thumb: "path/to/the/image/thumbs/thumb.jpg"},
                {title: "Any title", text: "This is a text for the slide", image: "path/to/the/image/image.jpg", thumb: "path/to/the/image/thumbs/thumb.jpg"}
            ];
    }
})();

By the way, I'm using Angular UI Boostrap 1.3.3 along with Angular 1.5.8.
Here's the Fiddle for it https://jsfiddle.net/logus/6mvjpf40/


text:
Q: mod_rewrite Friendly URL clashing with 404 I've been struggling with my mod_rewrite for a while now and I thought I'd cracked it…
My CMS generates blog post URLs with post.php?s= and I've been trying to remove this part of the URL so that they're nice and user friendly. Here's my mod_rewrite:
<ifModule mod_rewrite.c>

DirectoryIndex index.php index.html

ErrorDocument 404 http://tempertemper.net/error.php

RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^ - [L]

RewriteCond %{HTTP_HOST} ^www.tempertemper\.net$
RewriteCond %{REQUEST_URI} !cron.php
RewriteRule ^(.*)$ http://tempertemper.net/$1 [R=301,L]

RewriteCond %{QUERY_STRING} ^s=(.+)$
RewriteRule post.php /%1? [R=301,L]

RewriteRule ^resources /archive? [R=301,L]

RewriteCond %{REQUEST_URI} !post.php
RewriteRule ^([a-zA-Z0-9_-]+)$ post.php?s=$1

</ifModule>

Unfortunately, It seems to be directing all pages that aren't found to the blank post.php page instead of the error.php page.
My site is here: http://tempertemper.net and here's a URL that doesn't exist http://tempertemper.net/this-url-does-not-exist
It should take you to http://tempertemper.net/error
Thanks for taking a look :)

A: Because you are redirecting all paths which fit the [a-zA-Z0-9_-]+ pattern, this will simply send to your post.php script the query string s=this-url-does-not-exist. So it's up to your PHP script post.php to check whether this-is-not-a-url exists or not, as Apache cannot possibly know what blog post ID values are valid and which are not.
As a side note, I'd recommend using /blog/2012-08-24-whatever as the path you give to visitors, rather than /2012-08-24-whatever. That way you can reserve paths for other functions, such as /images without having to write a new exception in your .htaccess file every time you need to create a new utility path.


text:
Q: Is there a keyboard shortcut for hibernate now a Mac, without changing power settings? Question Details:
Is it possible to make your macbookpro retina (2015) to hibernate (hibernate mode 25 i.e. fully powered off) via a shortcut? I still want it to go to sleep (the usual default safesleep) when closing the lid. Put differently: I would like to achieve the same settings that I had on Windows.
Windows setting:
On my Windows (7) laptop, besides shutdown and restart, I have the option of 2 settings: sleep or hibernate. Either pressing the sleep button on my keyboard or hibernating via the start menu (by pressing the start menu, clicking the right direction button and then clicking the "Hibernate" button). Neither method requires me to close the laptop lid.
Apple Mac OS Assumption:
I am under the impression that Mac OS has the ability to hibernate just like a Windows PC - i.e. totally powered off. In order to trigger this, I must first enable this feature [sudo pmset -a hibernatemode 25] and then trigger it by closing the lid. Please correct me if I'm mistaken about this. If I'm not mistaken, please see below:
Situation:
I've just started using a Macbookpro (V10.10). I like how it goes to sleep when closing the lid. However, I would like the option to hibernate via a button/keybaord shortcut. I understand I can change the hibernate mode to hibernate 25 via pmset. However, this makes the macbook go to hibernate whenever I close the lid - I don't want it to hibernate when closing the lid, rather just hibernate via a button/shortcut.

A: This shortcut isn't defined.
You could write a small shell script:
cat >hibernate <<eof
/usr/bin/sudo pmset hibernatemode 25
pmset sleepnow
/usr/bin/sudo pmset hibernatemode 3
eof

make it executable:
chmod u+x hibernate

and test it:
./hibernate

This small shell script will ask you your password and won't echo it
to get admin priviledge, and then make hibernate immediatly your Mac.
Upon wakeup, you will be able to verify that an image on disk was
cleanly made with:
ls -l /var/vm/sleepimage

and you will be able to check that the hibernatemode was reset to 3,
thus letting the action of closing the lid making a normal sleep.
If you are satisfied with this shell script, the next step will
require to define a shortcut to fire a shell script (and this is
another question).
I put a cleaner version of this shell script on GitHub:
hibernate shell script
Most notably, it will save the previous value of hibernatemode and restore it on wakeup.


text:
Q: How to change path names for media from localhost to some other local URL in Magento? I deployed Magento application on my local. When I am trying to access it using some other system in my local network, application gets opened but am not getting images and css. It is getting resolved to localhost/magento/imagename.jpg. My application is deployed in 127.0.0.1/magento/. Do I need to change my PHP.ini or some setting in Magento Admin?

A: Change the base url to your internal IP address, the ip address your router assigns to you.
In Windows:
Start -> Type in cmd and press enter -> ipconfig
In Linux:
ifconfig
Find your local IP which might look like 192.168.1.xx or 10.0.0.xx
Enter that as your Base URL (with http:// in front and / at the end) in the magento backend under System -> Configuration -> Web
OPTIONALLY
You can enter {{base_url}} as your Base URL in magento backend, this will allow any URL to work, this is however not recommended for live.
EDIT
Don't forget to clear your cache by deleting everything in var/cache/


text:
Q: Efficient Storage and Querying of RDF triples For my project I have a relational DB. Frequently my relational DB schema is changing. So recently I stored all the relational database tables data into one big RDF table. Table stored data as a triple.  It has three columns Subject, Predicate, Object.  Following is an example of the RDF Table:
Subject->Predicate->Object

1->name->Center

1->description->sample description

1->data->measure

2->data->parameter

2->relation->1

I stored the table in Oracle and currently using SQL to query the DB. However, my table is growing very fast and it has lots of records and SQL query processing taking time. I believe in the near future table will grow more and query processing will be inefficient. So, my concern is about efficiency.
Could you please inform me how can I store RDF triples efficiently so that it will take less time to query the DB even though the table is very large.
I don't know much about RDF database and query language. Is it possible to make Oracle RDF table efficient? I saw that people are talking about Apache Jena tool and SPARQL language. Will it solve my problem? If I use Jena then do I need to store my RDF triple in XML format or my current format is fine? How I can use Jena tool? Also will it be helpful to use graph database instead of Oracle DB? If so then which one to choose?

A: http://jena.apache.org/
Jena has two storage layers that apply here : SDB, which uses SQL databases and TDB, a native store.  TDB is faster.  SDB uses it's own schema to store RDF.
You can also Oracle's won RDf storage (which has a jena interface).
You do not store XML for the RDf in any of these approaches - it is parsed and efficient storage used.


text:
Q: Visual Studio Enterprise 2015 installed - is SQL Server included? I have Visual Studio Enterprise 2015 installed (on Windows 10) and need access to SQL Server. I thought the server was included in the installation of VS, but begin to suspect that I was wrong.
I can see programs under Control panel, like SQL Server 2012 Native Client, SQL Server Express 2014 Localdb, some different management tools, etc.
I concluded that the SQL server and management tools were integrated, but can not run the server via my VS:

Can not connect to ... A network-related or instance-specific error ocurred while Establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configurated to allow remote connections. (provider: Named Pipes Provider, Error: 40 – could not open a connection to SQL-Server) (Microsoft SQL Server, Error 2 ... Unable to find the file.

I realized that I need to configure the firewall in some way, perhaps even make further adjustments/configurations. But I also think that I still have to install? How do I make these configurations?
Do I need both the SQL Server and Management? Or is it enough with the VS for management? If installation is needed, does it matter which version I choose? (I have access to DreamSpark: Web Edition, Express, ordinary etc. - 2014 and 2016). As you can tell I am a total beginner and need some help to point me in the right direction…


text:
Q: Problem importing some modules in angular I've downloaded a panel to inject into my Angular 9 project
In the panel @core and @theme are injected which already come in downloaded folders, I access their '.module' and inject them in imports: []
I have omitted the unnecessary imports for you
import { CoreModule } from './modules/admin-panel/@core/core.module';
import { ThemeModule } from './modules/admin-panel/@theme/theme.module';

@NgModule({
  declarations: [
    AppComponent,
    LoginComponent,
    CrearCuentaComponent,
    PopoverComponent,
    AlertComponent,
    PanelDeGestionComponent
  ],
  imports: [
    FormsModule,
    NgbModule,
    BrowserModule,
    AppRoutingModule,
    //Importacion traducción
    HttpClientModule,
    TranslateModule.forRoot({
        loader: {
            provide: TranslateLoader,
            useFactory: HttpLoaderFactory,
            deps: [HttpClient]
        }
    }),
    AdminPanelModule,
    //Panel robado
    BrowserAnimationsModule,
    BrowserModule,
    ThemeModule.forRoot(),      //Here is the error
    NbSidebarModule.forRoot(),
    NbMenuModule.forRoot(),
    NbDatepickerModule.forRoot(),
    NbDialogModule.forRoot(),
    NbWindowModule.forRoot(),
    NbToastrModule.forRoot(),
    NbChatModule.forRoot({
      messageGoogleMapKey: 'AIzaSyA_wNuCzia92MAmdLRzmqitRGvCF7wCZPY',
    }),
    CoreModule.forRoot(),      //Here is the error
  ],
  bootstrap: [AppComponent],
  providers:[VarLogins]
})
export class AppModule { }

The console error:

The routes are fine, but still do not work, what can happen? I'm sorry if I'm not more concrete but I'm very lost and not what to do


text:
Q: How can I configure npm update to update mtime of files? npm install and npm update install files in node_modules. The modified timestamps of these files are not what you expect: the time that these files were last installed or updated in the local filesystem. Instead, npm deliberately (I think) ensures that the installed files' mtime value remains the same as in the source archive.
That means, it is possible to find really old files in node_modules:
$ stat node_modules/plotly.js-dist/plotly.js | grep Modify
Modify: 1985-10-26 09:15:00.000000000 +0100

The main issue with this is that I am using these files in a build process, which only triggers if the source file's mtime is more recent than the target file's mtime.
How can I configure npm to update the mtime of a file when it is installed or updated?

A: Well, this one is interesting...
Maybe I won't solve your problem technically, but help you get different perspective on it.
PROBLEM: npm install doesn't trigger file watcher.
Solution 1:
rm- rf node_modules (delete all npm scripts)
run npm install
Solution 2:
after npm install update you app entry point manually (src/app.js) or something similar like it.
Solution 3:
Configure your file watcher to watch changes on package.js (or package.lock.js). These files always change if you add or remove new modules.


text:
Q: Access SQL Randomizer Not working as intended I'm using the below mentioned code to select a record ID from an Access Database that wasn't already selected in the last day and add it to an array.
The general goal is that a record that matches the initial "Difficulty" criteria will be retrieved so long as either the record was never selected before OR the record wasn't chosen in the last 2 days. After the loop is done, I should have x amount of unique record ID's and add those onto an array for processing elsewhere.
 Private Function RetrieveQuestionID(questionCount As Integer)

    ' We're using this retrieve the question id's from the database that fit our arrangements.
    Dim intQuestArray(0 To questionCount) As Integer
    Dim QuestionConnection As New OleDb.OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;Data Source = |DataDirectory|\Database\MillionaireDB.accdb;")

    QuestionConnection.Open()

    For i As Integer = 1 To intNoOfQuestions
        'TODO: If there are no valid questions, pull up any of them that meets the difficulty requirement....

        Dim QuestionConnectionQuery As New OleDb.OleDbCommand("SELECT Questions.QuestionID FROM Questions WHERE (((Questions.QuestionDifficulty)=[?])) AND (((Questions.LastDateRevealed) Is Null)) OR (Questions.LastDateRevealed >= DateAdd('d',-2,Date())) ORDER BY Rnd((Questions.QuestionID) * Time());", QuestionConnection)
        QuestionConnectionQuery.Parameters.AddWithValue("?", intQuestionDifficulty(i - 1).ToString)
        Dim QuestionDataAdapter As New OleDb.OleDbDataAdapter(QuestionConnectionQuery)
        Dim QuestionDataSet As New DataSet

        QuestionDataAdapter.Fill(QuestionDataSet, "Questions")
        intQuestArray(i - 1) = QuestionDataSet.Tables("Questions").Rows(0).Item(0)

        Dim QuestionConnectionUpdateQuery As New OleDb.OleDbCommand("UPDATE Questions SET Questions.LastDateRevealed = NOW() WHERE Questions.QuestionID = [?]", QuestionConnection)
        QuestionConnectionUpdateQuery.Parameters.AddWithValue("?", intQuestArray(i - 1).ToString)
        QuestionConnectionUpdateQuery.ExecuteNonQuery()

    Next

    QuestionConnection.Close()
    Return intQuestArray
End Function

However, looping through the array will show that there are records are somehow being repeated even though the record updates during the loop.
Is there another way to loop through the database and pull up these records? I even attempted to move the .Open() and .Close() statements to within the For...Next loop and I'm given worse results than before.

A: As Steve wrote, the >= should be a < .
In addition, your WHERE clause is missing parentheses around the OR part.
It should be (without all unnecessary parentheses):
SELECT Questions.QuestionID
FROM Questions
WHERE Questions.QuestionDifficulty=[?]
  AND ( Questions.LastDateRevealed Is Null
     OR Questions.LastDateRevealed < DateAdd('d',-2,Date()) )
  ORDER BY Rnd(Questions.QuestionID * Time());

Also have a look at How to get random record from MS Access database - it is suggested to use a negative value as parameter for Rnd().


text:
Q: Flipping UIViews (like new Text Books flash cards) How to implement the iOS 5 flipping effect on a view like the one from Apple's new text book study cards?
Here you can see it working (min 2:56): http://www.apple.com/education/#video-textbooks

A: CoreAnimation, layer based. There's no standard flip animations like that, at least yet.


text:
Q: I'm not able to work with sticky header and angular material items at the same time So my problem is that I've created logic for sticky header and I've used mat-card component and it doesn't work with that. My sticky header logic looks like that:

*

*Part of the header.html:

*Logic inside header.ts

 @HostListener('window:scroll', ['$event']) onscroll() {
    if(window.scrollY > 100)
    {
      this.navbarfixed = true;
    } else {
      this.navbarfixed = false;
    }
  }

*And there styles for that one:

.fixed {
    position: fixed;
    width: 100%;
    transition: 0.2s linear;
    top: 0px;
}

.nofixed {
    position: static;
    transition: 0.2 linear;
    top: -50px;
}

I've added a mat-card component to one of the pages and when I try to scroll down, the header doesn't cover this component:

*Don't look on how fields are styled there, I haven't finished yet :)
Does anyone know how to solve that?
Thanks in advance for any suggestions!


text:
Q: Filter Stored Procedure Result (Informix) IBM Informix Dynamic Server Version 11.50.UC5XA.
I have a Informix database. This database contain a stored procedure with name of 'sp_agent_details' that get two DateTime Parameter. This stored procedure results about 27 columns and I want only few columns of it for reporting. I try this syntax:
select AGENT_NAME, AGENT_LOGIN_ID from
       TABLE(sp_agent_detail('2014-02-04 04:00:00', '2014-02-04 23:00:00'))

This Result such Error:
java.sql.SQLException: Illegal SQL statement in SPL routine.

Next I try this syntax:
select AGENT_NAME, AGENT_LOGIN_ID from
       TABLE(MULTISET{sp_agent_call_summary
    ('2014-02-04 04:00:00', '2014-02-04 23:00:00')})

Result:
 java.sql.SQLException: Function (informix.sp_agent_call_summary)
returns too many values.

then I tried this:
select AGENT_NAME, AGENT_LOGIN_ID from
   TABLE(sp_agent_detail('2014-02-04 04:00:00', '2014-02-04 23:00:00'))
   (AGENT_NAME, AGENT_LOGIN_ID, other columns that are returned by SP)

Result:
java.sql.SQLException: Illegal SQL statement in SPL routine.

A: Here is a illustration how works..
This was executed with dbaccess at Informix 11.50 FC9.
You can name your return parameters, but they are valid only when executed the procedure as procedure by self... not into select statement. There you need to name each column manually... check below.
References at IBM Informix 11.50 manual:

*

*select from syntax...

*procedure named return parameters

create procedure dummy ( param integer )
returning int as id , char(10) as name, date as created
define vid int;;
define vname char(10);;
define vcreate date;;

foreach c1 for
  select first 10 tabid, tabname, created
     into vid, vname, vcreate
     from systables where tabid >= param

  return vid , vname, vcreate with resume ;;
end foreach ;;

end procedure
;
Routine created.

;

execute procedure dummy(10);

         id name       created

         10 syssyntabl 20/02/2014
         11 sysconstra 20/02/2014
         12 sysreferen 20/02/2014
         13 syschecks  20/02/2014
         14 sysdefault 20/02/2014
         15 syscoldepe 20/02/2014
         16 sysprocedu 20/02/2014
         17 sysprocbod 20/02/2014
         18 sysprocpla 20/02/2014
         19 sysprocaut 20/02/2014

10 row(s) retrieved.

select  * from table(dummy(10));

unnamed_col_1 unnamed_col_2 unnamed_col_3

           10 syssyntabl    20/02/2014
           11 sysconstra    20/02/2014
           12 sysreferen    20/02/2014
           13 syschecks     20/02/2014
           14 sysdefault    20/02/2014
           15 syscoldepe    20/02/2014
           16 sysprocedu    20/02/2014
           17 sysprocbod    20/02/2014
           18 sysprocpla    20/02/2014
           19 sysprocaut    20/02/2014

10 row(s) retrieved.

select  * from table(dummy(10)) as x(id,name,created);

         id name       created

         10 syssyntabl 20/02/2014
         11 sysconstra 20/02/2014
         12 sysreferen 20/02/2014
         13 syschecks  20/02/2014
         14 sysdefault 20/02/2014
         15 syscoldepe 20/02/2014
         16 sysprocedu 20/02/2014
         17 sysprocbod 20/02/2014
         18 sysprocpla 20/02/2014
         19 sysprocaut 20/02/2014

10 row(s) retrieved.

select  x.id,name from table(dummy(10)) x(id,name,created);

         id name

         10 syssyntabl
         11 sysconstra
         12 sysreferen
         13 syschecks
         14 sysdefault
         15 syscoldepe
         16 sysprocedu
         17 sysprocbod
         18 sysprocpla
         19 sysprocaut

10 row(s) retrieved.

Database closed.

A: I had exactly the same problem! I was trying to report on UCCX and use the output of the stored procedures to populate new tables. I got either Illegal SQL Statement in SPL routine or returns too many values.
After some thought I came to the conclusion the only way to achieve this is to re-write the SPLs using JOINS rather than UPDATES. You can then use a SELECT to populate tables as needed. The problem is the linear way the SPLs have been written in. I think they were translated straight over to Informix from SQL server when UCCX was ported to RHEL from Windows.

A: Encountered similar situation while trying to select the results of a SP.
The problem in my case was the existence of create/drop temporary table statements inside the stored procedure code.

A: The "SQLException: Illegal SQL statement in SPL routine" error is due to the inclusion of certain statements in the stored procedure that cannot be used when called from a DML statement. Here's the Informix document.
A workaround is to execute the stored procedure, then fetch from it. This is not as elegant as your SELECT FROM TABLE() would have been, but it works.
Here's how I did it in Python; presumably, something similar would work in Java.
cur.execute("{call sp_agent_detail('2014-02-04 04:00:00', '2014-02-04 23:00:00')}")
for row in cur.fetchall():
    for field in row:
        whatever_you_need_to_do_with_the_fields


text:
Q: Функции insert() Вводятся две строки, необходимо в первой строке найти вторую и заключить ее в скобки. "s3.insert(1,s2)" без этой команды программа работает, с этой командой программа зависает. Подскажите в чем проблема.
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>

using namespace std;

int main(){
    setlocale(LC_ALL,"");
    string s1,s2,s3;
    cout<<"Введите первую строку: ";
    cin>>s1;
    cout<<"Введите вторую строку: ";
    cin>>s2;
    s3="()";
    s3.insert(1,s2);

    int size = s2.size();

    int x = s1.find (s2);
    while (x<s1.size()){
        s1.replace(x, size, s3);
        x = s1.find (s2);
    }

    cout<<s1;
}

A: Например, такая функция вернет вам то что нужно:
string&
enclose(string& s1, const string& s2,
        const char ch1 = '(', const char ch2 = ')')
{
    size_t first = s1.find(s2);
     if (first != string::npos) {
        auto p = s1.insert(s1.begin() + first, ch1);
        s1.insert(p + s2.size() + 1, ch2);
     }
    return s1;
}

Нет необходимости в дополнительном обьекте....

A: Если нужно найти все вхождения строки s2 в s1, то цикл здесь нужен.
Проблема в том, что следующее вхождение нужно искать не с начала строки, как вы это делали здесь:
x = s1.find (s2);
а с определённого индекса, то есть (предыдущий x + длина найденной строки)
x = s1.find(s2, x + s3.size());
Итого:
int x = s1.find(s2);
while (x != string::npos) {
    s1.replace(x, size, s3);
    x = s1.find(s2, x + s3.size());
}

A: Через метод find находим позицию начала строки s2 в строке s1. Если find не вернул std::string::npos, значит подстрока найдена, вставляем скобки методом insert.
#include <iostream>
#include <string>

int main(){
    std::string s1,s2;

    std::cout << "first string: ";
    std::cin >> s1;

    std::cout << "second string: ";
    std::cin >> s2;

    int pos = s1.find(s2);

    if(pos != std::string::npos)
    {
        s1.insert(pos, "(");
        s1.insert(pos+s2.length()+1, ")");
        std::cout << "Success!" << std::endl;
    }
    else
        std::cout << "Substring not found!" << std::endl;

    std::cout << s1 << std::endl;
    return 0;
}

first string: foobar
second string: bar
Sucess!
foo(bar)

A: Ну так а что вы делаете сдесь:
int x = s1.find (s2);
while (x<s1.size()){
    s1.replace(x, size, s3);
    x = s1.find (s2);
}

?
У вас всегда условие в цикле будет верным!! Так как если искомая строка есть в s1, то x, конечно, будет меньше size. А если нет, то x будет равен -1, и тоже меньше чем size.
И зачем вам сдесь вообще цикл? Разве не достаточно простого if?
int x = s1.find (s2);
if (x != -1){
    s1.replace(x, size, s3);
    x = s1.find (s2);
}

Так все работает.

A:     int x = s1.find (s2);
    while (x<s1.size()){
        s1.replace(x, size, s3);
        x = s1.find (s2);
    }

при осутствии find возвращает std::string::npos == -1 , то есть в любом случае бесконечный цикл. Баг в алгоритме ещё, вы в переменной s1 не удаляете найденную строку, а делаете replace , при s1 == s2 будет опять зависон. Демонстрация этой проблемы:
# include <string>
# include <iostream>
int main(){
std::string s1("abc");
std::string s2("a");
int size = s2.size();
std::string s3("aa");
int x = std::string::npos ;
if (x == -1) std::cout<<"std::string::npos == -1"<<std::endl;
else std::cout<<"std::string::npos != -1"<<std::endl;
size_t limit = 10 ;
x = s1.find (s2) ;
while ((x not_eq std::string::npos) and limit){
        s1.replace(x, size, s3);
        std::cout<<"s1="<<s1<<std::endl;
        x = s1.find (s2);
    -- limit ;   }
if(not limit)  std::cout<<"Zavison!"<<std::endl;}

результат:
std::string::npos == -1
s1=aabc
s1=aaabc
s1=aaaabc
s1=aaaaabc
s1=aaaaaabc
s1=aaaaaaabc
s1=aaaaaaaabc
s1=aaaaaaaaabc
s1=aaaaaaaaaabc
s1=aaaaaaaaaaabc
Zavison!


text:
Q: How to print date and time from db if record is Null? In my db i have 2 columns with format time and date. But value is null.
When im trying print results i have error:
Warning: date_format() expects parameter 1 to be DateTime, null given in
 my script is:
echo "" .date_format( $row['return_time'], 'H:i:s') . "
";"	";
  echo "" .date_format( $row['return_date'], 'd/m/Y') . "
";"	";

I know becouse Null in db but how to solve this problem?

A: echo "".(empty($row['return_date']) ? 'no date available' : date_format( $row['return_date'], 'd/m/Y')). "
";"	";


text:
Q: Are there any open source jQuery-based real-time text editors? Similar to Google docs in that many people can edit real time. I know there will be a server side component required. PHP-based would be preferred.
Free, free, free anyone?

A: EditArea is a free, open-source code editor that makes it easy for your users to share and format virtually any type of code from within the comfort of your website's submission form. Features include easy integration, clean source-code output, real-time syntax highlighting, auto-indentation, multilanguage support, multiple instances, full-screen mode, and much more.
http://www.cdolivet.com/editarea/editarea/docs/
EDIT
Ok, kept on searching for you and hound the following...
http://en.wikipedia.org/wiki/EtherPad
It seems like its multi-user, openscource and java based. Also the wikipedia page has some alternative programs listed. The site of Etherpad is a disaster if you ask me, but I just skimmed it. Hope this helps.

A: Give this one her a shot,
http://spaweditor.com/en/disp.php/en_products/en_spaw/en_spaw_demo?page=3


text:
Q: Is it a fallacy to have a 'tester goal'? Well, I would like to have a maven goal execute-custom-tests inside my custom-maven-plugin that consists of running test methods (This tests are not unit tests). Something similar to test goal of soapui-pro-maven-plugin, for example.
Why? Basically the main objectives of the plugin are testing stuff (not unit testing) and the tests in src/test are for unit testing, right?
Being more specific I was thinking about something like this:
@Mojo (name = "run-custom-tests",  LifecyclePhase.TEST)
public class TesterMojo extends AbstractMojo {

  @Parameter(property = "someParameter")
  private String someParameter;

  // [...] parameters for test configuration

  @Override
  public void execute() throws MojoExecutionException, MojoFailureException {
    // Piece of code that executes a set of custom tests which procedure I specified.
  }

}

When test fail, I would like them to be marked as failed tests not as failed executions. What's the right thing to do here? Show me the light, please.

A: Maven conventions support two types of testing out of the box: unit tests (via maven-surefire-plugin) and integration tests (via maven-failsafe-plugin).
By default, maven-surefire-plugin only looks for the following files with unit tests:

*

***/Test*.java

***/*Test.java

***/*TestCase.java

Similarly, default includes for integration tests run by  maven-failsafe-plugin are the following:

*

***/IT*.java

***/*IT.java

***/*ITCase.java

So, as you can see, Maven lets each plugin figure out which tests it should care about. So it's perfectly fine for src/test/java to contain different types of tests, not just unit tests.
Different folder
You can put tests in a different folder too. One example would be if you have non-Java tests, since then src/test/java location doesn't make sense. Standard Maven plugins get project model from Maven to figure out the src/test/java location and some 3rd party plugins use the same mechanism. Depending on the plugin you use, you might want to check out its configuration or use maven-build-helper-plugin to add-test-source in order for some plugins to pick up another test folder automatically.
Different tests on demand
From the Maven perspective the core difference between unit tests and integration tests is the additional requirements for the later: they often need to have your project already packaged and they often need additional setup or teardown. But you yourself can set up multiple test goals during both test and integration-test phases. All major test frameworks support specifying which test suite should be run when (e.g., via groups). If your framework doesn't, you can still use plugin includes/excludes. It is a standard practice to combine this with Maven profiles in order to only run smoke tests by default (during development) and to run full tests on CI environment. You can use the same approach to enable anyone (a tester?) to run extra tests on demand, e.g., to run extra heavy tests when certain important part of the code has changed.


text:
Q: Looking for a particular happiness dataset Im looking for a particular dataset I found before but did not download and now I can't seem to find it again (many google searches and checked my history).
I believe it contains around somewhere from 10-40K sentences from people who basically describe a pleasant event during the day and how it made them feel. They're all happy emotions like cheerful, tranquil etc... I believe it's a pretty famous dataset. Would love to run some deep learning practice with it.
Thank you.

A: Found the dataset in the question on kaggle
https://www.kaggle.com/ritresearch/happydb?select=cleaned_hm.csv


text:
Q: ODBC: Python gets data, C# doesn't..sometimes? This is a bit complex, but boils down to Python is successfully pulling the data and C# isn't.
Here is the SQL that is within a stored proc that sits on a remote server (Plexus).
Statement1:
SELECT DISTINCT
  CC.Serial_No,
  CC.Part_Operation_Key
INTO #Regrades
FROM Part_v_Container_Change2 AS CC

SELECT COUNT(*) FROM #Regrades
DROP TABLE #Regrades
RETURN;

This runs successfully by both C# and Python. When I add a join however C# no longer pulls any records but Python does. i.e.
Statement2:
SELECT DISTINCT
  CC.Serial_No,
  CC.Part_Operation_Key,
  PO.Operation_Key
INTO #Regrades
FROM Part_v_Container_Change2 AS CC
JOIN Part_v_Part_Operation AS PO
  ON PO.Part_Operation_Key = CC.Part_Operation_Key

SELECT COUNT(*) FROM #Regrades
DROP TABLE #Regrades
RETURN;

It gets a bit weirder though. Through playing with it I figured out it might have something to do with the temporary table. If I do a select and do not create this temporary table the data is successfully pulled by both programs (I need this temp table for later analysis though).
Because of this I thought I should use a create and insert shown below.
Statement3:
CREATE TABLE #Test
(
  Serial_No NVARCHAR(50),
  Part_Operation_Key INT,
  Operation_Key INT
);

INSERT #Test
(
  Serial_No,
  Part_Operation_Key,
  Operation_Key
)
SELECT DISTINCT
  CC.Serial_No,
  CC.Part_Operation_Key,
  PO.Operation_Key
FROM Part_v_Container_Change2 AS CC
JOIN Part_v_Part_Operation AS PO
  ON PO.Part_Operation_Key = CC.Part_Operation_Key
WHERE PO.Operation_Key = 32603 OR
      PO.Operation_Key = 33529;

SELECT COUNT(*) FROM #Test
DROP TABLE #Test
RETURN;

Now here is the kicker. This fails in C# but works in Python. However, I had both statement 2, and 3 on the same stored proc while I was testing. If I commented out statement2, and then uncommented out statement3, statement3 ran in C# each and every time. This works in reverse too.
Here is the code for C#. I put it into a console app to make sure nothing else in the program was causing the problem.
C#
static void Main(string[] args)
        {
            using (OdbcConnection connectionScalar = new OdbcConnection("DSN=XXXX; UID=XXXX; PWD=XXXX;"))
            {
                connectionScalar.Open();
                using (OdbcCommand command = new OdbcCommand("sproc164407_2053096_650810", connectionScalar))
                {
                    command.CommandType = CommandType.StoredProcedure;
                    var count = command.ExecuteScalar();
                    Console.WriteLine(count);
                    Console.WriteLine("Complete");
                    Console.ReadLine();
                }
            }
        }

Python
queryString = "{call sproc164407_2053096_650810 ()}"
connection = pyodbc.connect('DSN=xxxx; UID=xxxx; PWD=xxxx', autocommit = True)
cursor = connection.cursor()
cursor.execute(queryString)
recs=cursor.fetchall()
print(recs)

Python works everytime. If anyone can point me in the direction of what is going wrong, or what I can do to change this that would be great! I can run the python script but it's not very satisfactory to me to not know what the issue is.

A: Try adding SET NOCOUNT ON; as the first statement in the proc.  This will suppress DONE_IN_PROC messages (rowcounts) that can confuse some APIs.
I don't think you will have the problem in C# with the .NET Provider for SQL Server (SqlClient) and it will perform better than the ODBC from managed coe.


text:
Q: Reference other static file in django javascript file I need to load a file into a function to use with a telephone autoformatter library (Intl tel input)
When I tried this in a standalone html page, it worked fine, but when I'm trying to do it in a django project, the file just isn't loading and I think it's because it's not finding where it is in the path.
main.js and utils.js are both in the static directory of my project so I'm not sure why it can't find the utils.js file.
main.js:
$(document).ready(function() {
    $("#phoneNumber").intlTelInput({
        utilsScript: "utils.js"
    });
});

A: What I do in cases where I need to reference server-side paths in JavaScript is set up an "app" object in my uppermost template, which I can reference in JavaScript files that are loaded after, typically with require.js.
Example:
# base.html (upper-most template)
<!DOCTYPE html>{% load static from staticfiles %}
    <html>
        <head>. . .</head>
        <body>
            . . .
            <script>
                var myApp = {
                    staticUrl: '{{ STATIC_URL }}'
                }
            </script>
            <script src="{% static 'js/some-file.js' %}"></script>
        </body>
    </html>

# some-file.js

'use strict';

$(document).ready(function(){
    console.log(myApp.staticUrl);
});

A: Look at your URL dispatcher (urls.py) to see what the actual path where static files may be requested is.
For example in one of my projects, JavaScript files live at /static/js/.
So for instance if that were true of your configuration as well, you would do -
$(document).ready(function() {
    $("#phoneNumber").intlTelInput({
        utilsScript: "/static/js/utils.js"
    });
});

That's if you want to hard-code the URL. You can do that in templates, or in .js files which are not processed by the template engine.
However if you are in a template, I'd recommend using the staticfiles app, specifically the static template tag which acts as a helper to build paths to your files.