backup – Where are Firefox bookmark and history files stored?

And what are the names? I want to copy each in the event of device failure.

Sync is apparently not an option as the Sync “application” has returned “‘Cannot connect to network” for several weeks, and the web page to create an account just has a swirl that never loads anything else.

I’m not sold on sharing data with mozilla anyway, tho if anyone knows how to do that, also, …

All the tutorials I’ve found online are about desktop. I tried applying solutions there to android, like searching for ‘places.sqlite’, but no dice.

I’m running OS 5.1.1, unrooted. I’ve got two 3rd-party file managers, and of course Firefox lets one browse root directories (file:///…).

Thanks.

C++ STL: How does the distance() method work for a set/ multiset (stored internally as a self balancing tree)?

The complexity of the distance function depends on the type of the iterators supplied: in general it only required to take linear time in the distance but, in the special case in which the input iterators are random access iterators, the worst-case running time is linear. (I believe this is accounting for the time spent in the function in itself, and assumes that the time needed to advance iterators is constant).

The C++ specification do not mandate any particular implementation as long as it conforms to the required complexity so your question cannot be answered without inspecting the particular implementation that you are using.
However, just to convey the intuition, here are two possible implementations that would conform to the requirements:

  • Given random access iterators $x$ and $y$, distance($x$, $y$) returns $y-x$.
  • For general iterators increment $x$ until it equals $y$. Return the number of increments performed.

The type std::set does not return a random access iterator, therefore std::distance can take linear time and the second implementation above can be used. Now your question reduces to “how can the standard library iterate over the elements of a std::set in sorted order?”

The answer to this question depends once again on the implementation as there is no particular data structure mandated by the standard to implement std::set.
Since you mention red-black trees, which are a special kind of BSTs, this can easily be done by noticing that the order of iteration coincides with the order in which the vertices of a BST are visited by an in-order visit.

Notice that the concept of distance completely abstracts from the data structure used to store the elements of the set. Instead it only refer to the positions in which two elements appear when using an iterator to access the collection’s contents (in the case of std::set, the elements appear in sorted order).

applications – where are MyPhoneExplorer SyncJobs stored?

I like to know where exactly the FileSync jobs are stored in a MyPhoneExplorer phone profile? (in what file, and which location (profile folder or AppData folder))?

I like to emigrate to a new phone and I have a lot of customized FileSync folders configured, all the folders have the same path on my new phone and I want the same folders and options as in the old phone. How can I easily import them into a new profile I created for my new phone? Without creating them all over again (would spare me a lot of work).

I searched all the config files in my old phone profile folder and hoped they were stored in “FileSync.dat”, I copied that file to the new profile and restarted MyPhoneExplorer, but it did not seem to work, still no SyncJobs in the SyncFiles menu…

Thanks a lot in advance.

database – How is data stored prior to downloading?

I go to several sites that offer their data in XML, JSON, CSV formats. As shown here,
https://www.space.org/basicspacedata/query/class/boxscore/format/csv, I choose the format. Question is how is the data stored on whatever database they use? Certainly they don’t store the same data in different formats? Are the formats ‘wrapped’ when downloading, and ‘stripped’ while uploading?

bitcoin core – How Do I Fix This Error Without Loosing Stored Blocks On Pc?

Hello Bitcoin Enthusiasts

I opened my Bitcoin Core program today on my windows 7 pc via external hard disk (1 TB) and i found the following error:

MinGW Runtime Assertion
Assertion Failed!

Program: E:Blockchainbitcoin-qt.ex
File: chain.cpp, line 103

Expression: pindexWalk-> pprev

DEBUG LOG: pastebin.com/YNEuRAcv

Please how do i fix this error without loosing the blocks on my external hard disk which i have synchronized for months?

Looking forward to your answer. Thank you in advance

sql server – Pass a table name as a parameter to a stored procedure

Unfortunately, you can’t use a variable containing the table name in an INSERT statement. The error message is actually occurring because it is expecting a variable that is a table type to insert rows into, but you’re passing a variable with a string value.

You can use Dynamic SQL to execute the command using a variable table name value like this:

CREATE PROCEDURE (usp_SaveToErrorLog)
    @tblName as nvarchar(50),
    @subject as nvarchar(30)
AS
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    DECLARE @Sql NVARCHAR(MAX)

    -- Insert statements for procedure here
    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(@tblName))
        Begin
            SET @Sql = 'Insert Into ' + @tblName + '
            (ErrorNumber, ErrorMessage, ErrorProcedure, ErrorState, ErrorSeverity, ErrorLine)
            Select
                ERROR_NUMBER(), ERROR_MESSAGE(), ERROR_PROCEDURE(), ERROR_STATE(), ERROR_SEVERITY(), ERROR_LINE()'

            EXEC sp_executesql @Sql
        End
END

What this does is dynamically create your T-SQL command and store it in the @Sql variable. The stored procedure sp_executesql is then used to execute the T-SQL commands in the @Sql variable, which has the actual table name from the @tblName variable.

sql server – LLENADO DE UNA TABLA DINAMICA EN ASP.NET C# APARTIR DE UN STORED PROCEDURE

TENGO UN PROBLEMA, NECESITO LLENAR UNA TABLA QUE SEA DINÁMICA (EL NUMERO DE COLUMNAS, DATOS, Y NOMBRES PUEDEN IR CAMBIANDO) APARTIR DE UN SP QUE ME GENERA UNA CONSULTA DE VARIAS TABLAS, SE QUE POR EJEMPLO SE PUEDE HACER CON UN KENDO PERO QUERÍA SABER SI ES POSIBLE REALIZAR CON ALGÚN OTRO MÉTODO

sql server 2016 – How to optimize full-text search stored procedure

Our beta database (same server) data is 1 month behind live. However we did not much changes.

What’s wrong is query time of stored procedure. Beta has no issue and return results in 2 sec top. Live query takes about 2 minutes.

So I decided to go full-text instead LIKE operator. Now it takes even more. I had to rebuild catalogs. First result was empty.

Procedure:

ALTER PROCEDURE (dbo).(GetShortSearch)
     @keyword nvarchar(32),
     @skip int,
     @take int
      AS
      BEGIN
 SELECT DISTINCT p.Id, p.BruttoPrice as 'Price', p.Name, s.FriendlyUrl as Link, i.ThumbnailPath as 'Image', i.AlternativeName as 'ImageAlt'
 FROM Products p INNER JOIN SEO s ON s.ProductId = p.Id LEFT JOIN ProductAttributes pa ON pa.ProductId = p.Id LEFT JOIN Manufacturer m ON m.Id = p.ManufacturerId LEFT JOIN ProductTags pt ON pt.ProductId = p.Id LEFT JOIN Tags t ON t.Id = pt.TagId LEFT JOIN ProductFeatures pf ON pf.ProductId = p.Id LEFT JOIN Features f ON f.Id = pf.FeatureId LEFT JOIN FeaturesPredefinedValues fpv ON fpv.Id = pf.FeatureValueId LEFT JOIN ImageFiles i ON i.Id = (SELECT TOP 1 pim.ImageId FROM ProductImages pim WHERE pim.ProductId = p.Id ORDER BY pim.DisplayOrder, pim.ImageId)

WHERE p.Enabled = 1 AND ((p.ManufacturerId IS NOT NULL AND m.Name = @keyword) OR CONTAINS(p.Name, @keyword) OR p.SellCode = @keyword OR p.StoreCode = @keyword OR CONTAINS(p.ShortDescription, @keyword) OR CONTAINS(fpv.Value, @keyword) OR CONTAINS(pf.Value, @keyword) OR t.Name = @keyword)
ORDER BY Id OFFSET @skip ROWS FETCH NEXT @take ROWS ONLY;
END

Calling via

GetShortSearch N'item', 0, 10;

Products items in database: 45 000+-

Product Features: 140 000+-

Product tags: 400+-

Manufacturers: 350+-

Features predefined values: 32

I dont exactly know how live db can be slower with same query and 99% same data. Database structure is generated by EF Core 3.1.

Almost forgot to mention that I dropped last night original db and reimported all data back in. No change :/

java – user password is stored securely or not? is there any other major issue with this code?

I am developing a social networking website to share pictures with family and friends. People need to register to this website in order to share their pictures.

The front end has already been developed using the Model-view-controller (MVC) architectural pattern. I need someone to review it before I can push it.

The class implements a registration functionality in the web application: a user with the following attributes (email, name, gender, birth date, username and password) is stored in the database.

package controller;

import java.util.*;
import javax.faces.bean.ManagedBean;
import org.postgresql.util.Base64;
import java.nio.charset.StandardCharsets;
import javax.faces.application.FacesMessage;
import model.Appuser; 
import dao.UserDAO; 

/**
 * This class implements the controller of a web application in the standard
 * Model-View-Controller (MVC) pattern. The controller takes the input,
 * processes it and hands it over to the database.
 **/

@ManagedBean(name = "appController", eager = true)
public class AppController {
    private Date birthdate;
    private String email;   
    private String firstname;
    private String gender;
    private String password;
    private String surname;
    private String username;

    public Date getBirthdate() {
        return birthdate;
    }

    public void setBirthdate(Date birthdate) {
        try {
            this.birthdate = birthdate;
        } catch (Exception e) {

        }
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email, boolean verified) {
        if (verified = true) {
            this.email = email;
        }
    }
    
    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }
    
    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSurname() {
        return surname;
    }

    public void setSurname(String surname) {
        this.surname = surname;
    }
    
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * Save user with its properties into the database
     */
    public void saveUser() {
        Appuser user = new Appuser();
        user.setSurname(this.surname);
        user.setFirstname(this.firstname);
        user.setBirthdate(this.birthdate);
        user.setGender(this.gender);
        user.setUsername(this.username);
        user.setPassword(FetchEncodedString(this.password));
        user.setEmail(this.email,true);

        UserDAO dao = new UserDAO();
        try {
            dao.save(user); 
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * @param inptString
     *            get encodedstring using inpString
     */
    private String FetchEncodedString(String inpString) {
        String encStr = Base64.encodeBytes(inpString.getBytes(StandardCharsets.UTF_8));
        return encStr;
    }

}

UserDAO.java

package dao;
import org.hibernate.Query;
import org.hibernate.Session;

import model.Appuser; 
import util.*;

public class UserDAO {
    
    Session session = HibernateUtil.getSessionFactory().openSession();

    public void save(Appuser user) {
        session.getTransaction().begin();
        session.save(user);
        session.getTransaction().commit();
    }
}

Appuser.java

package model;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import org.hibernate.validator.constraints.NotBlank;

@Entity
@Table(name="APPUSER")
public class Appuser {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Size(min=3, max=50)
    @Column(name = "FIRSTNAME", nullable = false)
    private String firstname;
    
    @Size(min=3, max=50)
    @Column(name = "SURNAME", nullable = false)
    private String surname;

    @NotNull
    @Column(name = "BIRTHDATE", nullable = false)
    private Date birthdate; 
    
    @NotBlank
    @Column(name = "EMAIL", nullable = false, unique = true)
    private String email;
    
    @Size(min=1, max=10)
    @Column(name = "GENDER", nullable = false)
    private String gender;
    
    @Size(min=5, max=20)
    @Column(name = "USERNAME", nullable = false, unique = true)
    private String username;
    
    @NotBlank
    @Column(name = "PASSWORD", nullable = false)
    private String password;


    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getSurname() {
        return surname;
    }

    public void setSurname(String surname) {
        this.surname = surname;
    }

    public Date getBirthdate() {
        return birthdate;
    }

    public void setBirthdate(Date birthdate) {
        this.birthdate = birthdate;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }   
}

How to show thumbnails of images stored on Google Drive on Google Sheets?

I have a Google spreadsheet that contains hyperlinks to files stored on my Google Drive using a HYPERLINK formula.

Opening the spreadsheet and hovering the cursor over the link, I can see a thumbnail preview and that’s pretty neat (if you feel lucky, try yourself on this example sheet)!

thumbnail preview

However, this doesn’t happen for my collaborators, and indeed if I open the same spreadsheet with another account with similar access rights (on the spreadsheet and on the image) I don’t see any thumbnail preview.

You can try the example I took the screenshot of here. Is this feature currently available on selected accounts only, or am I missing something?