woocommerce – Remove html code

Good morning everyone, I have a problem with a plug that inserts a double "buy" button on each product. To solve this problem, I have solved css for now, but unfortunately, these do not delete the html code, I was wondering if there is a way to remove the html code through a function in the function file.

Thanks in advance to those who want to answer me.

http request: connection timeout problem on the server, but the code works well on localhost

I call some api using drupal_http_request (). In localhost it is working well.
but on the server I got a connection timeout error where the error code -110.

I put it

ini_set (& # 39; default_socket_timeout & # 39 ;, 120);
$ conf['http_request_timeout'] = 120;

in my settings.php. But it does not work on the server.

Error

stdClass Object ( [code] => -110 [error] => Connection time has run out) 

Machine Learning: code to develop a personalized Obama DeepFake.

I'm planning a little surprise for my friend's farewell at work and I wanted to make a custom personalized video for Obama.

Could someone guide me to a resource or some good place to start with this?

Here is the video link: https://www.youtube.com/watch?v=cQ54GDm1eL0

Thank you!

xrdp: (code = exited, status = 1 / FAULT)

‚óŹ xrdp.service - demon xrdp
Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor default: enabled)
Active: failed (Result: exit code) from Wednesday 2019-06-19 11:07:31 IDT; 13s ago
Docs: male: xrdp (8)
man: xrdp.ini (5)
Process: 4580 ExecStart = / usr / sbin / xrdp $ XRDP_OPTIONS (code = exited, status = 1 / FAULT)
Process: 4572 ExecStartPre = / bin / sh / usr / share / xrdp / socksetup (code = exited, status = 0 / SUCCESS)

I'm not sure why I get this error, I can not find an answer from Google! If anyone knows, please let me know. Thanks in advance!

Edit:

June 19 11:16:22 ngrams systemd[1]: Starting the xrdp daemon ...
June 19 11:16:22 ngrams systemd[1]: xrdp.service: control process left, code = exited state = 1
June 19 11:16:22 ngrams systemd[1]: xrdp.service: Error with the result & # 39; exit code & # 39 ;.
June 19 11:16:22 ngrams systemd[1]: Error starting the xrdp daemon.

iMac Late 2015 Mojave command line code to disable the main screen and use external as default

I wanted to try the command line code to disable the main screen of my iMac and use the external one as the default.
To try to solve my kernel_task problem of the CPU.
My screen is broken and even with a new one it does not talk to the motherboard that I verified through Apple.
When I use a computer with an external screen it works well, besides kernel_task occupies as much CPU / RAM.
Maybe disabling the screen will solve the problem?

help

Amazon Web Services: How to defend against attackers looking for a faulty code?

I have a production IIS that runs on WS2012R2 on AWS. I was looking at the C: Windows System32 LogFiles HTTPERR When I noticed some unusual requests in the records. You can see some of those who tried to request here. They even checked if I was running thinkphp. Now, my question is:

What is the best way to avoid these types of requests in addition to writing a customized solution? I noticed that they would change their IP daily, but the requests that day are from the same IP.

I guess I can keep track of all requests made to my server and block those that have behaviors that I do not like, but I hope there is something simpler.

I looked at some third-party solutions that seemed to do what I need, but I just do not feel good.

python – How can I create a function for my code?

-3

I'm completely new to python and I'm learning it. I have written the following code but I could not do any function of it. Can anybody help me please?

import pandas like pd
import numpy as np
f = open (& # 39; 1.csv & # 39 ;, & # 39; r & # 39;)
df = pd.read_csv (f, usecols =[0], sep = " t", index_col = False)
Primary_List = df.values.tolist ()
x = 0
y = len (Primary_list)
for i in the range (x, y):
x = i
MyMatrix = Primary_List[x:x + 10]
print (MyMatrix)

c # – Extending the functionality of existing classes without breaking the consumer code

Here is a set of classes that are used to build where clause for SQL Server and Oracle for different types of fields, p. ex. text, numeric Y date.

IConditionBuilder public interface
{
bool CanHandle (FilterAction filterAction);

string BuildCondition (SearchCondition filterCondition);
}

abstract class publishes ConditionBuilder : IConditionBuilder where TContext: FieldSearchContext
{
Public abstract string OperatorSymbol {get; }

public string BuildCondition (SearchCondition searchCondition)
{
var conditionBuilder = new StringBuilder ();

var context = searchCondition.GetContext();

conditionBuilder.Append (context.FieldId);
conditionBuilder.Append (OperatorSymbol);
conditionBuilder.Append (GetValue (context));

return conditionBuilder.ToString ();
}

public summary bool CanHandle (FilterAction filterAction);

Public abstract object GetValue (TContext context);

}

public class TextLikeConditionBuilder: ConditionBuilder
{
public cancellation string OperatorSymbol => "LIKE";

public override bool CanHandle (action FilterAction) => action == FilterAction.TextLike;

GetValue public annulment object (TextContext context)
{
if (context.Text == null)
{
zero return
}

return string.Concat ("%", context.Text, "%");
}
}

public class TextEqualsConditionBuilder: ConditionBuilder
{
public chain of cancellation OperatorSymbol => "=";

Public Override bool CanHandle (action FilterAction) => action == FilterAction.TextEqual;

GetValue public annulment object (TextContext context)
{
if (context.Text == null)
{
zero return
}

returns "& # 39;" + context.Text + "& # 39;";
}
}

public class NumericLessThanConditionBuilder: ConditionBuilder
{
public cancellation string OperatorSymbol => " < ";

    public override bool CanHandle(FilterAction action) => action == FilterAction.NumericLessThan;

public replacement object GetValue (NumericContext context)
{
return the context.Number;
}
}

public class DateGreaterThanAndLessThanEqualConditionBuilder: IConditionBuilder
{
public const string GREATER_THAN = ">";

public const string LESS_THAN_EQUAL = "<=";

public string BuildCondition (SearchCondition filterCondition)
{
var conditionBuilder = new StringBuilder ();

var context = filterCondition.GetContext();

conditionBuilder.Append (context.FieldId);
conditionBuilder.Append (GREATER_THAN);
conditionBuilder.Append ("& # 39;" + context.FromDate + "& # 39;");
conditionBuilder.Append (LESS_THAN_EQUAL);
conditionBuilder.Append ("& # 39;" + context.EndDate + "& # 39;");
return conditionBuilder.ToString ();
}

public bool CanHandle (action FilterAction) => action == FilterAction.DateGreaterThanLessThan;

}

I want to extend the functionality so that context.FieldId is disinfected before using it to build the condition statement for, for example, these classes will build a statement like Name = & # 39; Aashish & # 39;, I want the classes to build enunciated as [Name] = & # 39; Aashish & # 39;. These classes are consumed by other developers, so I do not want to break the functionality for consumers as a result of the changes I will make, basically complying with the Open-Closed principle. So, here is how I implemented these changes. Notice how I added a virtual function SanitizeFieldId in ConditionBuilder Y DateGreaterThanAndLessThanEqualConditionBuilder.

abstract class publishes ConditionBuilder : IConditionBuilder where TContext: FieldSearchContext
{
Public abstract string OperatorSymbol {get; }

public string BuildCondition (SearchCondition searchCondition)
{
var conditionBuilder = new StringBuilder ();

var context = searchCondition.GetContext();

conditionBuilder.Append (SanitizeFieldId (context.FieldId));
conditionBuilder.Append (OperatorSymbol);
conditionBuilder.Append (GetValue (context));

return conditionBuilder.ToString ();
}

public summary bool CanHandle (FilterAction filterAction);

Public abstract object GetValue (TContext context);

virtual string protected SanitizeFieldId (string fieldId)
{
return fieldId;
}
}

public class DateGreaterThanAndLessThanEqualConditionBuilder: IConditionBuilder
{
public const string GREATER_THAN = ">";

public const string LESS_THAN_EQUAL = "<=";

public string BuildCondition (SearchCondition filterCondition)
{
var conditionBuilder = new StringBuilder ();

var context = filterCondition.GetContext();

conditionBuilder.Append (SanitizeFieldId (context.FieldId));
conditionBuilder.Append (GREATER_THAN);
conditionBuilder.Append ("& # 39;" + context.FromDate + "& # 39;");
conditionBuilder.Append (LESS_THAN_EQUAL);
conditionBuilder.Append ("& # 39;" + context.EndDate + "& # 39;");
return conditionBuilder.ToString ();
}

public bool CanHandle (action FilterAction) => action == FilterAction.DateGreaterThanLessThan;

virtual string protected SanitizeFieldId (string fieldId)
{
return fieldId;
}
}

public class SanitizedFieldConditionBuiler : ConditionBuilder where TContext: FieldSearchContext
{
Private ConditionBuilder _baseConditionBuilder;
IColumnSanitizer private _columnSanitizer;

SanitizedFieldConditionBuiler public (ConditionBuilder) baseConditionBuilder, IColumnSanitizer columnSanitizer)
{
_baseConditionBuilder = baseConditionBuilder;
_columnSanitizer = columnSanitizer;
}

public nullification string OperatorSymbol => _baseConditionBuilder.OperatorSymbol;

public override bool CanHandle (FilterAction filterAction) => _baseConditionBuilder.CanHandle (filterAction);

public null object GetValue (TContext context) => _baseConditionBuilder.GetValue (context);

Protected override string SanitizeFieldId (string fieldId)
{
return _columnSanitizer.Sanitize (fieldId);
}
}

public class SanitizedDateFieldGreaterThanAndLessThanEqualConditionBuilder: DateGreaterThanAndLessThanEqualConditionBuilder
{
IColumnSanitizer private _columnSanitizer;

public SanitizedDateFieldGreaterThanAndLessThanEqualConditionBuilder (IColumnSanitizer columnSanitizer)
{
_columnSanitizer = columnSanitizer;
}

Protected override string SanitizeFieldId (string fieldId)
{
return _columnSanitizer.Sanitize (fieldId);
}
}

I use extension methods to initialize SanitizedFieldConditionBuilerY SanitizedDateFieldGreaterThanAndLessThanEqualConditionBuilderAs shown below:

Static class public extensions
{
SanitizedFieldConditionBuiler static public SanitizeField(This ConditionBuilder source, IColumnSanitizer columnSanitizer) where TContext: FieldSearchContext
{
back new SanitizedFieldConditionBuiler(source, columnSanitizer);
}

sanitizedDateFieldGreaterTanerAntLessThanEqualConditionBuilder SanitizeField (this IConditionBuilder font, IColumnSanitizer columnSanitizer)
{
return new SanitizedDateFieldGreaterThanAndLessThanEqualConditionBuilder (columnSanitizer);
}

}

Sanitation is available through an interface. IColumnSanitizer and has two different implementations, for Sql Server and Oracle respectively

    IColumnSanitizer public interface
{
Sanitize string (string columnName);
}

public class SqlSanitizer: IColumnSanitizer
{
Sanitize public string (string columnName)
{
he came back "[" + columnName + "]";
}
}

public class OracleSanitizer: IColumnSanitizer
{
Sanitize public string (string columnName)
{
returns "" "+ columnName +"  "";
}
}

Here's how the context classes are implemented:

public abstract class FieldSearchContext
{
public virtual field Field ID {get; }

Protected FieldSearchContext (string fieldId)
{
FieldId = fieldId;
}
}

public class DateContext: FieldSearchContext
{
public DateContext (string fieldId, DateTime? from Date, DateTime? endDate): base (fieldId)
{
FromDate = fromDate;
EndDate = endDate;
}

Public date? FromDate {get; }

Public date? EndDate {get; }
}

public class TextContext: FieldSearchContext
{
Public TextContext (string fieldId, string text): base (fieldId)
{
Text = text;
}

public string of text {get; }
}

public class NumericContext: FieldSearchContext
{
public numericContext (string fieldId, decimal number): base (fieldId)
{
Number = number;
}

Public decimal number {obtain; }
}

These changes work perfectly well, but I want to know if this can be achieved in a different and better way.

Use the code below to see it in action:

    class program
{
static main vacuum (chain[] args)
{
var conditions = new list()
{
new SearchCondition (new NumericContext ("Numeric Field", 1234), FilterAction.NumericLessThan),
new SearchCondition (new TextContext ("Text Field", "ASDF"), FilterAction.TextEqual),
new SearchCondition (new TextContext ("Text field", "QWERTY"), FilterAction.TextLike),
new SearchCondition (new DateContext ("Date Field", DateTime.Now, DateTime.Now.AddYears (1)), FilterAction.DateGreaterThanLessThan)
};

Console.WriteLine (BuildWhereClause (Operation.AND, conditions));
Console.Read ();
}

private static string BuildWhereClause (operation operation, IList terms)
{
var returnValue = new list();
var conditionBuilders = new list()
{
new TextEqualsConditionBuilder (). SanitizeField (new SqlSanitizer ()),
New NumericLessThanConditionBuilder (). SanitizeField (new SqlSanitizer ()),
new TextLikeConditionBuilder (). SanitizeField (new SqlSanitizer ()),
new DateGreaterThanAndLessThanEqualConditionBuilder (). SanitizeField (new SqlSanitizer ())
};

foreach (condition var in conditions)
{
var context = condition.GetContext();
var conditionBuilder = conditionBuilders.FirstOrDefault (u => u.CanHandle (condition.FilterAction));
returnValue.Add (conditionBuilder.BuildCondition (condition));
}

if (returnValue.Any ())
return string.Join (Convert.ToString ("" + operation + ""), returnValue);

Return chain. Empty;
}
}

Operation enumeration: int
{
AND = 1,
OR = 2
}

java – A certain line of code causes my game to fall

It took me about a month to teach Java and game development, and I came to a halt. For some reason, having this line of code in my character class causes the game to crash almost immediately after launch, although eclipse does not show an error and I can not see what's wrong with it.

        public class character

public float TDRFire;

Character (chain name, int level, Statblock statistics, Gearset gear, animset anims, Gridset gref) {

// total resistances
TDRFire = gear.Shield.resists.fireRes * gear.Helm.resists.fireRes * gear.Torso.resists.fireRes *
gear.Gloves.resists.fireRes * gear.Shoes.resists.fireRes * gear.Ring1.resists.fireRes * gear.Ring2.resists.fireRes;
}
}

What you are supposed to do is take the DMG resistance modifier for each gear slot and multiply them to get the total damage resistance for the character. I can not see what's wrong.

I have cut all the things that are obviously not relevant.

c ++ – The task performed by the code.

I'm fresh in c ++

But in reality what interests me is:

I have such a method

void VideoRender :: updateData (const std :: string & i_obj_path, const std :: string & i_pngPath, const uint i_subIndex) {
std :: shared_ptr container = std :: make_shared();

std :: thread th1 (& VideoRender :: thread_task1, this, i_obj_path.c_str (), i_subIndex, container);
std :: thread th2 (& VideoRender :: thread_task2, this, i_pngPath, container);

th1.join ();
th2.join ();

fifo.enqueue (container);
}

As you can see, this method executes 2 tasks in 2 different threads and then join they. I invoke this method 20 times per second.

What bothers me: that 20 times per second I create 2 threads …

The question is: does this implementation in C ++ look good? Because I think I should use something like ThreadPool or some Animal trainer that will run on another thread and I'm going to push the homeworkis there

If I'm right