c ++ – Non-recursive version of Trie's deletion

Therefore, I was looking for the non-recursive version of the removal of Trie data structures on the Internet. I could not find one. The best I could find was a recursive implementation of trie on this website. Looking at the code for some time, I thought I could do the recursive version of the deletion to a non-recursive one. Here is my opinion about him. Remember, I'm worried if I've done an effective memory cleanup. Any information about the general structure of the code will also be useful. Thank you.

#include
using namespace std;
struct node {
bool isWord = false;
node * previous;
node * children[27];
};

empty insertion (node ​​* and root, string key) {
node * temp = root;
temp-> previous = NULL;
int keyLen = key.length ();
for (int i = 0; iisWord = true;
temp-> children[index] = NULL;
}
// If there is no node in a given index
if (! temp-> children[index]) {
// form a new node
temp-> children[index] = new node;
// Take note of the node from which it comes
(temp-> children[index]) -> previous = temp;
}
// Go through the children node
temp = temp-> children[index];
}
}


bool search (node ​​* & root, string key) {
node * temp = root;
int keyLen = key.length ();
for (int i = 0; iisWord == true)
{
true returns
}

// If a character does not exist
// on the way
if (! temp-> children[index]) {
false return;
}
temp = temp-> children[index];
}
// If the chain is longer than expected
false return;
}
bool hasNoChildren (node ​​* root) {
for (int i = 0; i<27; ++i){
        //If the root has at least one child
        //then return false
        if(root->children[i]) false return;
}
// if not, returns true
true returns
}
void remove (node ​​* and root, string key) {
if (! search (root, key)) return;
node * temp = root;
int keyLen = key.length ();
for (int i = 0; iisWord = false;
}
temp = temp-> children[index];
}

/ * The temperature of the pointer in the previous loop for
He manages to get to the end of the chain.
Since then, the previous pointer is being tracked.
It is easy to retract, if required. * /
for (int i = keyLen-1; i> = 0; --i) {

/ * If the variable temp isWord is false
and it happens that he has no children
then it is being eliminated. Not this elimination
happens in the fashion from the bottom up, that
Allows the effective removal of memory.
if (temp-> isWord == false && hasNoChildren (temp)) {
node * p = temp;
temp = temp-> previous;
delete p;
}
else temp = temp-> previous;
}
}


int main () {
node * a = new node;
chain keys[] = {"the", "a", "there",
"answer", "any", "by",
"goodbye", "your", "hero", "heroplane"};
for (int i = 0; i <10; i ++)
insert (a, keys[i]);
search (a, "the")? cout << "Yes  n": cout << "No  n";
search (a, "these")? cout << "Yes  n": cout << "No  n";
eliminate (a, "heroplane");
search (a, "hero")? cout << "Yes  n": cout << "No  n";
returns 0;
}

Deletion of duplicate audio files with different UTC time stamps in the file names, using PowerShell 5

I have a disc with many thousands of sound effects. The files have been stored on different operating systems and NAS devices over time and now there are duplicates of many files, but the names of the files contain different UTC timestamps. For example:

1-14 Busted bowling alley (2016_06_28 02_14_41 UTC) .aif

1-14 Bowling full of people (2016_02_18 05_56_59 UTC) .aif

I would like to delete the duplicate files. There are also unwanted files from the audio software and the indexing of the operating system that I would like to remove. When using a subset copied data, I tried the following PowerShell script in PS version 5.1, it seems to give me what I'm looking for:

# Remove the remaining files from the audio editors
Get-ChildItem -Name -Recurse -Filter "* .clip *" | Remove the article
Get-ChildItem -Name -Recurse -Filter "* .ptf" | Remove the article
Get-ChildItem -Name -Recurse -Filter "* .wfm" | Remove the article
Get-ChildItem -Name -Recurse -Filter "* .repeaks" | Remove the article

# Delete old indexing files
Get-ChildItem -Name -Recurse -Filter "* .DS_STORE" | Remove the article
Get-ChildItem -Name -Recurse -Filter "._. *" | Remove the article
Get-ChildItem -Name -Recurse -Filter "Thumbs * .db" | Remove the article
Get-ChildItem -Name -Recurse -Filter "* .ini" | Remove the article

# Remove UTC stamp of all files (will fail in duplicates)
Get-ChildItem -Recurse -Filter "* (?????????? ???????? UTC). *" | Rename-element-new name {$ _. Basename.substring (0, $ _. Basename.length-26) + $ _. Extension}

# Delete files that still have the UTC stamp (they were the duplicates)
Get-ChildItem -Name -Recurse -Filter "* (?????????????????? UTC). *" | Remove the article

However, I would love to get a critique of the script and learn some things. In particular, it seems a bit hacked using an expected failed command as part of the workflow. It also seemed sensible to get notes before executing it in the whole set of files.

Does Facebook automatically maintain a backup of the pages after the deletion?

To recover a page, here are instructions on how to do it: https://www.wikihow.com/Reclaim-Admin-Rights-to-a-Facebook-Page

The rogue administrator can eliminate the whole affair as a reprisal.

Do you know if Facebook maintains automatic backups?

Asking what my options are and evaluating various game plan scenarios.

(Do not hesitate to contact me directly if you know how to help)

Appealing a Google search deletion "modified content" denied

Using the Google Search Console "Removed Outdated Content":
https://www.google.com/webmasters/tools/removals

I requested the deletion or re-indexing of my profile pages in two third-party sites, from which I had just deleted my real name, which were rejected (the purpose of the request was such that they would not return in the search results for me or contains my name deleted in fragments or url).

When searching my name: "John Doe" in google.com, for site1 (the request was made twice, the second was more explanatory but still was denied):

site1 (public profile address unchanged): site1.com/people/username1
site1 (title of previous page): John Doe on site 1
site1 (title of the current page): J D on site 1
site1 (words on the deleted page): "John Doe" (now appears as "J D" on the site)

For site2, the words "John Doe" do not appear on the page, but in the url (request also denied):

site2 (old address): site2.com/profiles/john-doe.html
site2 (current address): site2.com/profiles/user-name-other.html
site2 (title of the page without changes): User's name Page of others

However, for this second site, enter any non-existing user name into a general directory instead of a 404 or other type of error, for example, by going to:

site2.com/profiles/non-existent-username-url.html (o)
site2.com/profiles/john-doe.html

Forward to

site2.com/directory.html

In my last attempt, these two removal / reindexing requests were rejected, so the search for my name (for example, "John Doe") will still return both in the search results, apparently without reindexing:

site 1 still contains John Doe in its title in the passage, although it has now been changed to the initials J D in the title, and

The fragment of site 2 still contains my name as part of the url ("john-doe.html"), although it has also been changed, and for any non-existent username that is sent to the directory (instead of my profile) as mentioned (Therefore, from Google's perspective, the page still "exists" and does not return an error).

Design – Action sheets and then the confirmation problem of deletion of the alert box (iOS)

This is related to the problem of user experience in iOS, iPhone.

The user arrives at the first screen, which is the action sheet with one more button on a previous page. There is only one option that is to delete the message.

When the user touches the delete message button, the user will ask for a deletion confirmation alert box.

These 2 seem to be redundant, how to solve this problem while still having confirmation of elimination?
The plus button should remain. Thank you!

enter the description of the image here

enter the description of the image here

Algorithms: identify the addition or deletion of rows or columns in a table

I'm looking for a solution that can identify any addition or deletion of a row or column in a table of numbers.

In what I have thought so far when using the LCS algorithm, that is, the algorithm of "common subsequence longer", I can find the common subsequence between two versions of a table, but this method is not 100% correct.

For example

Table version 1

    1 2 4 5 9 3
4 9 3 7 5 3
8 2 7 9 3 8
9 7 2 8 2 4

After the update, I delete 1 row (2nd row) and add 1 row (in the same place, that is, 2nd).

Table version 2

    1 2 4 5 9 3
4 9 5 7 5 3
8 2 7 9 3 8
9 7 2 8 2 4

The row added is almost similar except for 1 cell element. In this case, LCS would not work, since most of the cell elements would be similar and I can not identify the row that was deleted first and a new row was added.

Database – What is the name of the database design pattern that supports only smooth deletion and smooth updating?

I heard that there are some DB designs in the relational database where updating a record will create a new record with different timestamp or status. In addition, the deletion will be automatically deleted (the status or the effective date will be updated). It does not actually erase the registry. I would like to know if there is a name for these design patterns. In what scenario we need to use such patterns.

google drive – How can I save my old WhatsApp chat messages from automatic deletion when the export does not go back to the past?

So, I just moved backwards in a couple of chats and discovered that the oldest message available was in the middle of the conversation. Everything before that is gone. It seems that WhatsApp has been silently erasing old messages. This worries me a lot because the oldest period of messages available at this time is related to the last months of my deceased mother. A bunch of very important The messages that belong to that period are gone!

Automatic backups have been activated in Google Drive, but I just found that Google Drive does not allow me to download them on my own. The only options it offers are to disable the updates or delete the backup. It really bothers me that Google gives WhatsApp more privileges to access my data than me.

I tried the WhatsApp export chat function, but it does not export everything. In my most important chat, I can move to September 2017, but the exported file has only been updated for a week.

I tried the local backup, the WhatsApp directory in the internal storage, but everything is encrypted! What is it encrypted for, I wonder? So the user can not use it outside of WhatsApp! HURRAH! I'm about to turn my desk screwed!

It seems that the only option available to me is to make a screenshot of everything manually from last year, but I hope that someone here can give me a better idea to get the text without formatting. I do not forget complex solutions, and although I am not an Android developer, I am a programmer with a lot of experience with Linux.

javascript: the deletion of the button class is not processed immediately

I have a Vue application that shows a button on the screen. I am using Bulma for css. When the page loads, the button is solid red with white letters as it should be, because there is no class "is delineated". When I click on the button, I should add the class "is delineated" which then processes the button as red text and border on a white background. This is what is happening when I click on the button:

  1. The data on the screen disappears because I do not want to show them (this means that the click event is doing what it should do, and the rest of the page is working).
  2. In the inspector in Chrome, I see the sketched class added to the css button immediately, as expected.
  3. The button does not change to an outlined style.

BUT, as soon as I click on something else to focus outside the button, the CSS is "rendered" and an outlined button appears. No matter what you do (click on the screen, click on a different window or on my desktop) as soon as you do something else, the button changes color according to the class you just added.

If I click on the button again, the class is deleted and the button is immediately updated to the white text in red backgrornd. (It is not necessary to click outside the button.)

So, what is the difference in representation when I'm adding a class (without immediate results) and when I'm deleting a class (an immediate response)?

This is the code of the button:

``

Here are my data ()

data () {
he came back {
people: [],
working: false,
ServerError: false,
showModal: false,
showIgnored: false,
showLinked: false,
showUnLinked: true,
current: null,
}
}

Here is my toggleUnlinked method linked to the click event:

toggleUnLinked () {
this.showUnLinked =! this.showUnLinked;
}

Any help would be greatly appreciated.