List manipulation – Get the average of the Fat Cantor set based on its distribution

Suppose we have a function $ P: A to (0.1) $, Where $ A $ is the bold cantor movement or $ C $.

$ C $ is done by removing $ 1/4 $ from $ (0.1) $ around the middle

$$ C_ {1} = (0.3 / 8) cup (5 / 8.1) $$

$$ C_ {1,1} = (0.3 / 8) C_ {1,2} = (5 / 8.1) $$

what we repeat, remove $ 1/16 $ around the center of each remaining interval

$$ C_ {2} = (0.5 / 32) cup (7 / 32.12 / 32) cup (5 / 8.25 / 32) cup (27 / 32.1) $$

$$ C_ {2,1} = (0.5 / 32) C_ {2.2} = (7 / 32.12 / 32) C_ {2.3} = (5 / 8.25 / 32) C_ {2.4} = (27 / 32.1) $$

Until $ lim limit_ {n to infty} C_ {n, i} = C $, Where $ 1/4 ^ n $ from $ (0.1) $ around each midpoint of the remaining intervals are removed.

I want to find the average so that

$$ sum_ {i = 1} ^ {2 ^ {n}} P (t_ {n, i}) (1 / | C_ {n, i} |) $$

Where $ bigcup limit_ {i = 1} ^ {2 ^ {n}} C_ {n, i} = C_n $ and $ t_ {n, i} in C_ {n, i} $

How would we use mesh and list manipulation to solve this? We would get $ frac {1} {2} int_ {0} ^ {1} P dx $?

mysql – How do I update multiple database structures based on one database without losing data?

We have multiple database servers for our customers, each of which has multiple databases (MySQL). All Databases should have the same structure.

Now we have a database that is used for testing in a staging environment. Basically, this is always the most current and should be the structural basis for all databases. This is because when developing a new function, the new tables and columns are created here first.

The client databases were very They also differ from each other because different clients first require different functions and most client database updates were carried out manually. So it's actually a bit messy.

We have a tool that does a query against all databases, but the thing is, I have to be careful not to lose any data that the databases already have.

Views – Change the value of the exposed filter programmatically based on another exposed filter

I have 2 exposed filters in my Drupal 8 view – both are selected dropdowns. I want the value of the 2nd filter to change based on the selection of the first filter
Here are the filters
$filters = $view->display_handler->getOption('filters');

$filters('country') and $filters('states').

The problem is that I always get an empty value when I try to access the country filter in my views_pre_view hook.

dpm($filters('country')('value')) always prints blank.

How do I solve this please?

dnd 5e – Can you successfully complete a save that you cast based on a spell you cast?

There is no general rule that exempts wizards from saving rolls for their own spells, and whether a particular spell had such a rule it would say it openly.

School of Evocation Wizards, however, have a useful ability:

Sculpture spell

From stage 2 onwards, you can create bags with relative certainty within the effects of your evocation spells. When you cast a summoning spell that affects other creatures you can see, you can choose a number of them that is 1 + the level of the spell. The selected creatures automatically have save rolls against the spell and do no damage if they would normally take half the damage if the save was successful.

Earthquake is an evocation spell, so a wizard from the evocation school can use sculpt spells to successfully perform a save after a spell they cast, and not make them vulnerable.

The earthquake spell has a number of continuous effects. Sculpture magic would not protect you from these effects in the following rounds after the first cast.

You could also use sculpt spells for all other summoning spells (e.g. fireball, etc.), many of which have no ongoing effects.

However, sculpt spells cannot protect the caster

The rule text says very specifically that you can protect. & # 39;other creatures you can see& # 39 ;. "Other creatures" cannot mean you.

To achieve this effect, you need a friendly summoning assistant who will enchant you with Sculpt Spells. You cannot work it on yourself.

dnd 5e – Can you successfully complete a save that you cast based on a spell you cast?

There is no general rule that exempts wizards from saving rolls for their own spells, and whether a particular spell had such a rule it would say it openly.

School of Evocation Wizards, however, have this ability:

Sculpture spell

From stage 2 onwards, you can create bags with relative certainty within the effects of your evocation spells. When you cast a summoning spell that affects other creatures you can see, you can choose a number of them that is 1 + the level of the spell. The selected creatures automatically have save rolls against the spell and do no damage if they would normally take half the damage if the save was successful.

Earthquake is an evocation spell, so a magician from the evocation school can use a sculpture spell to automatically make a save throw and not be vulnerable to falls.

You can also use this effect for all other summoning spells (e.g. fireball, etc.).

random – A website that identifies an RNG based on its output

This happened during a discussion of RNG entropy and the difficulty in checking the entropy level in a long string of bits (e.g. a private key).

A colleague of mine told me about a website where, if a PRNG was issued sufficiently, it could be determined which application the PRNG came from. As an example, he told me that he had sent data from the OpenSSL random number generator and identified the "Open SSL" website as the source.

I don't know how long ago it was – he did it at a previous company he worked for.

I can't find this site by googling, and my colleague may not be able to find the URL (looking for it). I'm obviously concerned if the output of supposedly cryptographically secure PRNGs is susceptible to a distinguisher attack.

If someone recognizes this website here, can they please post a response with their URL?

Web server – is there a web server load balancer that supports location based algorithms?

I asked the same question in this post and it's closed and marked as non-thematic to get product recommendations.

Now I'm just asking Are there any web server load balancing tools that support location-based algorithms? Deliver data with the fastest response and lowest latency?

Note: I will not use / request external CDN solutions

apache2 – How do I configure a domain for my vps based on Godaddy Domain Server and Apache?

Sorry for the dummy question.
I am new to putting a new domain on vps.
I have bought a domain and will set a domain to search my vps server on different ports.
First I set vps apache vhost.

api.xxx.com.conf


    RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}



    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:5000/
    ProxyPassReverse / http://127.0.0.1:5000/
    ServerName api.xxx.com
    ServerAlias api.xxx.com
    ErrorLog ${APACHE_LOG_DIR}helloapp-error.log
    CustomLog ${APACHE_LOG_DIR}helloapp-access.log common

main.xxx.com


    ServerAdmin webmaster@localhost
    ServerName main.xxx.com
    ServerAlias main.xxx.com
    DocumentRoot /var/www/xxx/
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

And I will put the domain on two vhost in godaddy.
I managed to manage DNS.
There were many new concepts like A, CNAME, NS, SOA.
That confused my head.
I have no way to set it correctly.
Can you help me please?

I tried as I think then the result goes to the right server but the domain name is changed to IP address. I don't know how it flows.

Please help me.

Javascript – Group dates based on dates to populate a Material Angular table with row ranges

I have this method that appends the year and year row size for a TD and a quarter and the quarter row row for the TD.

Year and quarter are two columns in an angle material table that are calculated from an array of objects, one of which is a property of the object is a date string.

Here is a demo for the code: https://stackblitz.com/edit/angular-ynpmdk

This is my method that works well. I wanted to check if I could shorten this method. It looks very ugly. Open to suggestions.

/**
 * Gets the year/quarter span information and filters what data is to be shown in tabs
 * @param data launch data all
 * @param mode which tab we are on
 */
getGroupData(data: DATA()) {
  data.sort((a:DATA, b:DATA) =>
    !a.date ? -1
      : !b.date
        ? -1 : (new Date(a.date).getTime() - new Date(b.date).getTime())
  );
  let cYear = data(0);
  let cQuarter = data(0);
  for (let i = 0; i < data.length; i++) {
    if (data(i).date) {
      const curDate = new Date(data(i).date);
      const dateYear = new Date(cYear.date);
      const dateQuarter = new Date(cQuarter.date);

      // Get Year span and Year values
      data(i).year = curDate.getFullYear();
      cYear.year = dateYear.getFullYear();
      if (cYear.year === data(i).year) {
        cYear.yearSpan = (cYear.yearSpan || 0) + 1;
      } else {
        cYear = data(i);
        cYear.yearSpan = 1;
      }
      // Get Quarter span and Quarter values
      data(i).quarter = this.getQuarter(curDate.getMonth());
      cQuarter.quarter = this.getQuarter(dateQuarter.getMonth());
      if (cQuarter.quarter === data(i).quarter) {
        cQuarter.quarterSpan = (cQuarter.quarterSpan || 0) + 1;
      } else {
        cQuarter = data(i);
        cQuarter.quarterSpan = 1;
      }
    } else {
      cYear = cQuarter = data(i);
      cYear.yearSpan = cYear.quarterSpan = 1;
      cYear.year = cYear.quarter = 'TBD';
      if (i === data.length - 1) {
        break;
      } else {
        cYear = cQuarter = data(i + 1);
      }
    }
  }
  return data;
}

/**
 * Get the quarter info from month index
 * @param month month index
 */
private getQuarter(month: number): string {
  return `Q${Math.ceil((month + 1) / 3)}`;
}

A sample data object looks like

{position: 1, name: 'Hydrogen', date: '2016-01-11', symbol: 'H'}

When the method is called, the record is

{
  position: 1, 
  name: 'Hydrogen', 
  date: '2016-01-11', 
  symbol: 'H', 
  year: 2016, 
  quarter: 'Q1', 
  yearSpan: 5, // The other records have 5 entries pertaining to this year
  quarterSpan: 2, // The other records have 2 entries pertaining to this quarter of this year
}

Here is a demo for the code: https://stackblitz.com/edit/angular-ynpmdk?file=src%2Fapp%2Ftable-basic-example.ts