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

PHP Basics For Beginners - Coding Point and solutions


What is PHP?

PHP stands for PHP: Hypertext Preprocessor is widely used as Open Source as general purpose scripting language that is especially suited for web development and can be embedded in HTML. 

PHP was created by RasmusLerdorf in 1995 as PHP/FI [Personal Home Page/Form Interpreter] with simple set of Perl Scripts for tracking accesses to his online resume. 

In November 1997 PHP/FI 2.0 was officially released with C Language implementation, and cult of several thousand users around the world with approximately 50,000 domains. 

Shortly PHP 3.0 as we know it today was created by AndiGutmans and ZeevSuraski as complete rewrite, after they found PHP/FI 2.0 has several underpowered function for developing and eCommerce application they were working on for University Project.

By the end of 1998, PHP grew to an install base of tens of thousands of users (estimated) and hundreds of thousands of Web Sites reporting it installed. About 10% of the Web Servers on the internet. 

Anything PHP is mainly focused on server side scripting, so you can do anything any other CGI program can do, such as collect form data, generate dynamic page content, or send and receive cookies and many more.

 

POWER OF PHP  

 
Windows desktop applications can also be written, PHP is probably not the very best language to create a desktop application with graphical user interface, but if know PHP very well and would like to use some advanced PHP features in your client side application you can also use PHP-GTK. 

PHP can be used on all major operating systems such as Linux, UNIX variants, Microsoft Windows, Mac OS X, RISC OS and others.

With PHP you are not limited to output HTML. It has abilities also to outputting images, PDF files and even Flash movies generated on the fly.You can also output easily and text such as XHTML and any other XML file.  

  COMMON USES OF PHP

PHP performs system functions, i.e. from files on a system it can create, open, read, write, and close them.
  
PHP can handle forms, i.e. gather data from files, save data to a file, thru email you can send data, return data to the user.
  
You add, delete, and modify elements within your database thru PHP.  Access cookies variables and set cookies.
 
Using PHP, you can restrict users to access some pages of your website.  It can encrypt data. 
 
 

Comments

Popular posts from this blog

MongoDB Exercises Practice Solution Exercise First

How to create Pagination with PHP and MySql - Codingpoint

Simple Basic Commands For MongoDB