htaccess – Refuses access to all PHP files with the help of FilesMatch, but creates an exception for a

Can I write multiple statements in one htaccess?

Yes you can. Many containers in the same the context (that is to say. .htaccess) are merged in order. So you can block everything .php files and allow a specific foobar.php file – in that order.

For example:

# Block all ".php" files

Order deny,allow
Deny from all


# Permit a specific ".php" file

Order deny,allow
Allow from all

Alternatively, you can use only one container and use a negative look in the regex to exclude the specific file:

# OR use a negative lookahead...

Order deny,allow
Deny from all

the negative affirmation of anticipation (?!foobar.php$) ensures that the regex does not match foobar.php, while corresponding to all others .php files.

Note that Order, Deny, Allow are strictly Apache 2.2 directives. If you are using Apache 2.4, then you should probably change this to Require all denied and Require all granted respectively (provided you have switched to mod_authz_core on your system).

Also note that the container is applied to the current directory and all subdirectories.

c ++ – Function that creates pointers to classes

I'm trying to create a function that creates pointers to the instances of a class of players.

Indeed, at the beginning of my game, I want to be able to create as many instances of players as I want.

This makes the game to 2, 4 or 3 players and theoretically an infinite number of players determined by the inputs of the user.

The problem I am facing is that if I'm going to make indicators like this:

edit: player is a class defined by the user I created.

void createPointer()
{
    player * player1 = new player("George");
}
  1. The pointer will only be declared locally, which will cause a memory leak because I can not reference the player1 pointer because it is removed after the createPointer () function is complete.
  2. I would not be able to properly reference the drives as shown above because they are all named player1. This makes me think that I should use c ++ templates to change the name of the variable whenever a player is created.
  3. As shown below, I could not delete the player instance at the end of the game:
void endGame()
{
    //delete the object the pointer
    //is pointing to in memory
    delete player1;
    //set the pointer to point to NULL
    //as default, so can check if pointer is pointing
    //to anything
    player1 = NULL;
}

So I was wondering if there was another approach I could take? I know a solution that consists in declaring the indicators globally in advance. it is to say

player * player1 = NULL;
player * player2 = NULL;
player * player3 = NULL;
void createPointer()
{
    player1 = new player("George");
}

However, this would mean that I can not create a variable number of players without first declaring them, as shown in the example above.

My apologies if I do not understand anything, I would be very grateful for any advice.

dataframe – Creates a new variable (column) in a data frame using the for-loop

I have a dataframe called "base". Who has the following columns (as shown in the picture).

enter the description of the image here

What I want, it's convert to uppercase, for which I'm using the command toupper() as follows.

base$P65_1<-toupper(base$P65_1)

My question is: how to convert the 6 columns to uppercase using the for loop. I am new and in my innocence I have done the following:

for (i in 1:6) {
        base$P65_(i)<-toupper(base$P65_(i))
}

This code does not work, definitely.

Please, how can I solve it using loops.

Thanks in advance !!!!

php – Why an internal nested repeater jquery creates a button initiating the internal repeater as well as the external repeater

Here is my php file code


here is the repeater jQuery

jQuery('#immunization_records_list').repeater({
    show: function () {
        jQuery(this).slideDown();
    },
    hide: function (deleteElement) {
        Swal({
            title: 'Are you sure?',
            text: "You want to delete this Field?",
            type: 'warning',
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Yes, delete it!'
        }).then((result) => {
            if (result.value) {
                jQuery(this).remove();
            }
        });
    },
    ready: function (setIndexes) {
        console.log(setIndexes);
    }
});
jQuery('#dose_list').repeater({ 
    show: function () { 
        jQuery(this).slideDown(); 
    },
    hide: function (deleteElement) {
        Swal({
            title: 'Are you sure?',
            text: "You want to delete this Field?",
            type: 'warning',
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Yes, delete it!'
        }).then((result) => {
            if (result.value) {
                jQuery(this).remove();
            }
        });
    },
    ready: function (setIndexes) {
        console.log(setIndexes);
    }
});

When I click on the dose addition button of the internal repeater, it creates the internal division as well as the external rep divisional, whereas I just want to add only the internal repetition division. The external repeater div must be repeated only on the Add New Vaccine button because it is the external repeater creation button. How can I do this?

postgresql – Creates a stored procedure with a dynamic number of columns + column names

I am relatively new to postgresql and have some problems creating my first stored procedure. The real problem is that I need to be dynamic, so I find it difficult to find the previous discussions that asked this question.

Let's say I have a table with the following information

Table nominal_dollars
year       GDP        Dividends
2000      100              20
2001      110              30
2002      120              40

In the table above, the numbers are not adjusted for inflation. A common procedure I want to do is to create a new table in which the numbers are adjusted for inflation. This means that I have to join the table above with a new table, Consumer Price Inflation (CPI), which looks like this:

Table cpi
year       cpi_adjustment
2000      1            
2001      2             
2002      3             

This will create a new table in which all the numbers are adjusted for inflation, that is, the original numbers are multiplied by the adjustment in cpi :

Table nominal_dollars_adj
year       GDP        Dividends
-----------------------------------------
2000      100              20
2001      220              60
2002      360              80

Where GDP for the new table is equal to the GDP of the table of origin * cpi_adjustment, and the same for dividends.

Now, I want to do this IPC adjustment procedure for many different tables – which may have a different number of columns.

So, I want to create a stored procedure that takes input from a table (or a table name), and within this function I want to create a new table with the exact same names and the same number of columns as the original table, but with all values ​​adjusted for inflation as above.

Ideas?

Good luck,

Jake

content type: Adding "News" via News Web Parts creates site pages and not republished pages

On some classic sites (not all), when I add news via the Webpart News, they are added as site pages and not in Repost news (as it should be).

The selected Site feature, called "Site Pages", is enabled and listed as a valid content type in the library.

I do not understand why a site works and on 2 other sites (created around the same time), it does not work.

As a workaround, I do not want to manually change the content type of all pages. This is extra work that I do not want to do or that the end user does not do.

The Google Search Console creates URLs that do not exist in my Sitemap, and complains about the error in these pages.

You have a misconception of what a sitemap is.

The sitemap is used to audit the crawling of the site by the bot search engine. The site plan and the exploration of a site are two different and independent things. Google will continue to explore your site regardless of any site map. The sitemap will be used to check / see if Google is able to correctly analyze your site. For example, if pages are in your sitemap and Google has not seen the page, Google can add the page to the recovery queue to include.

The opposite is not true. If a page is not in the sitemap, Google will not remove it from its index. Why? Because Google found it while exploring the site.

What you seem to believe is that the sitemap is the only authority used by Google to know which pages exist on a given site. This is not the case. The crawl is. The site map only allows Google to know if they can properly analyze your site and, if not, the missing pages in Google that need to be added to the recovery queue.

Your Google expectations no longer try to access pages because these pages no longer appear in your sitemap are incorrect. Sitemaps are cached and checked only periodically. Why? Because it is an audit process.

You have a real problem to solve.

You return a 500 error for pages not found. It's bad. Your website should return a 404 Not Found error. The error 500 is a system error and Google will treat the condition as temporary. If your site returned a 404 error, Google will continue to try the page several times over a period of time until it decides that the page does not exist anymore. If possible, you want to issue a Deleted 410 error for the pages you have deleted. If this is too much work or it is not possible, the 404 will be the same over time.

You must correct your 500 error.

wordpress hack / plugin: when the search creates a message on | NewProxyLists

Hi,

when someone comes to a page 404 on my website the wordpress site but automatically creates a post about it

to say my site is: http://www.mysite.com

Someone comes to http://www.mysite.com/example-apple and I do not have this post, I want him to automatically create this post and show this visitor this post

in this post, I mean: we do not have this post, but here is the link to google: when they click, they have to go to google and automatically search for that title / post

please name your price

The Google Search Console creates URLs that do not exist in my sitemap, and complains about the error in these pages.

You have a misconception of what a sitemap is.

The sitemap is used to audit the crawling of the site by the bot search engine. The site plan and the exploration of a site are two different and independent things. Google will continue to explore your site regardless of any site map. The sitemap will be used to check / see if Google is able to correctly analyze your site. For example, if pages are in your sitemap and Google has not seen the page, Google can add the page to the recovery queue to include.

The opposite is not true. If a page is not in the sitemap, Google will not remove it from its index. Why? Because Google found it while exploring the site.

What you seem to believe is that the sitemap is the only authority used by Google to know which pages exist on a given site. This is not the case. The crawl is. The site map only allows Google to know if they can properly analyze your site and, if not, the missing pages in Google that need to be added to the recovery queue.

Your Google expectations no longer try to access pages because these pages no longer appear in your sitemap are incorrect. Sitemaps are cached and checked only periodically. Why? Because it is an audit process.

You have a real problem to solve.

You return a 500 error for pages not found. It's bad. Your website should return a 404 Not Found error. The error 500 is a system error and Google will treat the condition as temporary. If your site returned a 404 error, Google will continue to try the page several times over a period of time until it decides that the page does not exist anymore. If possible, you want to issue a Deleted 410 error for the pages you have deleted. If this is too much work or it is not possible, the 404 will be the same over time.

You must correct your 500 error.

python – Creates a structuring element in the form of a line with a certain degree and length

In Matlab, there is a function that allows you to create a structuring in the form of a line.
SE = strel('line',len,deg) creates a linear structuring element symmetrical about the center of the neighborhood, of approximate length len and angle deg. For some morphological operations, I need to filter the horizontal, vertical and other line angles. Within Python CV2 a similar function does not exist. Therefore, I wanted to recreate this function in Python

My code:

import math
import numpy as np

# bresenham function is the accepted answer of SO's post https://stackoverflow.com/questions/23930274/list-of-coordinates-between-irregular-points-in-python
def bresenham(x0, y0, x1, y1):
   points = ()
   dx = abs(x1 - x0)
   dy = abs(y1 - y0)
   x, y = x0, y0
   sx = -1 if x0 > x1 else 1
   sy = -1 if y0 > y1 else 1
   if dx > dy:
      err = dx / 2.0
      while x != x1:
         points.append((x, y))
         err -= dy
         if err < 0:
            y += sy
            err += dx
         x += sx
   else:
      err = dy / 2.0
      while y != y1:
         points.append((x, y))
         err -= dx
         if err < 0:
            x += sx
            err += dy
         y += sy
   points.append((x, y))

   return points


def strel_line(length, degrees):
   if length >= 1:
      theta = degrees * np.pi / 180
      x = round((length - 1) / 2 * np.cos(theta))
      y = -round((length - 1) / 2 * np.sin(theta))
      points = bresenham(-x, -y, x, y)
      points_x = (point(0) for point in points)
      points_y = (point(1) for point in points)
      n_rows = int(2 * max((abs(point_y) for point_y in points_y)) + 1)
      n_columns = int(2 * max((abs(point_x) for point_x in points_x)) + 1)
      strel = np.zeros((n_rows, n_columns))
      rows = ((point_y + max((abs(point_y) for point_y in points_y)) for point_y in points_y))
      columns = ((point_x + max((abs(point_x) for point_x in points_x)) for point_x in points_x))
      idx = ()
      for x in zip(rows, columns):
         idx.append(np.ravel_multi_index((int(x(0)), int(x(1))), (n_rows, n_columns)))
      strel.reshape(-1)(idx) = 1

   return strel


if __name__=='__main__':
   strel = strel_line(15, 105)
   print(strel)
   print(strel.shape)

Exit:

((1. 0. 0. 0. 0.)
 (1. 0. 0. 0. 0.)
 (0. 1. 0. 0. 0.)
 (0. 1. 0. 0. 0.)
 (0. 1. 0. 0. 0.)
 (0. 1. 0. 0. 0.)
 (0. 0. 1. 0. 0.)
 (0. 0. 1. 0. 0.)
 (0. 0. 1. 0. 0.)
 (0. 0. 0. 1. 0.)
 (0. 0. 0. 1. 0.)
 (0. 0. 0. 1. 0.)
 (0. 0. 0. 1. 0.)
 (0. 0. 0. 0. 1.)
 (0. 0. 0. 0. 1.))

Do you see ways to write my job more effectively?