How can I limit a specific user ID to 5 comments per post?

Can someone please give me a function to restrict a Specific User ID for 5 comments per post? I found several questions about how to set a limit of one comment per post for all users. However, I only have to set the limit for a single user ID. When I tried to change the code to specify a single user ID, the limit was instead applied to all users based on that one ID.

I found a plugin limit for comments and the number of words that includes an option to set a limit for a specific user ID. For some reason, however, the plugin on my website is not working. If I set the limit, no comments will go through for this user ID. After clicking the comment button, only a blank screen is displayed.

However, if someone can give me a simple function to limit the number of comments per post from a Specific User ID I would very much appreciate it. Thank you so much!

Air Travel – How can I be notified when a flight between a specific airport and a specific country is available within the next n days?

Assuming you want to fly home (and you should only try to fly home), your country's consular staff is your best bet. For example, various Canadian government agencies tweet about flights to Canada from certain airports. Here is a snapshot of the feed from travel.gc.ca::

Twitter feed

In addition to your country (and subsets of it, such as the "Canada in Lebanon" and "Canada in Singapore" accounts shown in the screenshot), you should have registered with your government so that they can reach you and you by email, phone call or SMS probably should have called your embassy or consulate for advice on how to get home.

If you're not trying to get home, but want to reach a relative or someone who really needs you, the same sources will probably help you. If you feel that your travel needs are not urgent enough to include a message, stop traveling. People are desperately trying to get home, reunite families, get out as long as they can. If you've always wanted to see a specific place, now is not the time.

Conclusion: Make sure that at least one qualified person connected to your target country knows that you are trying to get there, and then monitor the airlines, airports, and these embassies and consulates on all social media that you choose can introduce and engage in group chats, multi-emails and Facebook groups so you will be notified when there is an opportunity to leave. And be ready to go when the chance comes.

SQL Server – Select a column with a specific SQL value

Enter the image description here

I have a table similar to the example in the picture. I get two digits in my backend. For example, if I get the numbers 03, only the third column is entered, especially the data 03YEPT.

Is there a way to bring only the column that I interset from the query into the database?

Without the need to put all four columns into my backend and go through them to find the one that interests me

If possible, I only want to bring the column that integrates me from the query into the database

Categories – How to dynamically get custom post types that are under a specific category

I have a Scusto Post type for a topic that I am developing and that is called Products, in which I will save a product catalog. I want to categorize these products, I have added the taxonomy category on the post type and I will create the categories required to assign each post to the correct one. I am not very well informed about WordPress features. I want to ask how I can get my custom post type assigned to each category. I think to make several WP_Query() but I don't think this will be a good idea for appearances. Is there any other way? The solution I want to implement is to use ajax with vue.js with the REST API to get a list of categories to load the relative posts and category name description into when clicked. Any hepl?

Google Sheets – Sum and calculate percentages of cells with specific values

I'm trying to develop a marker sheet that returns percentages of cells checked, but discards any unactivated cells.

So far I've done the checked cells – I've given the checked cells a value of 10 and the non-activated cells a value of 0 (I have 10 questions. If someone does everything right, they'll get a score of 100). I try to write 3 formulas that only take into account the activated cells, except everything that is not marked. The formulas I want are:

  1. Total (= total)
  2. Average (= average)
  3. Median

I'm pretty sure I'm & # 39; if & # 39; (e.g. = sumif) or filter (e.g. sum (filter …)), but I have no idea of ​​the exact syntax. Any help would be appreciated.

Set the custom image size only for a specific custom post type

If you look at the heading of the question, it may seem like a double question, but it is not. Let me explain a few things before someone votes or makes it a duplicate.

As far as I know in WordPress, the only way to create a custom image size is by using add_image_size(). Now let's say I called a CPT Testimonials and at the time of registering the CPT I added thumbnail Support.

Then in mine functions.php if I like the following:

Then, in my template, when loading the CPT thumbnail, I can do the following:

the_post_thumbnail('my-testimonial');

And this gives me a 100x100 thumbnail image.

Problem with the above approach

Although the above approach works well, it has one major disadvantage. How add_image_size() Is global, after that point every picture I upload has, be it for a blog post, page, CPT or other CPT. Each of these image uploads has a 100x100 version on my server, which simply wastes both server execution and storage resource.

If I use an image optimization API, it will also optimize all images, regardless of whether I use it or not, and put a strain on me accordingly.

What I'm looking for

So what I'm looking for is a way to specify the thumbnail size of a particular CPT. So when I upload an image for this CPT, only those images will be resized, but no other image outside of the CPT will be cropped that size.

I googled a lot, but couldn't find a solution to this dilemma. In addition, most of the answers are old and WP 5.4 has now been released. I was wondering if there is a way to do this now.

java – Is there a specific code to add money and check hands in poker?

The player must start at $ 200 and there should be 3 radio buttons for $ 1, $ 10 and $ 100 bets. If the player presses deal, the stake should be deducted from the player's pocket. Then the player selects which cards they want to hold and presses Draw. At this point, the game should determine whether the player's hand is a winning hand. Check out a standard 5-card poker table for the winning hands. If the hand wins, the player's pocket should be credited with double the bet amount, and then we will return to the betting phase.

I'm playing a poker game and I've come a long way. This is the command prompt that I use for this code. I checked many examples, but couldn't use any of them to add the money. I have already added the RadioButtons. Any tips or a better example that I could use?

Button btDEAL = new Button("DEAL");
    btDEAL.setOnAction(e -> draw(hBox));


{


private int Money = $200;
    Money = $200;



    Button btdraw = new Button("DRAW");
    btdraw.setOnAction(e -> draw(hBox));

    //Creates hold button to hold cards
    Button bthold1 = new Button("HOLD");
    bthold1.setOnAction(new Hold1Handler());
    Button bthold2 = new Button("HOLD");
    bthold2.setOnAction(new Hold2Handler());
    Button bthold3 = new Button("HOLD");
    bthold3.setOnAction(new Hold3Handler());
    Button bthold4 = new Button("HOLD");
    bthold4.setOnAction(new Hold4Handler());
    Button bthold5 = new Button("HOLD");
    bthold5.setOnAction(new Hold5Handler());


    RadioButton r1 = new RadioButton("$1");
    RadioButton r2 = new RadioButton("$10");
    RadioButton r3 = new RadioButton("$100");

    holdBox.getChildren().addAll(bthold1, bthold2, bthold3, bthold4, bthold5);


    vBox.getChildren().addAll(hBox, holdBox, btdraw, btDEAL, r1, r2, r3);



    // Creates the window with the pane inside
    Scene scene = new Scene(vBox, 500, 500);
    primaryStage.setTitle("Poker Five Cards");
    primaryStage.setScene(scene);
    primaryStage.show();


}


public static void main(String args()) {
    launch(args);
}



public void draw(HBox pane) {
    // shuffle deck
    java.util.Collections.shuffle(cards);

    // The card will be swaped if not under the hold button
    if (hold1 == false) {
        exit(images.get(0), 1);
        new java.util.Timer().schedule(
        new java.util.TimerTask() {
        @Override
        public void run() {
        Image image1 = new Image(new File("card\" + cards.get(0) + ".png").toURI().toString());
        images.get(0).setImage(image1);
        enter(images.get(0), 1);
                    }
                },
                1000
        );
    }
    else {
        new PathTransition(Duration.ZERO, new Path(new MoveTo(0,50)), images.get(0)).play();
    }
    //If card not under hold then the card will flip and a new image shows up
    if (hold2 == false) {
        exit(images.get(1), 2);
        new java.util.Timer().schedule(
        new java.util.TimerTask() {
        @Override
        public void run() {
        Image image2 = new Image(new File("card\" + cards.get(1) + ".png").toURI().toString());
        images.get(1).setImage(image2);
        enter(images.get(1), 2);
                    }
                },
                1000
        );
    }
    else {
        new PathTransition(Duration.ZERO, new Path(new MoveTo(0,50)), images.get(1)).play();
    }

    if (hold3 == false) {
        exit(images.get(2), 3);
        new java.util.Timer().schedule(
        new java.util.TimerTask() {
        @Override
        public void run() {
        Image image3 = new Image(new File("card\" + cards.get(2) + ".png").toURI().toString());
        images.get(2).setImage(image3);
        enter(images.get(2), 3);
                    }
                },
                1000
        );
    }
    else {
        new PathTransition(Duration.ZERO, new Path(new MoveTo(0,50)), images.get(2)).play();
    }

    if (hold4 == false) {
        exit(images.get(3), 4);
        new java.util.Timer().schedule(
        new java.util.TimerTask() {
        @Override
        public void run() {
        Image image4 = new Image(new File("card\" + cards.get(3) + ".png").toURI().toString());
        images.get(3).setImage(image4);
        enter(images.get(3), 4);
                    }
                },
                1000
        );
    }
    else {
        new PathTransition(Duration.ZERO, new Path(new MoveTo(0,50)), images.get(4)).play();
    }

    if (hold5 == false) {
        exit(images.get(4), 5);
        new java.util.Timer().schedule(
        new java.util.TimerTask() {
        @Override
        public void run() {
        Image image5 = new Image(new File("card\" + cards.get(4) + ".png").toURI().toString());
        images.get(4).setImage(image5);
        enter(images.get(4), 5);
                    }
                },
                1000
        );
    }
    else {
        new PathTransition(Duration.ZERO, new Path(new MoveTo(0,50)), images.get(4)).play();
    }


}
private void enter(Node card, int pos) 
{
    //A timer is set the card to flip
    PathTransition path = new PathTransition();
    path.setDuration(Duration.millis(1000));
    path.setNode(card);
    path.setPath(new Path(new MoveTo(0, -300), new LineTo(0, 50)));
    path.play();
}





    private void exit(Node card, int pos) 
    {
        ((ImageView)card).setImage(new Image(new File("card\b2fv.png").toURI().toString()));
    PathTransition path = new PathTransition();
    path.setDuration(Duration.millis(1000));
    path.setNode(card);
    path.setPath(new Path(new MoveTo(0,50), new LineTo(0,600)));
    path.play();
}
//if the card is under the hold button it is true, if not it is false
class Hold1Handler implements EventHandler {
    @Override
    public void handle(ActionEvent e) {
        if (hold1 == true) {
            hold1 = false;
        } else if (hold1 == false) {
            hold1 = true;
        }
    }
}

class Hold2Handler implements EventHandler {
    @Override
    public void handle(ActionEvent e) {
        if (hold2 == true) {
            hold2 = false;
        } else if (hold2 == false) {
            hold2 = true;
        }
    }
}

class Hold3Handler implements EventHandler {
    @Override
    public void handle(ActionEvent e) {
        if (hold3 == true) {
            hold3 = false;
        } else if (hold3 == false) {
            hold3 = true;
        }
    }
}

class Hold4Handler implements EventHandler {
    @Override
    public void handle(ActionEvent e) {
        if (hold4 == true) {
            hold4 = false;
        } else if (hold4 == false) {
            hold4 = true;
        }
    }
}

class Hold5Handler implements EventHandler {
    @Override
    public void handle(ActionEvent e) {
        if (hold5 == true) {
            hold5 = false;
        } else if (hold5 == false) {
            hold5 = true;
        }
    }

Get web permissions for specific users using SharePoint 2010 CSOM

I need to check if a particular user has permissions to the web.
I can't find a way to do it SharePoint 2010 Client object model.

I need an alternative from SPWeb.DoesUserHavePermissions (string userLoginName, SPBasePermissions permissions) This is also accepted as the login name because the client object model only has this method for verification current user permissions. As of SharePoint 2013, there is a method Web.GetUserEffectivePermissions (userLoginName) However, this is not the case because it does not work in SharePoint 2010.

iptables – sandbox / firewall process to connect only to a specific IP or host in Debian Linux

On Linux (Debian 10) I want to sandbox a program that was started using a shell script so that it can only connect to a specific IP address or host, but not to another. I'm looking for a general solution that also works with the shell script that starts a program with a GUI.

I know the Bubblewrap tool, which I can use to deactivate all networks for a process --unshare-netA new network namespace is created specifically for the sandbox program.

But here I want to whitelist a single IP address or host that this program can connect to.

Can this be done with bubble wrap or a fire prison?

Or I was thinking about it, but I don't know if it is the right direction to create a new user, especially just to start the specific program while logged in as my regular username in a desktop environment, and a firewall setting to set up in Debian for this particular user with the setting "Whitelist only"?

I would appreciate help in solving this problem.