Posts

Showing posts from August, 2019

Artificial Intelligence Programs For Programming in Python

Traveling Salesman Problem ( TSP )] Artificial Intelligence Programs For Master Leval Programming in Python from iter tools import permutations def distance(point1, point2): >>> distance([3,4],[0,0]) 5.0 >>> distance([3,6],[10,6]) 7.0 return ((point1[0] - point2[0])**2 + (point1[1] - point2[1])**2) ** 0.5 def total_distance(points): all the points are in the given order. >>> total_distance([[1,2],[4,6]]) 5.0 >>> total_distance([[3,6],[7,6],[12,6]]) 9.0 return sum([distance(point, points[index + 1]) for index, point in enumerate(points[:-1])]) def travelling_salesman(points, start=None): Time complexity is O(N!), so never use on long lists. >>> travelling_salesman([[0,0],[10,0],[6,0]]) ([0, 0], [6, 0], [10, 0]) >>> travelling_salesman([[0,0],[6,0],[2,3],[3,7],[0.5,9],[3,5],[9,1]]) ([0, 0], [6, 0], [9, 1], [2, 3], [3, 5], [3, 7], [0.5, 9]) """ if the start is None: start = points[0] return min([perm for perm ...

PayPal PHP Website Integration Source Code - C4U

Image
PAYMENT GATE WAY IN PHP PAYPAL <?php include('header.php');       include('paypal_config.php');       $_SESSION['EXPRESS_MARK'] = NULL; ?>    <div class="span5">             <!--Form containing item parameters and seller credentials needed for SetExpressCheckout Call-->             <form class="form" action="paypal_ec_redirect.php" method="POST">                <div class="row-fluid">                   <div class="span6 inner-span">                         <!--Demo Product details -->    ...

How To Create Autocomplete on an Input Field PHP - C4U

Image
AutoComplete search in PHP ⇒ How To Create Autocomplete on an Input Field PHP? >> create one index.php file look like below >> Add Script Below in head tag <script type="text/javascript" src="jquery-1.8.0.min.js"></script> <script type="text/javascript"> $(function(){ $(".search").keyup(function()  {  var searchid = $(this).val(); var dataString = 'search='+ searchid; if(searchid!='') { $.ajax({ type: "POST", url: "search.php", data: dataString, cache: false, success: function(html) { $("#result").html(html).show(); } }); }return false;     }); }); </script> >> Add CSS Below in head tag <style type="text/css"> body{  font-family:Tahoma, Geneva, sans-serif; font-size:18px; display: table; margin: 0 auto; } .content{ width:900px; margin:0 auto; } #searchid { width:500px; border:soli...

How to Generate QR Code in PHP with jquery Learn Now

Image
How to Generate QR code in PHP? QR Code Generate in PHP Use Following Code  1 >> home.php <?php include "QR_BarCode.php"; $desc = $_POST['desc']; $kishan = ' WayToWeb'; $qr = new QR_BarCode(); $qr->text($desc." ".$kishan); $qr->qrCode(); ?> 2.>> index.php <html> <head> </head> <body> <center> <form method="post" action="home.php"> <textarea name="desc" cols="50" rows="5"></textarea> <br> <input type="submit" name="submit"> </form> </center> </body> </html> 3.>> QR_BarCode.php <?php class QR_BarCode{ private $googleChartAPI = 'http://chart.apis.google.com/chart'; private $codeData; public function url($url = n...