High availability – Secondary replica of the permanent availability group NOT identical to Primay

Can I have the primary node of the Always-on availability group different from the secondary?
example:
Main replica
RAM 64, cores 8
Secondary reply
RAM 256, cores 32

Since I consider that the read-only requests are written 4 times, and that I will use the read routing to the secondary, I found a recommendation so that the two replicas always active are comparable, and i don't know if this is a recommendation, or if identical means thanks

miui – Share clipboard data between users on Android multi-user (secondary space)?

Leaving aside security concerns, is there a reliable way to communicate data via the clipboard between users on a single device without using network methods? For example, just copy a link to the main space, then access it later via the clipboard in the secondary space. Application suggestions are welcome.

NB: There is already an option to import / export files, photos, etc. (but not sharing the clipboard)

Running MIUI 9, Android 7

sharepoint online – Updating a secondary list with the values ​​of a primary list

I have list A and list B. I use SharePoint Online and Power Automate

When an item is list A, I want Flow to copy the item to list B. I add additional fields which will be required for the next step.

I use a Get Items action to get the values ​​from list A, then I have an application to each loop with an output value. This is followed by an Update Item action which I point to list B and use the values ​​returned by the Get Items action to update the fields.

This is part of a larger stream (should I create it as its own separate stream?). I check the results of the Update element action and it seems to display the values ​​of the elements in the Id and Body fields but on the output, I get a 404. I don & # 39; haven't recreated all the fields in list A to list B yet because I wanted to run a proof of concept test.

Any ideas where I'm wrong?

sql server – Best way to filter the result set by secondary key

I have a table with a primary key and a secondary key, something like

CREATE TABLE Entry (
     PrimaryKey int NOT NULL,
     SecondaryKey int NOT NULL,
     Data nvarchar(100) NOT NULL,
     DateCreated DATETIME NOT NULL
);

    INSERT INTO Entry VALUES(1,1,'test',getutcdate()),
(2,1,'test',getutcdate()),
(3,2,'test',getutcdate()),
(4,3,'test',getutcdate()),
(5,3,'test',getutcdate()),
(6,3,'test',getutcdate()),
(7,4,'test',getutcdate()),
(8,4,'test',getutcdate())

I want to be able to return entries sorted by datecreated, but only 1 entry per secondary key. so with the above data, i would only get 4 lines, the most recent entry for each secondary key.

What is the best way to do this?

High availability SQL server, secondary replicas cannot be connected on the availability group

I created an availability group (two nodes), then my secondary replica is not connected as in the photo. I checked on the error logs and I have this error. how can i give permission to my secondary replica? Thank you.

enter description of image here

enter description of image here

multiple monitors – How to direct Linux to boot with the HDMI port as a PRIMARY screen? After installation, X11 treats HDMI as a secondary

I have a laptop that I want to boot into Linux with the external monitor as the main one. I know you can do this with a command line function after startup or with a script, but I want Linux to immediately treat HDMI as screen 1 and turn off the laptop screen. This laptop has no screen function keys. I was hoping to use UEFI or something?

In a perfect hash, why does a secondary hash of quadratic size lead to no collision?

I read the following in CLRS 3rd Edition (Section 11.5, "Perfect hash"):

enter description of image here

How the choice of $ m_j = n ^ 2_j $ lead to no collision?

SQL Server – If I manually fail over my AlwaysOn AG primary replica to secondary and take the primary database offline, will it synchronize automatically when it goes online again?

I have an AlwaysOn AG configuration between database A (primary replica) on server 1 and database B (secondary replica) on server 2. If I force a manual failover of my primary replica on the server 1 to the secondary replica on server 2, then takes Database A (on server 1) offline, will it be automatically synchronized from database B (on server 2) when I will put it online?

Do I have to wait for synchronization to finish before manually switching to database A from database B?

Can I follow its synchronization progress in the AG dashboard?

mysql – Java EE – Memory overhead, secondary threads that do not close (Daemon Thread [HikariPool-10 housekeeper] (Running)

My problem: my application consumes all the memory of the server and crashes Tomcat.

I use Eclipse, JSF, MySQL, Hibernate, HikariCP.

Whenever I open a database connection thread, it closes normally, but a second thread is left open forever, which results in memory overhead and Tomcat crashes (Caused by: java .lang.OutOfMemoryError: GC overhead limit exceeded), has anyone experienced this?

The problem is that I realized that Hikari keeps threads running even after consulting the bank, even after the session ends. It's overwhelming my request.

If someone knows how to close them, thank you, or manage to understand the cause of not being finalized, after having closed the main connection with the bank, in any case I appreciate any idea.

Example of open secondary threads (the main Bank connection threads close normally), if I open a screen 10 times, 10 secondary threads will remain in memory, I cannot resolve this memory leak, because I don't ; have no control over these threads.

Demon Thread (HikariPool-1 Maid) (running)
Demon thread (cleaning lady HikariPool-2) (running)
Demon Thread (HikariPool-3 Maid) (running)
Demon thread (cleaning lady HikariPool-4) (running)
Demon thread (cleaning lady HikariPool-5) (running)
Demon thread (cleaning lady HikariPool-6) (running)
Demon thread (cleaning lady HikariPool-7) (running)
Demon thread (cleaning lady HikariPool-8) (running)
Demon thread (cleaning lady HikariPool-9) (running)
Demon Thread (housekeeper HikariPool-10) (Running)

As I do:

pom.xml:

        4.0.0
        br.com.projeto
        testbeds
        war
        0.0.1-SNAPSHOT
        testbeds

        
            UTF-8
        

        
            
            
                org.omnifaces
                omnifaces
                3.3
            

            
            
                org.primefaces
                primefaces
                7.0
            

            
            
                org.jboss.weld.servlet
                weld-servlet
                2.4.8.Final
            

            
            
                org.jboss
                jandex
                2.1.1.Final
            

            
            
                org.hibernate
                hibernate-core
                5.4.6.Final
            


            

            
            
                com.mchange
                c3p0
                0.9.5.4
            


            
            
                org.hibernate.common
                hibernate-commons-annotations
                5.1.0.Final
            



            
            
                org.hibernate
                hibernate-entitymanager
                5.4.6.Final
            


            
            
                mysql
                mysql-connector-java
                8.0.16
            

            
            
                org.glassfish
                javax.faces
                2.4.0
            

            
            
                javax.servlet
                javax.servlet-api
                4.0.1
                provided
            

            
            
                com.sun.faces
                jsf-api
                2.2.13
            


            
            
                javax
                javaee-api
                7.0
                provided
            

            
                net.bootsfaces
                bootsfaces
                1.4.1
                compile
            

            
                junit
                junit
                3.8.1
                test
            

            
            
                org.json
                json
                20180813
            

            
            
                org.hibernate.validator
                hibernate-validator
                6.1.0.Alpha5
            

            
                org.ocpsoft.rewrite
                rewrite-servlet
                3.4.1.Final
            
            
                org.ocpsoft.rewrite
                rewrite-config-prettyfaces
                3.4.1.Final
            

            
            
                javax.servlet
                jstl
                1.2
            

            
            
                org.apache.poi
                poi
                4.1.0
            

            
            
                net.sourceforge.barbecue
                barbecue
                1.5-beta1
            

            
            
                net.sf.jasperreports
                jasperreports
                6.9.0
            

            
            
                net.sf.jasperreports
                jasperreports-fonts
                6.9.0
            

            
            
                xerces
                xercesImpl
                2.12.0
            

            
            
            
                org.slf4j
                slf4j-log4j12
                1.6.1
            

            
            
                org.hsqldb
                hsqldb
                2.5.0
                test
            

            
            
                commons-fileupload
                commons-fileupload
                1.4
            

            
                commons-io
                commons-io
                2.6
            

            
            
                joda-time
                joda-time
                2.10.4
            

            
            
                commons-validator
                commons-validator
                1.6
            

    

            
            
                org.hibernate
                hibernate-hikaricp
                5.4.10.Final
            


        

        
            testbeds
            
                
                    org.apache.maven.plugins
                    maven-compiler-plugin
                    3.8.0
                    
                        1.8
                        1.8
                    
                
            
        
    

My Persistence.xml:

    


    br.com.projeto.testbeds.persistence.entities.Curso
    br.com.projeto.testbeds.persistence.entities.Edital
    br.com.projeto.testbeds.persistence.entities.AlunoInscricao
    br.com.projeto.testbeds.persistence.entities.Disciplina
    br.com.projeto.testbeds.persistence.entities.Usuario
    br.com.projeto.testbeds.persistence.entities.Projeto
    br.com.projeto.testbeds.persistence.entities.ProjetoAluno
    br.com.projeto.testbeds.persistence.entities.Campus
    br.com.projeto.testbeds.persistence.entities.Mensagem
    br.com.projeto.testbeds.persistence.entities.MensagemAnexo
    br.com.projeto.testbeds.persistence.entities.Pendencia
    br.com.projeto.testbeds.persistence.entities.AcaoUsuario
    br.com.projeto.testbeds.persistence.entities.Emprego
    br.com.projeto.testbeds.persistence.entities.Acesso

    

        
        
        
        
        
        
        

        
        

        
        

        
        


        
        
        
        
        

        


    
        ` Classe EntityManagerProducer: ` import javax.enterprise.context.RequestScoped; import javax.enterprise.inject.Disposes; import javax.enterprise.inject.Produces; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence;
    public class EntityManagerProducer {

    private EntityManagerFactory factory;

    public EntityManagerProducer() {
        this.factory = Persistence.createEntityManagerFactory("testbedsPU");
    }

    @Produces
    @RequestScoped
    public EntityManager createEntityManager() {
        System.out.println("criar1");
        return factory.createEntityManager();

    }

    public void closeEntityManager(@Disposes EntityManager manager) {
        manager.close();
        this.factory.close();
    }
    }

My DAOFactory:


    import java.lang.reflect.ParameterizedType;

    import javax.enterprise.context.Dependent;
    import javax.enterprise.inject.Produces;
    import javax.enterprise.inject.spi.InjectionPoint;
    import javax.inject.Inject;
    import javax.persistence.EntityManager;

    import br.com.projeto.testbeds.persistence.DAOInterfaces.DAO;

    public class DAOFactory {

    @Inject
    private EntityManager em;

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Produces
    @Dependent
    public  DAO createDAO(InjectionPoint point) {
        ParameterizedType type = (ParameterizedType) point.getType();
        Class classe = (Class) type.getActualTypeArguments()(0);
        return new DAOImpl(classe, em);
    }
    }

My DaoImpl:


    import java.io.Serializable;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;

    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;
    import javax.persistence.TypedQuery;

    import br.com.projeto.testbeds.persistence.DAOInterfaces.DAO;
    import br.com.projeto.testbeds.persistence.fileservice.FileXMLService;

    public class DAOImpl implements DAO {

    /**
     * 
     */
    private static final long serialVersionUID = 422152908443386672L;

    private EntityManager em;

    private final Class classe;

    private static final FileXMLService hqlQuery;

    static {
        hqlQuery = new FileXMLService("hql.xml");
    }

    public DAOImpl(Class classe, EntityManager em) {
        this.classe = classe;
        this.em = em;
    }

    @Override
    public T save(T entity) {
        em.persist(entity);
        em.flush();
        return entity;
    }

    @Override
    public T update(T entity) {
        entity = em.merge(entity);
        em.flush();
        return entity;
    }

    @Override
    public List getAll() {
        String hql = "Select e from " + this.classe.getSimpleName() + " e";
        TypedQuery query = em.createQuery(hql, this.classe);
        return query.getResultList();
    }

    @Override
    public List findByHQLQuery(String queryId, int maxResults) {
        String hql = hqlQuery.findValue(queryId);
        TypedQuery query = em.createQuery(hql, this.classe);
        return maxResults == 0 ? query.getResultList() : query.setMaxResults(maxResults).getResultList();

    }

    @Override
    public List findByHQLQuery(String queryId, List value, int maxResults) {
        String hql = hqlQuery.findValue(queryId);
        Pattern pattern = Pattern.compile("(:\w+)");
        Matcher matcher = pattern.matcher(hql);
        List params = new ArrayList<>();
        while (matcher.find()) {
            params.add(matcher.group().replace(":", ""));
        }
        // System.out.println();
        // System.out.print(hql);
        TypedQuery query = em.createQuery(hql, this.classe);
        for (int i = 0; i < params.size(); i++) {
            // System.out.println(params.get(i) + " - " + value.get(i));
            query.setParameter(params.get(i), value.get(i));
        }
        // System.out.println();
        // System.out.println();

        return maxResults == 0 ? query.getResultList() : query.setMaxResults(maxResults).getResultList();
        //System.out.println("a13");
        // return null;
    }

    // para aqueles que gosta de anotar as querie na model
    @Override
    public List findByHQLNamedQuery(String queryNamed, int maxResults) {
        String hql = queryNamed;
        TypedQuery query = em.createNamedQuery(hql, this.classe);
        return maxResults == 0 ? query.getResultList() : query.setMaxResults(maxResults).getResultList();

    }

    @Override
    public List findByHQLNamedQuery(String queryNamed, List value, int maxResults) {
        String hql = queryNamed;
        Pattern pattern = Pattern.compile("(:\w+)");
        Matcher matcher = pattern.matcher(hql);
        List params = new ArrayList<>();
        while (matcher.find()) {
            params.add(matcher.group().replace(":", ""));
        }
        // System.out.println();
        // System.out.print(hql);
        TypedQuery query = em.createNamedQuery(hql, this.classe);
        for (int i = 0; i < params.size(); i++) {
            // System.out.println(params.get(i) + " - " + value.get(i));
            query.setParameter(params.get(i), value.get(i));
        }
        // System.out.println();
        // System.out.println();        
        return maxResults == 0 ? query.getResultList() : query.setMaxResults(maxResults).getResultList();
        // return null;
    }

    @Override
    public int updateHQLQuery(String queryId) {
        String hql = hqlQuery.findValue(queryId);
        // System.out.println(hql);
        Query query = em.createQuery(hql);
        int updateCount = query.executeUpdate();
        em.flush();
        return updateCount;
    }

    @Override
    public int updateHQLQuery(String queryId, List value) {
        String hql = hqlQuery.findValue(queryId);
        Pattern pattern = Pattern.compile("(:\w+)");
        Matcher matcher = pattern.matcher(hql);
        List params = new ArrayList<>();
        while (matcher.find()) {
            params.add(matcher.group().replace(":", ""));
        }
        // System.out.print(hql);
        Query query = em.createQuery(hql);
        for (int i = 0; i < params.size(); i++) {
            query.setParameter(params.get(i), value.get(i));
        }
        int updateCount = query.executeUpdate();
        em.flush();
        return updateCount;
    }

    @Override
    public void remove(T entity) {
        em.remove(em.contains(entity) ? entity : em.merge(entity));
        em.flush();
    }

website design – Secondary comments on the news feed

This is a content strategy issue.

The question is: what is this content?

The comments on many media sites are horrible. Generally argumentative, factually suspicious, poorly written and, for the most part, damaging the actual content of the page rather than improving it.

In many cases, the comments are not there to improve the content in any way. They are just there to generate clicks. They want people to come back to post their next argument in order to increase the number of page views.

As such, in this situation, it probably makes sense to bury the comments below … and that is probably why most of the sites do this.

On the other hand, if you have great content and attract great commenters who post great reviews, go for it! Highlight them by placing them at the same level as the content of the page.