if(strpos($ _ SERVER ['REQUEST_URI'],“/ arr /”)!== false){
}
我尝试了上述条件。
http://localhost/wordpress/arr/ =>执行
http://localhost/wordpress/arr/sample-page/ =>没有执行
我也想为第二个执行它。
请告知。
感谢。
答案 0 :(得分:0)
试试这个它会起作用。
import cv2
cap = cv2.VideoCapture("video.mp4")
Cascade = cv2.CascadeClassifier("haarCasade.xml")
while(True):
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
答案 1 :(得分:0)
这可能是一个解决方案:
<html ng-app="Swabhav.ServiceApp">
<head>
<title> Factory Pattern </title>
<script src="angular.js"></script>
</head>
<body>
var oneModule=angular.module("Swabhav.ServiceApp",[]);
oneModule.factory("MathService",["$log",function($log){
$log.log("Inside Math Service");
var techlabs=function(){
var obj={};
obj.isPrime=function(number){
for(var index=2;index<number;index++){
if(number%index==0){
console.log("Is not a prime number");
$log.log("inside $log - is not a prime");
return false;
}
return true;
}
}
obj.isCubeEvenNo=function(number){
var cube=(number*number*number);
if(cube%2==0){
console.log("cube is even");
$log.log("inside $log - is not a even number");
return true;
}
return false;
}
return obj;
};
}]);
oneModule.controller("FirstController",
["$scope","MathService",function($scope){
console.log($scope.isPrime(10));
console.log($scope.isPrime(13));
}]);
oneModule.controller("SecondController",
["$scope","MathService",function($scope){
console.log($scope.isCubeEvenNo(2));
console.log($scope.isCubeEvenNo(7));
}]);
<div ng-controller="FirstController">
<input type="text" ng-model="forprime">
<button type="button" ng-
click="techlabs.isPrime(forprime)">Check</button>
</div>
</body>
</html>