jordan maxwell advanced programming. definitions php: a server side programming language often used...

11
Jordan Maxwell ADVANCED PROGRAMMING

Upload: dustin-obrien

Post on 27-Dec-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Jordan Maxwell ADVANCED PROGRAMMING. DEFINITIONS PHP: A server side Programming language often used in websites. API: ( Application programming interface

Jordan Maxwell

ADVANCED PROGRAMMING

Page 2: Jordan Maxwell ADVANCED PROGRAMMING. DEFINITIONS PHP: A server side Programming language often used in websites. API: ( Application programming interface

DEFINITIONS

• PHP: A server side Programming language often used in websites.

• API: (Application programming interface) is a chunk of code that a developer can hook into and use to communicate with the application.

Page 3: Jordan Maxwell ADVANCED PROGRAMMING. DEFINITIONS PHP: A server side Programming language often used in websites. API: ( Application programming interface

ABOUT MY PROJECTMy project has gone through several ideas and phases for a final product. Which ended with the Minecraft, Teamspeak, and web synchronization system.

• Originally the idea was to develop for a Mobile Ipad app. That was scrapped because I have never done anything with the language required for that.

• The Second idea was a java based game. This idea started out good but was scrapped because I was outside my range of experience. I later came back to this after everything else was done and nearly completed a game in Java

• The final idea was the web sync software. It was intended for use on a web site I was creating for a Minecraft Server. The idea was completed but needed to be re-written because it wasn’t very well planned out the first time.

Page 4: Jordan Maxwell ADVANCED PROGRAMMING. DEFINITIONS PHP: A server side Programming language often used in websites. API: ( Application programming interface

ESSENTIAL QUESTIONSEssential questions help us narrow our research for our projects. These were my essential questions for the final idea I ended up using

• How do I integrate several pieces of software into a web interface?

• How do I allow PHP to communicate with java?

• How do I use the TeamSpeak API?

Page 5: Jordan Maxwell ADVANCED PROGRAMMING. DEFINITIONS PHP: A server side Programming language often used in websites. API: ( Application programming interface

PROGRAMMING BASICS• Computers don’t understand English. So they have there own languages that they can

understand. Each language has its own benefits and disadvantages but all serve a practical purpose for some form of application.

• There are several types of Programming languages available. Some are for websites while others are for your phone or computer. There are also two sub types of languages: Server and Client. A server is something like a website or email. A client could be anything from your computer to your phone.

Page 6: Jordan Maxwell ADVANCED PROGRAMMING. DEFINITIONS PHP: A server side Programming language often used in websites. API: ( Application programming interface

WEB LANGUAGESThere are several Programming languages for using in websites. A few examples are

• PHP

• JavaScript

• Ruby on Rails

• Python

But the core of all websites is HTML And CSS. Without them the page would just be blank.

HTML is used to set the layout of the site. CSS is for creating the visual style of your website with it you can change for example how a button would look.

Page 7: Jordan Maxwell ADVANCED PROGRAMMING. DEFINITIONS PHP: A server side Programming language often used in websites. API: ( Application programming interface

WEB TO EXTERNAL SOFTWARE COMMUNICATION• What I intended to work on for this project needed to be able to cross communicate from

PHP to other software on the same Linux machine.

• During the project I expanded my knowledge on PHP sockets which what was needed for most of the software.

• This is also the primary technique for communicating with a java application.

Page 8: Jordan Maxwell ADVANCED PROGRAMMING. DEFINITIONS PHP: A server side Programming language often used in websites. API: ( Application programming interface

PHP SOCKET EXAMPLEThis is part of the code I created that used sockets to communicate with software. In this case It gathers information from a Minecraft server

if(!$socket = @stream_socket_client('tcp://'.$this->$host.':'.$this->$port, $errno, $errstr, $this->$timeout)) {

return false;} else {

stream_set_timeout($socket, $this->$timeout);fwrite($socket, "\xfe");$read = fread($socket, 2048);$read = str_replace("\x00", '', $read);$read = substr($read, 2);$data = explode("\xa7", $read);

Creating a socket connection

Read the information received from that connection

Page 9: Jordan Maxwell ADVANCED PROGRAMMING. DEFINITIONS PHP: A server side Programming language often used in websites. API: ( Application programming interface

TEAMSPEAKTeamSpeak is a free to use voice communications software. I use it to help staff members talk to each other when collaborating on a project or for our users to simply talk with one another without typing.

To do what I wanted for my project I needed to learn the abilities of the TeamSpeak API.

• I learned that almost all functionality can be achieved through the api such as The ability to check if a user is online and to pull there rank and change it remotely

• I also learned that I could get things like the server version so I could have a live check and notify the staff if the server needs to be updated.

• I also learned that the API is not as easy to use as I had hoped

Page 10: Jordan Maxwell ADVANCED PROGRAMMING. DEFINITIONS PHP: A server side Programming language often used in websites. API: ( Application programming interface

APPLICATION PROGRAMMING INTERFACEI used several APIs throughout this project. APIs are a common thing in everyday software development and they are present in just about everything you do on a computer. Some examples of every day API usage are

• A Facebook login on a mobile game or anything that uses Facebook

• Google chrome uses APIs for all its web store apps

• Things that use your Google drive.

These are only a few of the many things that use APIS.

Page 11: Jordan Maxwell ADVANCED PROGRAMMING. DEFINITIONS PHP: A server side Programming language often used in websites. API: ( Application programming interface

TEAMSPEAK API EXAMPLEI used the API in this example to allow the website to change the users rank on TeamSpeak.