c ++: matrix indexing with copy constructor and assignment operator

I modified the code as such to include an explicit default constructor and a copy constructor, I also included the std :: out_of_range exception but I'm not sure if the latter is implemented correctly.
The following code is customized
This was done as an exercise to handle matrices without using the STL vector container.
An exchange member function and an assignment operator were added, but some error messages were obtained.

class "Array" has no "swap" member
the member "Array :: size" (declared on line 12) is inaccessible
& # 39; operator = & # 39; must be a member function
& # 39; this & # 39; It can only be used within a non-static member function

// Overloading operators for Array class

using namespace std;

// A class to represent an integer array
class Array{
    int *ptr;
    int size;
    Array(int *, int);
    Array(const Array&);
    Array& operator= (Array);

    // Overloading () operator to access elements in array style
    int &operator() (int);

    // Utility function to print contents
    void print() const;

    friend void swap(Array& first, Array& second);};

// Implementation of () operator.  This function must return a
// reference as array element can be put on left side
int &Array::operator()(int index){
    // try {
    //     return ptr(index);}
    // catch(const out_of_range& oor){
    //         cerr << "Out of Range error: " << oor.what() << 'n';}    
    if (index >= size || index < 0){
       throw out_of_range("Index out of Range error");
    return ptr(index);

// constructor for array class
Array::Array(int *p = NULL, int s = 0){
    size = s;
    ptr = NULL;
    if (s != 0){
        ptr = new int(s);
        for (int i = 0; i < s; i++)
            ptr(i) = p(i);}

// destructor for array class
    delete() ptr;
    ptr = NULL;}

// copy constructor for array class
Array::Array(const Array& A) { 
    size = A.size;
    ptr  = new int(size);
    for (int i = 0; i < size; i++)
        ptr(i) = A.ptr(i);}

void Array::swap(Array& first, Array& second){
    using std::swap;
    swap(first.size, second.size);
    swap(first.ptr, second.ptr);}

//Assignment operator for array class
Array::Array& operator=(Array other){
    swap(*this, other); 
    return *this;}

//print function for array elements
void Array::print() const{
    cout << "{";
    for(int i = 0; i < size; i++)

Duplicates – Allow users to copy publications from the front end

I want to create a publication grid (a CPT) that will be accessed by a user connected from the front of the website.

The user can select which publications he wants and click on send, which would make a copy of the selected publications with the user as author.

I know this can be done from the administration area, but I don't know how to do it from the front.

Any suggestions on a course of action would be appreciated.

How to copy the entire contents of a Time Machine backup drive to a new one?

I have a Time Machine backup unit (also used for other archiving purposes) It has a damaged file system. I can mount it "Read only", but fsck_hfs It will not repair it. * (Apparently it's just a problem with the "extended attributes", but this is enough).

I have requested a replacement unit, and now I need to know what is the best way to reliably copy all the information from the previous unit to the new one, properly conserving the permissions and everything Time Machine (in particular) requires. Is there, for example, a Time Machine function to "move the backup to a new drive?"

(OS / X Catalina 10.15.3, current.)

How to copy daily selected data from MySQL and PostgreSQL servers to another PostgreSQL server

I have two source servers, a MySQL 5.7 and a PostgreSQL 9.6, respectively. I would like to daily update some tables from each source to another destination PostgreSQL 11 server (through a cron job).

On the destination server I also have some views that involve migration tables that should be updated regularly accordingly.

I used pgloader for the initial migration of MySQL data -> PostgreSQL and pg_dump for the initial migration of data PostgreSQL-> PostgreSQL. However, due to the views mentioned above, the pg_dump command (see below) refuses to alter the tables due to dependencies. The specific pg_dump command was

sudo pg_dump -x --no-privileges --no-owner --dbname=postgresql://:@/-t 'table_1' -t 'table_2' -c | psql --dbname=postgresql://:@/

How could I run the data update without encountering dependency issues? Also, is there a unified way to achieve the previous updates for MySQL -> PostgreSQL and PostgreSQL -> PostgreSQL? Ideally, I would like to avoid having the views defined as part of the update process. I am running on Ubuntu-18.04-bionic.

google sheets: how to use the SORT function on existing data and not make a copy

I am following this tutorial to sort data using a drop-down menu and a check box. My only problem is that I want to use this method in the original data set and not make a copy. I really wish there was only one table, instead of two. Is there any way to do this?

formulas – Google spreadsheets: how to use the SORT function on existing data and not make a copy

I am following this tutorial to sort data using a drop-down menu and a check box. My only problem is that I want to use this method in the original data set and not make a copy. I really wish there was only one table, instead of two. Is there any way to do this? Thank you.

adb: copy encrypted internal storage to PC (in twrp mode)

I have this situation in which I encrypted my internal storage and then, by using twrp, I formatted only my data partition (dumb right) now when I'm starting in twrp it doesn't ask me for password to decrypt data, but I can see my internal storage encrypted in the file manager

I tried to copy encrypted content to my PC (hoping I could decipher it because I know the password it was encrypted for) but I couldn't do it.

what I tried is

  1. using adb pull it gives me an error remote open failed: Required key not available
  2. using MTP is also giving me error
  3. twrp decrypt fails

Can I recover my data in some way (be the password)

Why did Nancy Pelosi break a copy of Trump's SOTU address in front of the media? Didn't you realize that made her look very immature?

No, it had the desired effect. It drove Don crazy to be so disrespected on national television. I would say she hit the nail in the head. I mean, honestly, it's days later, and you're still grabbing your pearls in histrionics. Honestly, most people in the room probably threw the speech later that day. It makes no sense, except she did it to succeed, and IT WORKED!

How to copy templates from standard folders to a specific folder through the Windows context menu?

I work with a predefined folder system / structure for each type of activity / project I develop. How to program the Windows context menu to execute the creation of a new folder by copying a template located in a specific location on the hard drive?
An additional interesting element that I would also like to know how to run it is: how to complement this action to create a shortcut to the copied folder in a specific location on the hard drive?

Migration: Copy content from a D7 site to a D8 site on a regular basis (or with each change)

I have a D7 site and I am updating this site (D8) on the same server.

Few words about the context … you can skip:

  • Since it is a complete rewrite, a complete migration is not possible.

  • The content is huge, but the main part is in the back office developed on the D7 site (it will be rewritten).

  • Site D7 will be used until the end of D8.

  • The D8 site will be used as a normal public site (without back office) but must be populated by the content (nodes) encoded in the D7 site.

My question:

What will be my best option to continuously update D8 when D7 adds / updates / deletes a node? As I said, both are on the same server …

Note: D8 can be updated when a D7 node is sent or can be done every day with a cron job