News

BASH Script to find the latest files and delete them

I have database backup files and I would like to create bash-script that returns different names from the most recent files in the current directory. For example:

/ home / user / toto /
a_1.0
a_1.1
b_1.0
b_1.1
c_1.0
c_1.1

I want the script output to look like this:

/ home / user / toto /
a_1.1
b_1.1
c_1.1

I read a reference from here and I was able to get the above result with this sample command:

#! / bin / bash
find . -name "a_ *" -print0 | xargs -r -0 ls -t | head -1
find . -name "b_ *" -print0 | xargs -r -0 ls -t | head -1
find . -name "c_ *" -print0 | xargs -r -0 ls -t | head -1

I just changed the name template to the name of the different backup file, but how to delete all the files except for the file printed in the result above?

Google Cloud has been on maintenance for at least a day. No way to make it work or extract data

We still have another critical problem with Google Cloud SQL (MySQL Gen 2).
The server went into maintenance for almost a day and remains unusable. Our production and development databases are both blocked. We can not restart the instance, we can not download backups or export.
In essence, all controls are blocked for this server.
We clicked Help -> Send a comment twice with a screenshot and no feedback was given.

We can not afford to buy another $ 150 a month, or $ 1,800 a year, so our start-up company pays for a possible "disaster of the year"!

Hey, Google, I can not believe you do not see how this server is crying with pain, shock and disbelief, shaking and covered with a thick layer of dirty error logs!

autofocus – Why do high-end cameras always include normal AF sensors (non-crossed type)?

Modern cameras often use two types of AF sensors: normal and crossover. While normal-type AF sensors struggle to focus on high-contrast vertical lines, cross-sensors, though more sophisticated (and more costly as a result), facilitate focusing in this situation.

Due to the added cost of including a large number of cross-sensors, cheap cameras often include a single sensor in the center of autofocus, with mid-range cameras often having a group around the point central and high-end cameras even having more cross-type sensors in various configurations.

If you look in detail at some of the most sophisticated cameras, even in a space where prices are in the four digits, there is still a good amount of normal-type AF sensors:

  • The Nikon D5 and D850 both have about 150 sensors, 99 of which are cross-shaped.

  • The EOS 1DX mk II, Canon's flagship product, as well as their 5D mk IV possess 61 sensors with 41 types of crosses

Given that even in these flagship and high-end super-expensive models, about 1/3 of the AF sensors are still of the normal type, I would like to know; Is it about a purely economical design choice or does the packaging of too many cross-type AF sensors create exponentially difficult technical obstacles?

Probability – How to understand if an exercise is Poison-Bernouli or e-What are the differences

I have three different exercises and I am confused. If it's Poison or Bernuli or if I've seen them and I know them and I'm reading but I'm not so skilled at getting it. I mean I can not detect the exercise of what it is. Can you share my tip to help me get it? I've used Bernouli in cases where he needs poison and opossite.If you can help me do not solve it but explain to me why is Bernouli where you understand, I will be grateful.
first exercise

There is a market race to sell their cornflakes. A company calls
random numbers in order to promote their cornflakes to
customers.We are sure that this company already has 20% of all
What is the possibility that a telephone interlocutor (means that the work
in this company) who calls customers who need more than 3 calls up to
she will succeed someone who is not a customer? My answer: I do not know
which typology to use

second exercise

An Internet service company 4 servers, and both are
"hosting" of the database and the other 2 our software.
possibility that we have damage on a server next year is 1% .We
take for granted that the possibility of appearing harm in all
the server is independently each.If the Internet company are working
there must be at least 1 server that will have the database and a
server that will make the software. What is the posibility of society
Will he work normally and next year?

plugin development – The form using admin-post.php gives 404 after submission

I create a custom form for a wordpress page and I use admin-post.php as action.
However, whenever I try to submit the form, I receive a 404.

Below is the code that displays the form:

function output_email_verification () {
$ error = & # 39;
if (isset ($ _ COOKIE['rguroo_form_error'])) {
$ error = $ _COOKIE['rguroo_form_error'];
undefined ($ _ COOKIE['rguroo_form_error'])
}
come back again

& # 39 ;. $ error. & # 39;

Purchase 12 months of access Renew account Create a trial account

* indicates a required field

Email address*

Retype the Email Address *

& # 39 ;; }

It's the action I've hung on admin-post.php

add_action (& # 39; admin_post_nopriv_email_verification_form & # 39 ;, verify_and_sanitize_email_form & # 39 ;, priority = 10, $ supported_args = 1);
add_action (& # 39; admin_post_email_verification_form & # 39 ;, verify_and_sanitize_email_form & # 39 ;, $ priority = 10, $ supported_args = 1);

// email verification reminder
verify_and_sanitize_email_form () {function
if (empty ($ _ POST) ||! isset ($ _ POST['rguroo_email']) || ! isset ($ _ POST['rguroo_email_confirmation']) || ! isset ($ _ POST['rguroo_desired_action'])) {
send_form_error ('There is one or more empty fields');
return;
}
$ sanitized_email = sanitize_email (esc_html ($ _ POST['rguroo_email'] ));
$ sanitized_email_confirmation = sanitize_email (esc_html ($ _ POST['rguroo_email_confirmation'] ));
$ desired_action = esc_html ($ _ POST['rguroo_desired_action'])

if (! is_email ($ sanitized_email) ||! is_email ($ sanitized_email_confirmation)) {
send_form_error (& # 39; Email is not valid & # 39;);
return;
}

if ($ sanitized_email! == $ sanitized_email_confirmation) {
send_form_error ('Emails do not match');
return;
}

if ($ desired_action! == & # 39; || $ desired_action! == & # 39;) renewal || $ desired_action! == & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
send_form_error (& # 39; Fatal error with radio buttons & # 39;);
return;
}

if (! isset ($ _ COOKIE['rguroo_form_type'])) {
send_form_error (& # 39; server error & # 39;);
return;
}

// check logic of student emails
$ form_type = $ _COOKIE['rguroo_form_type'];
if ($ form_type === & # 39;) student
$ trail = substr ($ sanitized_email, -4);
if ($ trail! == & # 39; .edu & # 39;) {
send_form_error (& # 39; Unsolicited Student Email & # 39;);
return;
}
// Other logic specific to the university here
}
setcookie (& rguroo_form_action & # 39 ;, desired $ 14 * DAY_IN_SECONDS);
setcookie (& rguroo_form_email & nbsp; $ sanitized_email, 14 * DAY_IN_SECONDS);

}

// Assistant. Used to generate an error
function send_form_error ($ msg) {
setcookie (& rguroo_form_error & # 39 ;, msg, 14 * DAY_IN_SECONDS);
}

Sorry for the mess of error validation.
After selecting something in the radio button and writing "test" and "test" for both input fields, I get the following URL:

https://rguroo.com/wp-admin/admin-post.phpmethod=%22post?rguroo_desired_action=purchase&rguroo_email=test&rguroo_email_confirmation=test&action=rguroo_email_verification_form

Ideas?

development – Fragmentation Android: what is the role of the designer?

I'm working on a study to understand Android designer-developer collaboration and specifically to find out if and how designers and developers work together to solve Android fragmentation problems (for example, when fragmentation issues are raised and how these problems are communicated between the designers). and developers).

But before I get into my questions, I want to first validate the hypothesis that designers are actively involved in the process of dealing with fragmentation issues with developers. Is it true?

  • Do designers even care about fragmentation?

  • Do the developers think that it is necessary to involve the designers?

  • Would the developer's involvement help reduce the workload for developers and improve the user experience of their application?

This may be different for teams and products, so I want to open a discussion and see how everyone practices in their work.

Thank you very much for your contribution!

Web crawlers – If all web pages are interchangeably linked by taxonomy (categories), do I still need a site map for SEO?

I have a mediaWiki website with about 350 web pages.

If all web pages, without exception, are interchangeably linked by taxonomy (categories)and, in addition, there are also other indicators for web pages, such as a "page of all web pages" or a "recent changes page",
do i still need a sitemap for SEO?

A problem can occur if I forget to add a category to a page.

hotels – Fairmont Banff Springs vs Fairmont Chateau Lake Louise

I plan to travel in the Canadian Rockies this summer. I called the hotels, but their responses were too official and diplomatic.

  1. Courtney Brown writes that they are separated by "forty minutes drive northwest of Banff". Why did Fairmont build two hotels so close? I know that Lake Louise ("LL") overlooks the lake of the same name.

  2. What are their differences?

Enjoy Banff says that for Banff Springs

The inconvenients: Although the rooms can be quite small, the property is huge.

and for LL

The inconvenients: The location is slightly distant and there is not much "town" in Lake Louise compared to Banff. Once you are there, there is not much to do, except for the beautiful scenery nearby

joan1 says

I would choose the Banff Springs, the service is better

Jasper2009 says

  • the standard rooms at Lake Louse are tiny (the size of a closet) and are not thrilling, really not up to the rest of the Fairmont Hotels

anti_ice says

My vote is for the BSH. The hotel is better in my humble opinion and in a different league in terms of character and there is a lot more to do in Banff when you are not hiking.