## magento2 – Hide the payment method if the customer has more than one order of treatment

I am new to Magento and I am trying to learn Magento.
I try to hide a payment method if the customer has more than one order of treatment. So I created a module call, KgPayMethod. In this module, I added this line to events.xml.

``````

``````

and my class like this:

``````getEvent()->getMethodInstance()->getCode() == "banktransfer" )
{
\$checkResult = \$observer->getEvent()->getResult();
\$checkResult->setData('is_available', false);
}
}
}
``````

Now, I do not know how to get all orders from customers and if it had only had a processing order, the payment method would be hidden only in this case.

Maybe use \$ observ-> getEvent () -> getOrder () but how to debug?

Thanks for the help!

## Convergence of the bisection, the Secant method and Newton in the absence of root

If there is no root in a function, the method of bisection, secant or Newton converges, p. Ex. F (x) = 1 / x in the interval (-1,1). How did you show why converge or do not converge? If it converges, what to do?

## METHOD TO MAKE \$ 25 EVERY DAY

https://anonfile.com/a3fchc3bn8/editable_ebook_pdf

## coding standards – naming methods – How to name a method with a complex sequence of execution?

This question: https://stackoverflow.com/questions/1866794/naming-classes-how-to-avoid-calling-everything-a-whatevermanager contains many examples of suffixes and prefixes that can be used to find a specific name for class.

What about methods? For example, how to name a method to perform an action when validating a report – `ExecuteIfSomething`, if we imagine that a state transition must be executed after checking if something is true – `ValidateTransition` (a little ok, but its reading makes me think that something must be validated – and not execute an action), `TranslateUponValidation`?

It would be very useful to have a list of common parts that can be added to the action / about / … to describe the method.

Here are some examples I can find at the moment:

• Get
• Together
• contains
• Remove
• Push
• Pop
• Clear
• To close
• Lock
• Open
• Open
• In queue
• dequeue
• Activate
• deactivate
• Translate
• Move
• Jump
• fill
• Empty
• Draw
• Take
• Give
• stash
• Group
• Mix
• Mix
• Sort
• Merge
• Online
• Validate
• Check
• perform
• Apply
• Compose
• Break down
• decay
• Pause
• Collect
• Fuse
• Grow
• ascend
• Drop
• Fall
• To choose
• To select
• accept
• Decline
• To withdraw
• Improve
• Increase
• Decrease
• stop
• Carry on
• Pause
• resume
• Process
• Create
• Destroy

Maybe I put too much.

As you can see, many, if not most, verbs can be used depending on the situation. Using them or finding the right one should not be a problem. The problem is how to combine them or use some of them to describe complex situations or complex execution sequences. The one I have described as an example is the most common one for which I have not found a good solution. Personally, I am interested in this one. But having a path / approach (not a formula like `Object` + `Action` + …) to define / find names of methods / functions can be very useful.

The main question is how to name a method like the one described in the example.
This may seem like a duplicate of this question – Naming Guidelines for Concise Meaningful Methods – I can clarify and update my question if it is necessary.

## html – Calling a view.js method by JavaScript

I have this script that uses the vue.js obtain data from a database MySQL to be displayed on a page HTMLevery time I click a button that calls the method synchronize, ie does not happen automatically. script in question:

``````\$('#app').ready(function() {
});
var vm = new Vue({
el: '#app',
data:{
noticias: (),
turismos: (),
videos:(),
programacoes: ()
},
methods:{
sync:function(){
\$.ajax({
dataType: 'json',
url: 'database/noticia.php',
vm.setNoticias();
},

}),
\$.ajax({
dataType: 'json',
url: 'database/turismo.php',
vm.setTurismos();
},

}),
\$.ajax({
dataType: 'json',
url: 'database/video.php',
vm.setVideos();
},
}),
\$.ajax({
dataType: 'json',
url: 'database/programacao.php',
vm.setProgramacoes();
},
error:function(){
alert("ocorreu um erro durante a conexão com o servidor!");
}
});

},
setNoticias:function(){
this.noticias = JSON.parse(localStorage.getItem('noticias'));
console.log(this.noticias);
},
setTurismos:function(){
this.turismos = JSON.parse(localStorage.getItem('turismos'));
console.log(this.turismos);
},
setVideos:function(){
this.videos = JSON.parse(localStorage.getItem('videos'));
console.log(this.videos);
},
setProgramacoes:function(){
this.programacoes = JSON.parse(localStorage.getItem('programacoes'));
console.log(this.programacoes);
},
},
this.setNoticias();
this.setTurismos();
this.setVideos();
this.setProgramacoes();
}
});
}
``````

the button that calls the method synchronize:

``````Atualizar
``````

The problem with the script is having to click the button to update the data or call it for the first time. I would like to be able to call the method. synchronize with JavaScript so be able to do a function that can be performed whenever the page is ready.

On the site of vue.js click here to go to him in the example two (2) everything at the end of the code indicates that it is possible. I will leave below the example in question with the existing comment mentioned above:

``````

var example2 = new Vue({
el: '#example-2',
data: {
name: 'Vue.js'
},
// define métodos dentro do objeto `methods`
methods: {
greet: function (event) {
// `this` dentro de métodos aponta para a instância Vue
alert('Olá ' + this.name + '!')
// `event` é o evento DOM nativo
if (event) {
}
}
}
})

// você pode invocar métodos no JavaScript também
example2.greet() // => 'Olá Vue.js!'
``````

I did the test, but without success, and I still wonder how to call the method via a Java script automating data synchronization, thus enhancing the user experience.

—> Click here to see my application with the script mentioned above

## linear programming – The simplex method does not solve the problem of assignment?

The problem:

I'm trying to solve http://acm.timus.ru/problem.aspx?space=1&num=1076, it's an online judge for programming problems. The problem could be solved by simply applying an assignment problem solving algorithm such as mincost-maxflow or a Hungarian algorithm. The dice are small (150 out of 150) and I try to put forward a solution with the simplex method – it does not exceed the time limit and I do not think it's my fault.

Problem of assignment

$$min sum c_ {i, j} x_ {i, j} \ sum_ {i} x_ {i, j} = 1 \ sum_ {j} x_ {i, j} = 1 \ x_ {i, j} geq 0$$

What I did:

• I added the cycling check – indeed, cycling was present. I've used some schemes to eliminate cycling: Bland's rule, lexicographic rule and Zadeh's rule. None of them triggered the cycle check, but the solution still has not exceeded the time limit.
• I've removed all the artificial variables and pants. My initialization is $$x_ {i, i} = 1$$ and the other n-1 basic variables are 0 (I use variables that do not have a non-zero value after a Gaussian elimination with $$x_ {i, i}$$)

My hypothesis

I am not an expert in the areas of linear programming, but here are some of my thoughts: I think the problem is very degenerate, the rank matrix of constraints is $$2n-1$$ with n variables having a value equal to 1 and rest n-1 having a value equal to 0. During a step of the algorithm, we enter a situation in which many variables with value 0 are exchanged, which makes the simplex method exponential. I print the cost of the function and the discount ceases after a while, although the cost reduction indicates that an improvement is still possible (that is, the criterion of the ## EQU1 ## Stop of the simplex method is not satisfied).

What I do not want

• I have an accepted verdict on this problem with mincost-maxflow, so please do not suggest any Hungarian algorithm or similar, I want to know if simplex method can solve this problem
• Please do not suggest changes for the simplex method that make assumptions about the graphical model of the problem. suggestions such as "make the edges of value 0 an alternative path". I want to know if the purely simplex method can solve the problem (with possible modifications, but that makes no assumptions about the problem).

What I want

• I want to know if my hypothesis is correct and that the simplex method simply does not apply to this kind of problem.
• If not, what kind of system can be used to solve this problem.

## New method of traffic exchange of passive PTP ads with autopilot – advertising, offers

New AutoSurf website!

There is no PREMIUM account here on FreeAutoTraffic. We offer premium features to all our FREE users!

-Increase YouTube's potential, exposure and views
-See the duration of 5s – 120s
Custom GEO targeting
-URL Referrer / Source
-Agent user
-Automatic and full automatic pilot

We give all new members 100 free points to start. Cash your visits for free right now on freeautotraffic.com

METHOD:
Autopilot method to make money automatically while you sleep!
-NO requires any knowledge or skill
-Very fast and easy to install
-Gains can be increased and multiplied exponentially

What is AutoSurf / AutoPilot?
It's an online application that navigates to other sites by itself. By doing this, you earn points, which are spent on visits to your own website – which you can convert to real money via ads, increase the rank of Alexa, etc.

How can I start?
3. Start the exchanger and earn more points to increase and multiply your winnings.

Use multiple different PTP websites and compare what you earn. See what makes you the most money!
Main PTP Sites to Use with FreeAutoTraffic:
Some of these gains in BitCoin! Earn as much as you can!

CPMbux
Short.est
SkillerzPTP
P.PW
SkyPTP
FramePTP
ClubCPM
Traffic2Bitcoin

STOP wasting your time online and start making free money in the background! Get PAID to sleep from now!

——–

## New AutoSurf website! Earn money while you sleep passive income method | NewProxyLists

New AutoSurf website!

What is AutoSurf / AutoPilot?
It's an online application that navigates to other sites by itself. By doing this, you earn points, which are spent on visits to your own website – which you can convert to real money.

There is no PREMIUM account here on FreeAutoTraffic. We offer premium features to all our FREE users!

-Increase YouTube's potential, exposure and views
-See the duration of 5s – 120s
Custom GEO targeting
-URL Referrer / Source
-Agent user
-Automatic and full automatic pilot

https://freeautotraffic.com/

Method
Autopilot method to make money automatically while you sleep!
Does NOT require any knowledge or skill
Very fast and easy to install
Gains can be increased and multiplied exponentially

How can I start?
3. Start the exchanger and earn more points to increase and multiply your winnings.
Use multiple different PTP websites and compare what you earn. See what makes you the most money!
Main PTP Sites to Use with FreeAutoTraffic:
Some of these gains in BitCoin! Earn as much as you can!

CPMbux
Short.est
SkillerzPTP
P.PW
SkyPTP
FramePTP
ClubCPM
Traffic2Bitcoin

STOP wasting your time online and start making free money in the background! Get PAID to sleep from now!

Guys, I started OO recently and I do not understand why a method I've created to subtract it subtracts it correctly, but only once, no matter how many times I submit again the form or refresh the page.

Code of the form:

``````productName = \$ _POST (& # 39; product & # 39;);
\$ obj-> priceProduct = \$ _POST (& # 39; price & # 39;);
\$ obj-> calculate (\$ obj-> productName, \$ obj-> productPrice);
}

?>

Product

Product

Price

Total
<input type = "text" name = "total" class = "form-control"
value = & # 39;totalProduct))? \$ obj-> totalProduct: & # 39;
echo \$ show;?> & # 39;
disabled = "">

``````

Class Code:

``````totalProduto = \$this->dinheiro - \$this->preçoProduto;
return \$this->totalProduto;
}

}

?>
``````