jeudi 31 janvier 2019

PHP PDO SQL Is Not Working Tried Everything

i've been trying to get this to work i rather use this for performance wise then a regular SQL but i am so close to just giving up and use what i know plain queries, but before i do i thought i ask if anyone can help me here first,

if I use $db->query this returns the number of rows in the database, but if i use db-prepare it keeps returning 0 whys this?

<?php 
require_once "core/c.php";

$query = $db->prepare("SELECT * FROM markyg_users");
$query->execute();
$count = $query->num_rows;
echo $count;
?>




Browser side WebP Encoder?

is there any implementation / browser-API / library that support encoding image to .webp format?

i know there are library on server side (nodejs and other) that can encode image to webp but client side encoding would be helpful since browser-side doesn't need to upload large raw data (jpg/png/gif) to server

PS: i've done my research on google




Can Wordpress plug-ins be applied to blogger?

I've found suitable wordpress plug-in for my project, but I want to embed or use that plug-ins on blogger. Is it possible to use wordpress plug-in on blogger ? If yes, How to apply it ?




How to get data by a middle host like this?

I have three hosts:

host1 : this is my router  (10.10.10.1)
host2 : python lib PyEZ  (10.10.10.2)
host3 : place the website  (43.43.43.43)

you see my host1(router) only can be access by my host2, my host2 can use the PyEZ to interact with the router, now my requirement is i want to realize the interact router function in my website(host3) via host2 accessing host1.

how can I implement with this?




My web doesn't load any suddenly with err code err_incomplete_chunked_encoding 200

I have got this problem from yesterday trying to find a reason for all day long. can't see anything or just few elements when I try to access to my web with this err msg err_incomplete_chunked_encoding 200. I tried with all type of browser Chrome, Firefox, Safari different devices switched off vaccine program but was the same. I tried to delete all java script as well but I think is not because of jp as is still has same problem. enter image description here

Does anyone knows what the problem is pls?




How to trigger the API with Modal in Angular 6

I need help to know how to trigger a delete API after a modal confirmation in Angular.

onDelete(id: number) {

this.confirmationDialogService.confirm('Confirm Delete', 'Do you really want to delete this document?')
.then(() => this.employeeService.deleteEmployee(id)) //this is not working
//.catch(() => console.log('User dismissed the dialog (e.g., by using ESC, clicking the cross icon, or clicking outside the dialog)'));

/*if (confirm('Are you sure you want delete this record?') == true) {
  this.employeeService.deleteEmployee(id);
}*/

}

As you can see in the code. I need to know how I make the call to the delete API after clicking the OK button in the modal.




Access local website from another computer in the same network

I recently wrote a web using Flask, and made the host='0.0.0.0', port=5000.

I can access the web with 127.0.0.1:5000 or localhost:5000 or 192.168.1.12:5000(my IP), but I can only do this with the computer that runs the codes.

How can I access the website from another PC in the same LAN? I have tried all the method I can find online. But none of them worked.

I'm running the code on windows 10. Please help!




What are some tips for optimizing a large background image of website home page, so that response time in minimized, and quality is maximized

Are there some specific resources you can point me to? For example, I would like to know if there are some resources that point me in the right direction. before and after scenarios. Any help is appreciated.

I'm basically starting with a set of images which are high resolution/high quality jpg's.




The Spring application seams to have an error

I am new to spring and for a project in school that I need to finish next week I must create a part of a Product Registration System. So I need to create the login, then a form to add a new product for one type of user (applicant) and then a search page and product page for another type of user (Regulator).

I found a tuto on this site :

https://o7planning.org/fr/11705/creer-une-application-de-connexion-avec-spring-boot-spring-security-jpa#a13933643

I followed it but I didn't want to use the security part because I don't really need it.

So I did almost everything I need to start, and after that I was going to create the actual pages with CSS and all, the second form etc..

Ting is it doesn't work..

WebSecurityConfig.java

        package com.config;

        import javax.sql.DataSource;

        import org.springframework.beans.factory.annotation.Autowired;
        import org.springframework.context.annotation.Bean;
        import org.springframework.context.annotation.Configuration;
        import org.springframework.security.config.annotation.web.builders.HttpSecurity;
        import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
        import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
        import org.springframework.security.web.authentication.rememberme.JdbcTokenRepositoryImpl;
        import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository;

        @Configuration
        @EnableWebSecurity
        public class WebSecurityConfig extends WebSecurityConfigurerAdapter {


            @Autowired
            private DataSource dataSource;

            @Override
            protected void configure(HttpSecurity http) throws Exception {

                http.csrf().disable();

                // The pages does not require login
                http.authorizeRequests().antMatchers("/", "/login").permitAll();

                // /userInfo page requires login as ROLE_USER or ROLE_ADMIN.
                // If no login, it will redirect to /login page.
                http.authorizeRequests().antMatchers("/Applicant").access("hasAnyRole('ROLE_APPLICANT', 'ROLE_REGULATOR')");

                // Config for Login Form
                http.authorizeRequests().and().formLogin()//
                        // Submit URL of login page.
                        .loginProcessingUrl("/j_spring_security_check") // Submit URL
                        .loginPage("/login")//
                        .defaultSuccessUrl("/userAccountInfo")//
                        .failureUrl("/login?error=true")//
                        .usernameParameter("username")//
                        .passwordParameter("password")
                        // Config for Logout Page
                        .and().logout().logoutUrl("/logout").logoutSuccessUrl("/");

                // Config Remember Me.
                http.authorizeRequests().and() //
                        .rememberMe().tokenRepository(this.persistentTokenRepository()) //
                        .tokenValiditySeconds(1 * 24 * 60 * 60); // 24h

            }

            @Bean
            public PersistentTokenRepository persistentTokenRepository() {
                JdbcTokenRepositoryImpl db = new JdbcTokenRepositoryImpl();
                db.setDataSource(dataSource);
                return db;
            }

        }

MainController.java

    package com.controller;

    import java.security.Principal;

    import org.springframework.stereotype.Controller;
    import org.springframework.ui.Model;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestMethod;

    import com.entity.User;

    @Controller
    public class MainController {

        @RequestMapping(value={"/","/login"}, method = RequestMethod.GET)
        public String loginPage(Model model) {
            model.addAttribute("title", "Login");
            return "loginPage";
        }


        @RequestMapping(value = "/Applicant", method = RequestMethod.GET)
        public String userInfo(Model model, Principal principal) {

            String userName = principal.getName();

            System.out.println("User Name: " + userName);

            model.addAttribute("userInfo", userName);

            return "loginPage";
    }
    }

pom.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.1.2.RELEASE</version>
            <relativePath/> <!-- lookup parent from repository -->
        </parent>
        <groupId>com.UNEP</groupId>
        <artifactId>UNEP</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <name>UNEP</name>
        <description>Project Techno Web UNEP Website</description>

        <properties>
            <java.version>1.8</java.version>
        </properties>

        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-jpa</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-security</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-thymeleaf</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>

            <dependency>
                <groupId>com.microsoft.sqlserver</groupId>
                <artifactId>mssql-jdbc</artifactId>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-test</artifactId>
                <scope>test</scope>
            </dependency>
        </dependencies>

        <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
            </plugins>
        </build>

    </project>

Application.properties

    # ===============================
    # DATABASE
    # ===============================

    spring.datasource.url=jdbc:mysql://localhost:3306/techno_web?useSSL=false
    spring.datasource.username=username
    spring.datasource.password=password
    spring.datasource.driver-class-name=com.mysql.jdbc.Driver

    # ===============================
    # JPA / HIBERNATE
    # ===============================

    spring.jpa.show-sql=true
    spring.jpa.hibernate.ddl-auto=none
    spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect

UnepApplication.java

package com;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class UnepApplication {

    public static void main(String[] args) {
        SpringApplication.run(UnepApplication.class, args);
    }

}

So this is the error I get when I run as Spring :

     .   ____          _            __ _ _
     /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
    ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
     \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
      '  |____| .__|_| |_|_| |_\__, | / / / /
     =========|_|==============|___/=/_/_/_/
     :: Spring Boot ::        (v2.1.2.RELEASE)

    2019-01-31 14:09:11.673  INFO 4668 --- [           main] com.UnepApplication                      : Starting UnepApplication on DESKTOP-MOLHK96 with PID 4668 (D:\Documents\Eclipse-Workspace\UNEP\target\classes started by Nicolas IMBS in D:\Documents\Eclipse-Workspace\UNEP)
    2019-01-31 14:09:11.679  INFO 4668 --- [           main] com.UnepApplication                      : No active profile set, falling back to default profiles: default
    2019-01-31 14:09:15.274  INFO 4668 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
    2019-01-31 14:09:15.576  INFO 4668 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 296ms. Found 0 repository interfaces.
    2019-01-31 14:09:15.866  INFO 4668 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$54d5f643] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2019-01-31 14:09:16.119  INFO 4668 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
    2019-01-31 14:09:16.135  INFO 4668 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
    2019-01-31 14:09:16.135  INFO 4668 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.14]
    2019-01-31 14:09:16.140  INFO 4668 --- [           main] o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_201\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_201/bin/server;C:/Program Files/Java/jre1.8.0_201/bin;C:/Program Files/Java/jre1.8.0_201/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Autre\apache-maven-3.6.0\bin;C:\Users\Nicolas IMBS\AppData\Local\Microsoft\WindowsApps;;C:\Windows\System32;;.]
    2019-01-31 14:09:16.290  INFO 4668 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
    2019-01-31 14:09:16.290  INFO 4668 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 4577 ms
    2019-01-31 14:09:16.364  WARN 4668 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.jdbc.Driver
    2019-01-31 14:09:16.366  INFO 4668 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
    2019-01-31 14:09:16.428  INFO 4668 --- [           main] ConditionEvaluationReportLoggingListener : 

    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
    2019-01-31 14:09:16.436 ERROR 4668 --- [           main] o.s.boot.SpringApplication               : Application run failed

    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.jdbc.Driver
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:769) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:218) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1308) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1154) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:392) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1288) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1083) ~[spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:853) ~[spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE]
        at com.UnepApplication.main(UnepApplication.java:10) [classes/:na]
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.jdbc.Driver
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:607) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1288) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1244) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1164) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        ... 28 common frames omitted
    Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.jdbc.Driver
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        ... 42 common frames omitted
    Caused by: java.lang.IllegalStateException: Cannot load driver class: com.mysql.jdbc.Driver
        at org.springframework.util.Assert.state(Assert.java:94) ~[spring-core-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName(DataSourceProperties.java:224) ~[spring-boot-autoconfigure-2.1.2.RELEASE.jar:2.1.2.RELEASE]
        at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.initializeDataSourceBuilder(DataSourceProperties.java:176) ~[spring-boot-autoconfigure-2.1.2.RELEASE.jar:2.1.2.RELEASE]
        at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:43) ~[spring-boot-autoconfigure-2.1.2.RELEASE.jar:2.1.2.RELEASE]
        at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari.dataSource(DataSourceConfiguration.java:83) ~[spring-boot-autoconfigure-2.1.2.RELEASE.jar:2.1.2.RELEASE]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_201]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_201]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_201]
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.1.4.RELEASE.jar:5.1.4.RELEASE]
        ... 43 common frames omitted

Thank you in advance :)




Preferable naming conventions for links in Microsoft Web API development?

Taking in consideration future flexibility of the API for upgrades, what would you consider the preferable naming convention for the links?

I have came across different solutions so far:

https://my.site.com/getProduct/{id}
https://my.site.com/Product/GetData/{id}
https://my.site.com/product/{id}/get_data

Underscores, camelcase, lowercase, parameters after or before object name etc. - these are questions that I'm finding the answer to.

I do not expect this to yield 1 answer anyone could consider the best, but I would like to find out how other developers handle these struggles.




Active Class of unable to fetch inside repeated element

.sample-4.sample li:nth-child(1) a.nav-link.active ~ li:last-child:after{transform:translateX(-290%)} .sample-4.sample li:nth-child(2) a.nav-link.active ~ li:last-child:after{transform:translateX(-104%)} .sample-4.sample li:nth-child(3) a.nav-link.active ~ li:last-child:after{transform:translateX(-90%)} .sample-4.sample li:nth-child(4) a.nav-link.active ~ li:last-child:after{transform:translateX(0%)}

what is wrong with this code? I am unable to execute upon click of active tabs.




Run static website with password auth in cloud

I have a simple one. Static website available after login - easily build and running on nginx.

But it seems to me cumbersome to server static web with small amount of connections (few per day) and spent a hours to set properly and maintain virtual machine during the lifespan of this project.

I use mostly GCP and consider their load balancer, or buckets made for static content, but none of this is able to give you a chance to auth users with passwords.

Do you have any tip for this? Provider is not concern or some kind of serverless with a pay as go will be perfect in my situation.

Thank you for your time




how to change date-picker's default Day of week in odoo?

Currently in odoo date picker shows from Su-Mo-Tu-We-Th-Fr-Sa i want to make it starts from Mo-Tu-We-Th-Fr-Sa-Su can anyone help me how to achive this as i checked in default odoo 12 addons it is hard coded. web/static/lib/moment/locale/.. language wise different files.

enter image description here




mercredi 30 janvier 2019

AdSense "Valueble Inventory No content"

I have an online gaming website and I am trying to be accepted by AdSense. I already have a lot of games on the website. Here is a link saturn-games.com . How should I fix the problem to be accepted by AdSense? What does this error mean?




while first click this #btnRequestedProviderSelect button not showing bootstrap model popup...second click it will come why?

 $("#btnRequestedProviderSelect").click(function () {
            $("#hdnORProvider").val('Requested');
            $.ajax({
                type: "Get",
                async: false,
                url: settings.ProviderSearchPopupURL,
                data: {
                    coverageID: 0,
                    fromPage: settings.Frompage, HPID: $('#MemberHealthPlanID').val(),
                    LOBID: $("#MemberLOBID").val(), IPAID: $("#MemberIPAID").val()
                },
                success: function (data) {
                    $("#divProviderSearch").html(data);
                    $("#divProviderSearchPopup").modal();
                    $('#divProviderSearchPopup').modal({
                        keyboard: false
                    });
                    $('#divProviderSearchPopup').modal('show');
                }
            });             
        });    

while first click this #btnRequestedProviderSelect button not showing bootstrap model popup...second click it will come why?




Building ReactJS Webapp Issue

I've been working on a ReactJS based website for a project of mine, and while the website runs as expected (incomplete, and kind of poorly built for now - but functional) in development mode, it fails when I try to build and run it using serve (on my local system)

I'm linking the Github repository below, I'd greatly appreciate it if someone could take a look at it and give me some inputs as to what I should be doing!

Github: https://github.com/raghavmecheri/BinIt_Website




Cannot Access Website From Internet (Apache2)

I have been working on my home server for a while now and just recently installed Apache2 and put Wordpress on it. I didn't realize that the website wasn't able to be reached from outside the network until I tried to load it from work today. I've checked all my settings, ports, and router settings and everything seems to be correct. I have ports 80 & 443 allowed in UFW and also forwarded in the router, so I don't believe it is that. I have attached my configurations, is there anything visibly wrong?

apache2.conf:

#This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.

# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
#   /etc/apache2/
#   |-- apache2.conf
#   |   `--  ports.conf
#   |-- mods-enabled
#   |   |-- *.load
#   |   `-- *.conf
#   |-- conf-enabled
#   |   `-- *.conf
#   `-- sites-enabled
#       `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
#   together by including all remaining configuration files when starting up the
#   web server.
#
# * ports.conf is always included from the main configuration file. It is
#   supposed to determine listening ports for incoming connections which can be
#   customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
#   directories contain particular configuration snippets which manage modules,
#   global configuration fragments, or virtual host configurations,
#   respectively.
#
#   They are activated by symlinking available configuration files from their
#   respective *-available/ counterparts. These should be managed by using our
#   helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
#   their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
#   the default configuration, apache2 needs to be started/stopped with
#   /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
#   work with the default configuration.


# Global configuration
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#Mutex file:${APACHE_LOCK_DIR} default

#
# The directory where shm and other runtime files will be stored.
#

DefaultRuntimeDir ${APACHE_RUN_DIR}

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5


# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf


# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

#<Directory /srv/>
#   Options Indexes FollowSymLinks
#   AllowOverride None
#   Require all granted
#</Directory>




# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
    Require all denied
</FilesMatch>


#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet</code>

teamslvr.com.conf:

<VirtualHost *:80>
    ServerName www.teamslvr.com
    ServerAlias teamslvr.com
    DocumentRoot /var/www/html
    DirectoryIndex index.php
    <Directory /var/www/html/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    <Location /sabnzbd>
        ProxyPass http://localhost:8080/sabnzbd
        ProxyPassReverse http://localhost:8080/sabnzbd

        order deny,allow
        deny from all
        allow from all
    </Location>

    <Location /sonarr>
        ProxyPass http://localhost:8081/sonarr
        ProxyPassReverse http://localhost:8081/sonarr

        order deny,allow
        deny from all
        allow from all
    </Location>

    <Location /radarr>
        ProxyPass http://localhost:8082/radarr
        ProxyPassReverse http://localhost:8082/radarr

        order deny,allow
        deny from all
        allow from all
    </Location>

    <Location /request>
        ProxyPass http://localhost:5000/request
        ProxyPassReverse http://localhost:5000/request

        order deny,allow
        deny from all
        allow from all
    </Location>


    ErrorLog /var/www/html/log/error.log
</VirtualHost>

ports.conf:

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80

<IfModule ssl_module>
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet




Web Terminal for Gitlab Omnibus using Apache & Kubernetes

As the offical doc said, You don’t need to configure anything with omnibus installation … but web terminal keep displaying ‘Connection failure’. Log said : wss://git.site.com/root/project/-/jobs/13/terminal.ws

Maybe it’s because I’m using apache and not nginx ?




Difficult to submit form and get table output as a response. R web scraping

I'm very new to web scraping and am trying to perform it using R.

I want to recover some public information from an website which requires me to fill a form. I believe I've correctly managed to fill the form with the code below, but the response that I get does not contain the table output that I want to download - element "page".

Could you tell me which sort of code I need to retrieve the table output when sending the form on this website?

Any tips on the direction to follow is highly appreciated.

Thanks a lot in advance

url <- "https://www.tjba.jus.br/registrocivil/consultaPublica/search"

wahis.session <- html_session(url)

filled.form <- html_form(wahis.session)

filled.form[[1]] <- set_values(filled.form[[1]],
                               form_tipoRegistro = 'LC' ,
                               form_cartorioRegistro = '99' )

page <- submit_form(session = wahis.session,
                             form = filled.form[[1]],
                             submit = 'form_search')




CORS Origin FAILED Spring Boot

I need you because @CROSSOrigin doesn't work and i don't understand why, you have my code here. In fact, i use WebService but i have a problem with the 'Acess-Control-Allow-Origin" i tried all but nothing had worked, please help me !!

SPRING BOOT Project with version 2.1.2 and i would like to build a REST API for ANGULAR 7

PROBLEM:

zone.js:3243 GET http://localhost:8080/apiEquipment/equipments 404
localhost/:1 Access to XMLHttpRequest at 'http://localhost:8080/apiEquipment/equipments' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
zone.js:3243 XHR failed loading: GET "http://localhost:8080/apiEquipment/equipments".
core.js:15714 ERROR 
HttpErrorResponse {headers: HttpHeaders, status: 0, statusText: "Unknown Error", url: "http://localhost:8080/apiEquipment/equipments", ok: false, …}

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-parent</artifactId>
                <version>2.1.2.RELEASE</version>
                <relativePath/> <!-- lookup parent from repository -->
        </parent>
        <groupId>com.example</groupId>
        <artifactId>GoSecuriServices</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <name>GoSecuriServices</name>
        <description>Rest API for GoSecuri Application</description>

        <properties>
                <java.version>1.8</java.version>
        </properties>

        <dependencies>
                <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-data-jpa</artifactId>
                </dependency>
                <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-data-rest</artifactId>
                </dependency>
                <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-web</artifactId>
                </dependency>
                <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-web-services</artifactId>
                </dependency>

                <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-devtools</artifactId>
                        <scope>runtime</scope>
                </dependency>
                <dependency>
                        <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <scope>runtime</scope>
                </dependency>
                <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-test</artifactId>
                        <scope>test</scope>
                </dependency>
        </dependencies>

        <build>
                <plugins>
                        <plugin>
                                <groupId>org.springframework.boot</groupId>
                                <artifactId>spring-boot-maven-plugin</artifactId>
                        </plugin>
                </plugins>
        </build>

</project>

Application.java

package com.example.GoSecuriServices;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;


@EnableJpaRepositories("com.example.GoSecuriServices.repository") 
@EntityScan("com.example.GoSecuriServices.model")
@ComponentScan
@SpringBootApplication
public class GoSecuriServicesApplication {

        public static void main(String[] args) {
                SpringApplication.run(GoSecuriServicesApplication.class, args);
        }
        
}

Equipment.java (my table)

package model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;


@Entity
@Table(name = "Equipment")
@EntityListeners(AuditingEntityListener.class)
@JsonIgnoreProperties(value = {"createdAt", "updatedAt"}, allowGetters = true)
public class Equipment {
        
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long Equipment_id;

    @NotBlank
    private String EquipmentName;

    @NotBlank
    private Integer Nb;


    // Getters and Setters
    public Long getEquipment_id() {
        return this.Equipment_id;
    }
    
    public void SetEquipment_id(Long id) {
        this.Equipment_id = id;
    }
    
    
    public String getEquipmentName() {
        return this.EquipmentName;
    }
    
    public void setEquipmentName(String name) {
        this.EquipmentName = name;
    }
    
    
    public Integer getNb() {
        return this.Nb;
    }
    
    public void setNb(Integer nb) {
        this.Nb = nb;
    }
    
}

EquipmentRepository.java

package repository;

import model.Equipment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;


@Repository
public interface EquipmentRepository extends JpaRepository<Equipment, Long> {

}

EquipmentController.java

package controller;

import exception.ResourceNotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import model.Equipment;
import repository.EquipmentRepository;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;


@RestController
@CrossOrigin(origins = "*", allowedHeaders = "*", maxAge = 3600)
@RequestMapping("/apiEquipment")
public class EquipmentController {
        
        @Autowired
    EquipmentRepository equipmentRepository;
        
        @RequestMapping(value= "/apiEquipment/**", method=RequestMethod.OPTIONS)
        public void corsHeaders(HttpServletResponse response) {
            response.addHeader("Access-Control-Allow-Origin", "*");
            response.addHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
            response.addHeader("Access-Control-Allow-Headers", "origin, content-type, accept, x-requested-with");
            response.addHeader("Access-Control-Max-Age", "3600");
        }
        
        // Get all equipments
        @GetMapping("/equipments")
        public List<Equipment> getAllEquipments() {
                return equipmentRepository.findAll();
        }
        
        
        // Create new equipment
        @PostMapping("/equipments")
        public Equipment createEquipment(@Valid @RequestBody Equipment equipment) {
                return equipmentRepository.save(equipment);
        }
        
        // Get a single equipment
        @GetMapping("/equipments/{id}")
        public Equipment getEquipmentById(@PathVariable(value = "id") Long equipmentId) {
                return equipmentRepository.findById(equipmentId)
                        .orElseThrow(() -> new ResourceNotFoundException("Equipment", "id", equipmentId));
        }
        
        // Update a Equipment
        @PutMapping("/equipments/{id}")
        public Equipment updateNote(@PathVariable(value = "id") Long equipmentId,
                                                @Valid @RequestBody Equipment equipmentDetails) {

            Equipment equipment = equipmentRepository.findById(equipmentId)
                    .orElseThrow(() -> new ResourceNotFoundException("Equipment", "id", equipmentId));

            equipment.setEquipmentName(equipmentDetails.getEquipmentName());
            equipment.setNb(equipmentDetails.getNb());

            Equipment updatedEquipment = equipmentRepository.save(equipment);
            return updatedEquipment;
        }
        
        // Delete a Equipment
        @DeleteMapping("/equipments/{id}")
        public ResponseEntity<?> deleteEquipment(@PathVariable(value = "id") Long equipmentId) {
                Equipment equipment = equipmentRepository.findById(equipmentId)
                                .orElseThrow(() -> new ResourceNotFoundException("Equipment", "id", equipmentId));
                
                equipmentRepository.delete(equipment);
                
                return ResponseEntity.ok().build();
        }
        
}



Move desktop game to web

I developed simple game using C#, Windows Forms and graphics library SFML.

Fire Tank Game

The game goal is to develop algorithm that performs by tanks (moving, shooting, etc) to extinguish the fire on the map.

This game can draw some kind of simple graphics, works with XML (to draw map, that opens from .xml file), has simple GUI (menu, combobox, datagridview, buttons, labels), uses API (Entity Framework) to query some data from small DB in SQL Server.

Now I would like try to turn it into web. So I need help with what languages (python, php, javascript?) and libraries I should use to develop the same game in web. In total necessary features:

  1. Draw graphics.
  2. Draw GUI.
  3. Work with DB.
  4. Work with XML.

Also, I implemented simple "sign in/up" logic. Is there any library that registers user and adds him to the DB? So, fifth featureis:

  1. Sign in/up feature.

Last, game uses inconvenient way to develop algorithms (users need to choose items of algorithm from combobox). Is there some library that allows to do it with "drag & drop" way?

  1. Drag & drop items to the table (datagridview).



CSS to create animation

I have a very newbie question in graphic/website design.

I plan on creating a website. In the website, on the initial page, while loading and also if it has loaded still for a certain duration I intend to have an animation going on.

Something similar to this one.

I am just learning that all of that could be done via CSS.

I wanted to know what sort of CSS do I need to learn to be able to create graphics like that because that doesnt seem like normal CSS.

Also, if I want to port the same interface to the mobile app (android or ios), can I just copy paste the CSS and get that working in Mobile app as well?




How does firebase.auth().createUserWithEmailAndPassword() works?

Weird happens when I try to authenticate new user, the app does not catch any errors but the user is not authenticated however when I debug the code in browser the user gets authenticated. I guess the function terminates before the process of creating a user is finished so when I make the program stop at a brake point while debugging it gives the process enough time to terminate but i don't know how to solve this problem.

               <form>
                   <input type = "text" id = "email" />  
                   <input type = "password" id = "pass" />  
                   <input type = "submit" id = "signup" />  
               </form>
               <script >


      var temail = document.getElementById('email');
      var tpass = document.getElementById('pass');
      var signup = document.getElementById('signup');
      signup.addEventListener('click',e =>{
           var email = temail.value;
           var password = tpass.value;
            firebase.auth().createUserWithEmailAndPassword(email, password)
            .then(function(user){
            console.log(user);
            }).catch(function(error) {
      // Handle Errors here.
      var errorCode = error.code;
      var errorMessage = error.message;
      console.log(errorMessage);
      alert(errorCode);
      // ...
    });
     alert('done');
      }) ;
</script>




How to add a label each splitLayout using shinyDashboard?

I am trying to create a tool using shinydashboard that performs survival analysis using user specified inputs. For the following code snippet is there a way to add a row label for the splitLayout? So that the following could look something like this: (Visit1 is the label and '###' text input box)

          Disease Score   Age   BMI
Visit1    #############   ###   ###



dashboardSidebar(
width = 300,
br(),
splitLayout(
  cellWidths = c("33%", "33%", "33%"),
  textInput("burden", "Disease Score", value = "2"),
  textInput("age", "Age", value = "40"),
  textInput("bmi", "BMI", value = "5")
),




JavaScript library to edit a PDF file [on hold]

I created a project using React Js that consumes endPoints for dynamic data (i don't have access to those endpoints). And it's been 4 days now i'm searching for a solution that can help me to manipulate pdf files inside my app. I have tried react-pdf, jsPdf, html2canvas then jsPdf, pdf2htmlEX then html2canvas then jsPdf, ...etc but all those methods are just ways to render pdf files or convert other file types to pdf type. What i'm need to do is to use a pdf file "as a model" and edit it according to the current data then generate the new one. I found this solution: pdfBox but it's a java tool which means that if i want to try/use it, i must create a java project that will communicate with my reactJs one. So my question is:

  1. is there a way to do the stuff using just JS which, i think, is the best way.
  2. if no, what is the best way to do it according to my situation without losing performances and without increasing the charges (i think creating new project with java will increase it).



I want to separate my files from web server for performance

I have web server for run my php files.But I still storage and upload my files in web server(192.168.2.22).I want to upload my files to 192.168.2.15(Free Nas) for performance.But I need answer some question and find best way. 1.Should I share a directory in 192.168.2.15(Free NAS) and mount this directory in my web server.? 2.Should I use ftp protocol for upload (Free NAS).? 3.Should I use cURL method for upload and get files?




What to use for running a php script for multiple users?

I got some code in php script (example.php). This script runs about 30-60 seconds and does some actions for one user.

Example.php runs atm only for 1 given user, what is the best way for looping over my users table and running this script for each one?

The script gets called now every ~5 minutes, this should stay the same expect it should be started for each user.

I am running PHP7.2 on my webserver and i tried it already with cronjobs. This works but only for the one hard-coded user. If I would put the loop for all users into this one script the running time would be to enormous. I tried to install pthreads on plesk but this also is a bit complicated.

As said it works for one user already but I dont know whats the best way to let it run for all users.




How do I proxy a third party library request on my Javascript web application?

I’m using a third party library in my web application which requests a remote server something like http://bit.ly/2Umo5Sa and the example.com is blocked in a company due to some restriction so I need to catch this request and send it by another server or proxy.

So the question is how can I catch the req first (cause I’m not the one who makes it) and then make that request by proxy or something and give back the answer to that third party library? Should I have to do it in service workers?

Please add code to your answers. Any help would be appreciated!




How to get started with building a website that calls an API and turns the XML/JSON response into a list/chart etc?

I have a system, which has an API, with a swagger interface, with which I'm somewhat familiar. The system contains metadata on thousands of publications.

The API can create a response in XML or JSON. So far so good. I'm becoming more and more interested in using the API to create something which uses the API: As an example - I have a website, where I would like to build an app(?) that shows the 10 newest publications, how many times a publication has been downloaded, the number of publications for a given year, how many publications are open access etc.

Main question: How do I get started with building something on a website, that requests the API and turns the response into something, I can show on a website? This could be basic lists, charts, graphics etc. Where do I get started, and what do I need to learn? I don't really have any programming experience so any hints on approach, tech, tutorials or language would be very appreciated.

Thanks!




Host text file on server and retrieve it in HTML

I have a website and on every page, I have some common text which should be same on every page, say, the footer note.

But since my website is in construction, I may change this note from time to time. So I would have to change it on many other pages manually.

I was seeking for a way that I could host a .txt file on my web server and load it into a the <p> tag using some web programming language.

I don't know anything regarding this and that's why I cannot provide any codes regarding this.




mardi 29 janvier 2019

Web service fail to access but Tomcat is still "Started"

I am using Apache Tomcat 8, MSSQL, window server 2008 R2 to implement my web page.

The web page service is normal most of the time. It cannot be accessed unexpectedly.

When the web page service cannot be accessed, the Service Status in Tomcat panel shows "Started".

The web page service will resume normal after I restart Tomcat.

28-Jan-2019 22:36:26.762 SEVERE [http-nio-9191-exec-61] 
com.microsoft.sqlserver.jdbc.TDSReader.throwInvalidTDS TDSReader@6c8543c5 ( 
ConnectionID:3622 TransactionID:0x0000000000000000) got unexpected value in       
TDS response at offset:157

28-Jan-2019 22:37:45.434 SEVERE [http-nio-9191-exec-60]             
com.microsoft.sqlserver.jdbc.TDSParser.throwUnexpectedTokenException 
TDSReader@c6cc18b ( ConnectionID:3631 TransactionID:0x0000000000000000): 
FetchBufferTokenHandler: Encountered unexpected TDS_RETURN_VALUE (0xAC)

28-Jan-2019 22:37:45.434 SEVERE [http-nio-9191-exec-60] 
com.microsoft.sqlserver.jdbc.TDSReader.throwInvalidTDS TDSReader@c6cc18b ( 
ConnectionID:3631 TransactionID:0x0000000000000000) got unexpected value in 
TDS response at offset:157

28-Jan-2019 23:40:28.340 SEVERE [http-nio-9191-exec-79] 
com.microsoft.sqlserver.jdbc.TDSParser.throwUnexpectedTokenException 
TDSReader@649469de ( ConnectionID:3655 TransactionID:0x0000000000000000): 
closeServerCursor: Encountered unexpected TDS_COLMETADATA (0x81)

28-Jan-2019 23:40:29.512 SEVERE [http-nio-9191-exec-79] 
com.microsoft.sqlserver.jdbc.TDSReader.throwInvalidTDS TDSReader@649469de ( 
ConnectionID:3655 TransactionID:0x0000000000000000) got unexpected value in 
TDS response at offset:0

After the above log in Tomcat appears, the web page cannot be accessed anymore until Tomcat is restarted.

How to keep the web page running normally?




Optimized ajax chat

I am working on a chat system for my website and I was wondering if there is another method of refreshing the chat with ajax, other than refreshing a div every 3 or 4 seconds. Because if there are a lot of users online, the server would immediately become very slow, because there would be a lot of requests. Is there another way to implement the chat system?




How access a deployed website with ZEIT Now?

I was trying to host my website with ZEIT - Now and the deployment was succesfull, but I can't access it with my url (https://site-bmwuvcgqf.now.sh) because he only downloads my source code and doesn't show the website.




Gps tracking platform

anyone know what kind of frameworks i need to use for a gps tracking web platform ? i need to do it but i dont know in what language of programming or frameworks i need to do it can you help me please

Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it Ignore it




How does one embed data such as a rating / review from other sites into an App?

I am not at all familiar with swift or iOS developmet (I only have python / SQL experience) so I am sorry if this is a stupid question.

How do iOS developers embed specific data such as a rating or review from other sites into an app that would hypothetically gather this data from several different websites?

So for example, for video game reviews app, the app wants to have the rating or review number from different sites that are all built and formatted completely differently, how does the iOS dev pull this specific data into a SQL table or into the iOS app itself? I imagine that the iOS app would talk to SQL first, but how does the link between the sites and the back-end environment connect?

How have you implemented this before, or how have you seen / heard of this being implemented?

Can this be done without scraping / hurting SEO?




How to get the data in flask from the HTML input with changing the url of website

I have a input box in HTML and what I want is to get the data that get input in that box when button is clicked. I know how to get data from the form

ex =  request.form['example'];

I want to get the data in flask just like above but for the input box which look like this -

<div class="form-inline" id="inputDiv">
      <center>
        <input class="form-group" id="msg-content" autocomplete="off" placeholder="Send a message" />
        <button class="btn btn-lg" onclick="sendMsg()" id="sendBtn"><span class="glyphicon glyphicon-send"></span></button>
      </center>
</div>




How can I get a number using c# and webscraping?

Basically I am creating a program that gets the number of accounts for sale in specific games on playerauctions. I need help with the webscraping aspect of it and getting the actual number into a list.

namespace Web_Scraping___Playerauctions { class Program { static void Main(string[] args) { GetHtmlAsync(); }

    private static async void GetHtmlAsync()
    {
        var url = "https://www.playerauctions.com/fortnite-account/";

        var httpClient = new HttpClient();
        var html = await httpClient.GetStringAsync(url);

        var htmlDocument = new HtmlDocument();
        htmlDocument.LoadHtml(html);

        var Products = htmlDocument.DocumentNode.Descendants("ul")
            .Where(node => node.GetAttributeValue("li", "")
            .Equals("span.Account")).ToList();

        Console.WriteLine();
        Console.ReadLine();
    }
}

}

I just threw a fortnite link in just because. So on the website when you look at the tabs for items leveling and accounts, it tells you how many accounts there are and thats what I want to get.




Does a HTTP response indicate the address of the receiver or something similar?

A HTTP request indicates the resource on the server by the URL in the start line and the HOST header.

Does a HTTP response indicate the address of the receiver or something similar? If not, why is it not necessary?

Thanks.




Is there any tool, framework or programming language than generates both backend and frontend for me

Suppose I want a programming language like that

var label = new Label(id="textLabel")
label.onClick = function Action()
  label.color = color.blue
  database.store("table:log,field:color[" + color.blue + "],time[" + time.now() + "]"
end function

It will generate both HTML, CSS, JavaScript and backend(whatever language it can be). If there is any programming language tool or something like that please answer




Client-Side Local Directory API Standards?

Working on a project where there is a need for a client to drag a local file-system Directory (Windows Explorer, MacOS Finder, etc) onto a Web Application in a current browser and for client-side JavaScript to iterate the files and directories within. Don't care if it's synchronous or asynchronous.

We have been looking at the Google/Mozilla FileSystem API and W3 File API standards but both, while functional and active in some browser versions, are either depreciated or dead standards. So my question is, what are the current accepted standard client-side JavaScript APIs for achieving this.

Requirements are simple: pure JavaScript, no browser extension. Current or emerging standards... anything.




encodeURIComponent on client and decodeURIComponent on server

could someone criticize me this approach:

I want to send a JSON object in a GET method but the body is not available, so I'm encoded the JSON in the client and decoded in the server, like this:

// on client
 let query = {
    subject: subject,
    sources: sources
  }
query = encodeURIComponent(JSON.stringify(query))
console.log(encoded);

// on server
const { query } = url.parse(req.url)
decodedQuery = decodeURIComponent(query)

it just works, but people use several libraries like querystring and query-string or manually build the query string.

So why don't do what I'm doing?

Regards




Static files are interpreted as Documents while having a different MIME type

I'm setting up a static website With the Google App Engine and my files aren't being served properly.

Example: https://shawnfunke.appspot.com/images/icon_144x.png

Following this URL will give you a Resource interpreted as Document but transferred with MIME type image/png: "https://shawnfunke.appspot.com/images/icon_144x.png". Warning and the PNG couldn't be loaded.

The same happens with other static files such as https://shawnfunke.appspot.com/css/style.css and https://shawnfunke.appspot.com/manifest.json but those still work.

This image REQUEST shows the type is set to Document I don't know why, but the response RESPONSE shows the correct MIME type image/png.

The static content should be served with the expected type / (CSS File/ Image / JSON File).

This is the app.yaml

runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /
  static_files: www/index.html
  upload: www/index.html
  secure: always

- url: /privacy
  static_files: www/pages/privacy.html
  upload: www/pages/privacy.html
  secure: always

- url: /(.*)
  static_files: www/\1
  upload: www/(.*)
  secure: always

The website can be viewed at https://shawnfunke.appspot.com

I've already tried using Chrome Stable and Firefox. The files also show properly on my local PC and can also be viewed at https://github.com/ShawnFunke/website/tree/master/www/images




Navbar not selecting section items on scroll - Bootstrap

I have created an html page using html5, css3 and bootstrap. Issue is that the navbar menu is not highlighting/selecting the items that are pointing to sections. I want that when I scroll down to other sections, the navbar should automatically highlight them in its menu. Here is snippet:

<html>

    <head>
        <title>Portfolio Website</title>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">

        <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"></script>

        <style>
            section {
                width:  100vw;
                height: 60vh;
                padding: 50px;
            }

            .cl_white {
                color: white;
            }
        </style>
    </head>

    <body data-spy="scroll" data-target=".navbar">
       <nav class = "navbar navbar-inverse navbar-fixed-bottom">
           <ul class = "nav navbar-nav">
                <li><a href="#home">Home</a></li>
                <li><a href="#work">Work</a></li>
                <li><a href="#contact">Contact Me</a></li>
           </ul>
       </nav>

       <section id = "home" style="background: url(header.jpg); background-size=100% 100%;" class = "text-center cl_white">
            <h1>Zeshan Sajid | Portfolio</h1>
            <p class="lead">Hey Welcome there! Let just read myselft and then contact me for your projects and tasks that you want me to finish on the basis of professinality and perfection with the blend of magical skills. You are always welcome to contact me and ask your queries, as I am available to help you all the time in this regard. Thanks. </p>
       </section>
       <section id = "work"></section>
       <section id = "contact"></section>

    </body>
</html>




Excel VBA for web site

Thanks for all the support which I receive from all, Today I am working on something where in it’s a repeated task and takes a lot of work to check, if anyone could help me with the Excel VBA for the same it will be a great help. I tried to note down the steps in loop which is used here.

Go to Web site url : https://login.live.com/ Click on sign in option Copy paste email address (eg. xxxx@outlook.com) from Excel cell A2 Click on Next If the error on next page is “That Microsoft account doesn't exist. Enter a different account or get a new one” Mention Invalid in excel cell B2 Else If it ask for a password “Enter password” Mention Valid in excel cell b2 Close current IE page Next email address from cell A3 (loop) Till the end of data I have more than 500 emails address to be checked in this way every week. Thanks

tried some of the codes for reference but need to learn it as I am novice

none so far

as explained




Integrate a website into a survey with an SDK

Has anyone already experience with integrating a website into a survey? I want the participants of my survey to visit a website without leaving the survey itself.

So you would answer some questions, then a website would open, where you can browse the website and interact with it, then the survey continues.

Maybe it is possible with an SDK? You can build an app with survey monkey API for example.

The following question would be: If it is possible, how can I track the parts of the website the participants actually visited?

Thank you for your ideas.

Kind regards Lisa




How to get the Footer width to reach full screen

I am making a website for a club and need help fixing the footer.

footer {
  width: 100%;
  background: #222;
  margin: 0 auto;
}

.footer-section {
  float: left;
  width: 33%;
  background: #222;
  color: white;
}
<footer>
  <div class="footer-section">Contact us at : 1015 7th street NW <br>
  </div>
  <div class="footer-section">Hey how you doing</div>
  <div class="footer-section">This weezy F baby</div>
</footer>

I want my footer to reach full browser screen but a tiny part of it on the right is left out and shows my background. I feel it's because using 33% on the width when there's three columns that 1% is showing. Is there anyway to fix this and keep it responsive




Uncaught ReferenceError google is not defined (spreadsheet) on HTML?

I want to do a web page, with google spreadsheet as storage, and I need to upload some cells, just like this: [link]

But when I do that it give me this error "Uncaught ReferenceError: google is not defined" or "Uncaught ReferenceError: google is not defined at HTMLInputElement.onclick"

I assume I have to put some reference, but I do not know how I get it




What is a SCREEPER_INJECTOR_INNERHTML_setter property on `window` in Vue?

unusual stuff reporting in. I am doing some pretty usual web-deving using Vue, nothing to see here, console.log(window) and here I see this rather unusually-and-pretty-not-cool-looking property. I got a bit scared at first, but it turns out that the main area it appears is a locally-hosted vue project I work on. I got pretty intrigued, I must say, since no google search is delivering meaningful answers.

Anyone has any idea what could it be? I am ready to answer some narrowing questions like "Do you use chrome plugins?" happy you ask, I do, some include wappalyzer, react and vue devtools and so forth.

Best, Paco

enter image description here




Implementation of login and registration functions in servlet filter

I'm newbie in servlet API. I have a test task to create a very simple web app with one home page and an authorization form. The requirement is to use filter in my app.

Given that it's a super simple app, I implemented basic login and registration functions right in my filter (it was much simpler for me).

Here is the question: can I do this at all according to the best practices? Or should I only leave the cookie check in the filter and move all other functions to separate servlets? Is it necessary?

The link to the filter (gist): https://gist.github.com/LexSav7/7b19acd51756c201df3b91f777adb8f6

P.S. I know that logic there is awful, I'm only learning :)




javascript - window.onload not working after opening a new blank window/page

What I am trying to do is a tool in which it will export a pdf file.

There are two cases:

  1. I don't have to check for anything and directly after the user clicks the export button it will open a new blank window because I am using headers to download the file and after the blank page is finished loading, it will close.

script for case 1

$('body').on("click", '.export-invoice-pdf', function () { // get id let id = $(this).closest('tr').data('id'); let newWindow = window.open( 'url' + id, "_blank" ); newWindow.onload = function() { newWindow.close(); }; });

This works fine


  1. I have to check if there is an available pdf file for the entry. before opening a new blank window to have the file and then close it afterwards just like in case1

script for case 2:

$('body').on("click", '.export-invoice-pdf', function () { // get id let id = $(this).closest('tr').data('id'); let newWindow = window.open( '', "_blank" ); //Ajax call to check if there is an available file $.ajax({ type: 'POST', url: 'url', data: {'orderId': orderId}, dataType: 'json', encode: true, }).success(function (data) { console.log('1'); if (data.hasFile === true) { //if has file do the samething as case 1 newWindow.location.href = 'url' + orderId; newWindow.onload = function() { newWindow.close(); }; } else { alert('no file to export'); } }).error(function () { }); });

Now this is not working. Actually my first problem was it's not making the new window because it treats it as a popup but I got that fixed after an hour of research. Now the closing of the window is my problem.

I have looked it up already in and still currently looking not just in here but sadly I was not able to find an answer about this problem. Any kind of help is appreciated.




Web-Application Vulnerability scanner

I am creating a web-application which scans for the vulnerability of site in HTML, which vulnerability would be the easiest one to create and in which language?




Whitelabel Error Page after refresh in spring boot web application

I am getting error as after refreshing http://localhost:8080/apiName url.It working for first call after if we refresh page it give following error

Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.

Tue Jan 29 15:12:58 IST 2019 There was an unexpected error (type=Not Found, status=404). No message available

My project structure is as follow.

My Project structure is as follows

I tried putting content of static under src/main/webapp..but didn't worked.




Is it possible to send AdaptiveTextBlock placeholder value as parameter list to weapons call

We have an adaptive card where the user has a choice to select yes or no. On selecting YES, user is prompted to enter the keywords. After the user gives input in the textblock in adaptive card, the input has to be captured and sent as input parameter to web api.

The user input will be given in Placeholder of the AdaptiveTextInput block.

public static Attachment GetUserInputForCustomPPT()

    {

        AdaptiveCard card = new AdaptiveCard()

        {

            Id = "GetCustomPPT",

            Body = new List<AdaptiveElement>()

            {

                new AdaptiveTextBlock()

                {

                    Text = "Do you want to apply filter and customise the PPT?",

                    Wrap=true,

                   Size = AdaptiveTextSize.Small

                },

                new AdaptiveContainer()

                {

                    Id = "getCustomPPTNo",

                    SelectAction = new AdaptiveSubmitAction()

                   {

                        Id = "getCustomPPTNo",

                        Title = "No",

                        DataJson = "{ \"Type\": \"GetCustomPPT\" }",

                    }

                },

                new AdaptiveContainer()

                {

                    Id = "getCustomPPTYes",

                    Items = new List<AdaptiveElement>()

                    {

                        new AdaptiveTextBlock()

                        {

                            Text = "Please select an option",

                            Wrap=true,

                            Size = AdaptiveTextSize.Small

                        }

                    }

                },

            },

            Actions = new List<AdaptiveAction>()

            {

                new AdaptiveShowCardAction()

                {

                    Id = "GetPPTYes",

                    Title = "Yes",

                    Card = new AdaptiveCard()

                    {

                        Body = new List<AdaptiveElement>()

                        {

                            new AdaptiveTextBlock()

                            {

                                Text = "Please enter your input",

                                Wrap = true

                            },

                            new AdaptiveTextInput()

                            {

                                Id="GetUserInputKeywords",

                                Placeholder="Please enter the keyword list separated by ',' Ex:RPA,FS ",

                                MaxLength=490,

                                IsMultiline=true

                            }

                        },

                        Actions = new List<AdaptiveAction>()

                        {

                            new AdaptiveSubmitAction()

                            {

                                Id = "contactSubmit",

                                Title = "Submit",

                                DataJson = "{ \"Type\": \"GetPPT\" }"

                            },

                            new AdaptiveOpenUrlAction()

                            {

                                Id="CallApi",

                                Url=new Uri("https://xyz"+"RPA")

                                //card.Actions.Card.AdaptiveTextInput.Placeholder

                            }

                        }

                    }

                },





                 new AdaptiveShowCardAction()

                {



                    Id = "GetPPTNo",

                    Title = "No",

                    Card = new AdaptiveCard()

                    {

                        Body = new List<AdaptiveElement>()

                        {



                        },

                        Actions = new List<AdaptiveAction>()

                        {

                            new AdaptiveSubmitAction()

                            {

                                Id = "contactSubmit",

                                Title = "Submit",

                                DataJson = "{ \"Type\": \"GetPPTNo\" }"

                            }

                        }

                    }

                }

            }

        };

        // Create the attachment with adapative card. 

        Attachment attachment = new Attachment()

        {

            ContentType = AdaptiveCard.ContentType,

           Content = card

        };

        return attachment;

    }![enter image description here](https://i.stack.imgur.com/sFcAW.jpg)




Monitoring for web applications

I'm doing an internship at a company and have the task to create a monitoring application that monitors web applications (.Net) that are being hosted on a server. This application i have to make in .Net. These things should be monitored:

  • Uptime
  • Speed of web application
  • SSL (expire date)

Do you have any tips/API's/libraries i can use to make this application in .Net? I already did some research and found that FiddlerCore was a good library to have but its only free for student or personal usage.




Consume a web service via WSDL url

I need to consume a web service using a wsdl url, after searching on internet, I generated a class library using wsdl.exe command-line, then made instance from the class and send parameter with object from the class but I am getting this error !!

enter image description here

Also I generated dll library from wsdl url and used it in a console project but I get the same error.

namespace ConsoleProject

{ class Program { static void Main(string[] args) {

        Services.Service obj = new Services.Service();
        Console.WriteLine(obj.MethodName("Param1", "Param1"));
        Console.ReadLine();


    }
}

}

the source web service is (Service.svc) and contains many methods.

What I am Missing !!! any help




lundi 28 janvier 2019

How to do something like this fadein effect? (Beginner)

I am new to Javascript and I found a nice website, that I want to recreate. Especially the pictures that appear after scrolling down.

Website: https://www.montere.it/?lang=en

How to do this?




I want to apply a version control system that applies only to text to my web

When the text file is modified, a record is made. You can go back and be comparable . I want to implement the following. Do you have any reference or library that already exists?




How can I get url in Gin middleware?

I want to do a A/B test in a Gin's middleware, I want to pass url:usermeta as a key-value to the A/B test service. How can I achieve this goal?Or any other grace way?




System dealing with multiple selections that conflict

I am writing a web based application, in Vue.js. I am attempting to make a gun modification tool to assist new users in a game called Escape from Tarkov.

There are many different combinations that can be made on the website but how do I prevent and check when the user has selected an item that conflicts. Without going the long route of individually assigning what can and cant be done, surely programmers have created a systematic way of doing this?

An example would be a fashion website that allows you to mix and match. But some designers dont allow their brand to mix with others so you would have to check and prevent selections.




Web API to query the processing power of a device?

Is there a way to query the rough processing power of a device that is running a web browser / user-agent? This would be similar to navigator.deviceMemory which offers the RAM of a device.




React. Which folder to store common methods for component?

How to name this folder and where to store common methods.

handleChange = (e) => {
const { currentTarget: input } = e;
this.setState(prevState => {
  let linkData = { ...prevState.linkData };
  linkData[input.name] = input.value;
  if (input.name === "tag") {
    linkData = this.addTag(linkData);
  }
  return { linkData };
});

};




How To Display Images Preview and Title When I Paste in Another Site Like Facebook, Whatsapp, etc

I tried copying another site's news this is image when i copy one of the url news then I paste it in whatsapp then it appears like this this is image when i after paste in whatsapp this is so good

but when i copy one of the url my project news like this and then i paste in whatsapp but it will be like this this is image after i paste in whatsapp it will not be like the previous picture, there is no title and preview image

thanks,




Owl Carousel 2 - Can't toggle checkbox through it's label when `loop` is true

When I make my carousel with the loop option set to true it's impossible to toggle a checkbox clicking on the label associated with it.

Here's an example with both situations: https://jsfiddle.net/v79n53xq/2/




How should I specify a tab in a website to read with webread()?

Considering this web page: http://tsetmc.com/Loader.aspx?ParTree=151311&i=778253364357513 , that I like to read the contents of the one of the tabs on above of the page (most left violet tab that is written "حقیقی- حقوقی" on it for example. How should I specify that in my webread() function to go on that tab and read it's information? Best regards.




Taking GridView Data to make Certificate on Visual Studio

I want to make a certificate based on GridView Data, today's date, Image on Desktop, on gridViewSelectedIndexChanged take data to pdf certificate. i.e on the image below under "for" place index 0 on GridView which's the name, under "Awarded to" place index 1 on GridView, add today's date to Date section, add photo to Signature section and export the file to pdf. Is it possible?

i.e for certificate




Visual Studio 2015 Error , Expected 1 export with contract name

In Visual Studio 2015, I am getting error that, Expected 1 export with contract name, Error related to this what to do, VS 2015 is not working, Web files not opens.I have already tried to update it, But not successful.




How should I structure my proyect to publish an external WEB API

everyone. I've recently finished a Web API (in .NET) which is aimed to search data and return it.

The problem is that I don't actually know how should I publish the API. My project is structured in layers (Presentation - Services - Business - DataAccess).

For the moment, the API is only consumed by Presentation. However, there is a possibility to be consumed by an external website so I need to publish the WEB API as an external project (I think) so it can be accessed by externals applications, forgive the redundancy.

The issue is that the WEB API, to search for data, consults Business Layer (which consults Data Access layer) and returns it as a JSON structure. But when I publish the WEB API as an external project it cannot longer access to the business layer which is contained in the original website.

Summarizing, I need to know how to structure my two independent projects (the website and the WEB API) in a way I can still access the business layer from the WEB API.

I've been searching and I found some people who suggest publishing the business layer as a separated project.




Firebase - How to get the child of child of child and display into the HTML table?

Firebase Database Image. Please click here to have a look I would like to get the data of name, phone number, foodName and quantity and show it in my HTML table. But I have no idea how to get it since I'm a beginner.

var rootRef = firebase.database().ref().child("Requests");

rootRef.on("child_added", snap => {

var name = snap.child("name").val();

var phone = snap.child("phonenumber").val();

var foodname = snap.child("foodName").val();

var quantity = snap.child("quantity").val();

}

I expect I will able to get the data of name, phonenumber, foodName and quantity and display to my HTML table.




Can I open url on opera from console?

Ok, I need to open URL from console in opera (not standart browser), and can I use this command to write bash script (Ir is would be like a shortcut)?




Get statistics from wordpress to laravel

I have a lot of Wordpress websites running.

What i want to create is a Laravel website with an overview of all my Wordpress websites, including information as (in the beginning) username and password and the website url, and for later moment more information about the installed plugins or last changes on the website.

At the end it has to be somewhat automatically updating.

Any ideas to create something like this?




How to bypass alert/dialog authentication in POST request?

So, when I try to consume certain API i got this screen

screen from the Correios API

I want to know if there's a way I can send this "username" and "password" through postman or javascript.

When I try to use postman i get 401 unauthorized

postman request unauthorized




Can I stream a unity project to webRTC?

I am trying to stream my unity project using WebRTC, is that possible and if so, how do I implement it?




Why does .on() not see to call its function when the subtree is modified?

Im working on an in-browser (very basic) chat. I have jquery code

    $("#msgs").on("DOMSubtreeModified", function() {
        location.reload()
    });

and i need to refresh the page when the div msgs has another

added to it.

Why is this code not doing so?

I've tried MutationObserver as well

the repl for those that want to test it: https://repl.it/@aceharvey/hy-chat




Scraping AJAX e-commerce site using python

I have a problem on scraping an e-commerce site using BeautifulSoup. I did some Googling but I still can't solve the problem.

Please refer on the pictures:

1 Chrome F12 : https://scontent.fkul7-1.fna.fbcdn.net/v/t1.0-9/50874003_2100628179980272_838265414453559296_n.jpg?_nc_cat=105&_nc_ht=scontent.fkul7-1.fna&oh=610394bf4ee663dc54b71b1084654666&oe=5CB32DB8

[2] Result : https://scontent.fkul7-1.fna.fbcdn.net/v/t1.0-9/50713161_2100628126646944_8588520010161324032_o.jpg?_nc_cat=105&_nc_ht=scontent.fkul7-1.fna&oh=e2caf3fae70e66690fdcadcfe3da3d0e&oe=5CBB6B16

Here is the site that I tried to scrape: "https://shopee.com.my/search?keyword=h370m"

Problem:

  1. When I tried to open up Inspect Element on Google Chrome (F12), I can see the for the product's name, price, etc. But when I run my python program, I could not get the same code and tag in the python result. After some googling, I found out that this website used AJAX query to get the data.

  2. Anyone can help me on the best methods to get these product's data by scraping an AJAX site? I would like to display the data in a table form.

My code: import requests from bs4 import BeautifulSoup source = requests.get('https://shopee.com.my/search?keyword=h370m') soup = BeautifulSoup(source.text, 'html.parser') print(soup)