Gwt wouter
Upcoming SlideShare
Loading in...5
×
 

Gwt wouter

on

  • 645 views

first slides of CMD programming

first slides of CMD programming

Statistics

Views

Total Views
645
Views on SlideShare
645
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Gwt wouter Gwt wouter Presentation Transcript

  • PHP starter
      • install
      • variable
      • function call
      • array
      • for-loop
      • sum
      • if
    Wouter van der Ploeg, CMD, 2010
  • PHP starter
      • http://www.php5.org/
      • apache: http://httpd.apache.org/download.cgi#apache22
      • php: http://windows.php.net/download/
      • configuration:
      • http://www.thesitewizard.com/php/install-php-5-apache-windows.shtml
      • important: httpd.conf in /.../apache2.2/conf and php-files in /.../apache2.2/htdocs
      • OR
      • http://www.wampserver.com/en/index.php
      • php-files in /.../wamp/www
    Wouter van der Ploeg, CMD, 2010
  • PHP starter every php program <?php //start // body ?> //end Wouter van der Ploeg, CMD, 2010
  • PHP example 1 <html> <head> <title>PHP Test</title> </head> <body> <?php echo '<p>Hello World</p>'; ?> </body> </html> Output: Wouter van der Ploeg, CMD, 2010
  • PHP example 2 <?php echo '<p>Hello World</p>'; ?> Output: Wouter van der Ploeg, CMD, 2010
      • put text example2 in a file &quot;hello2.php&quot;
      • put the file &quot;hello2.php&quot; in /../../htdocs
      • (or if wamp in /.../wamp/www)
      • address browser = localhost/hello2.php
  • PHP example 3 <?php phpinfo(); ?> Output: Wouter van der Ploeg, CMD, 2010
  • PHP starter - function <?php phpinfo(); ?> Wouter van der Ploeg, CMD, 2010 function call
  • PHP starter - variable <?php $number = 2; $text = 'voorbeeld'; echo $text; echo $number; ?> Wouter van der Ploeg, CMD, 2010 variable value show value of $text Output ?
  • PHP starter - variable <?php $num1 = 3; $num2 = 7; echo $num1+$num2; echo $num1*$num2; ?> Wouter van der Ploeg, CMD, 2010 Output ?
  • PHP starter - variable <?php $num1 = 3; $num2 = 7; echo 'the sum is: '; echo $num1+$num2; echo '<br />'; echo 'the product is: '; echo $num1*$num2; ?> Wouter van der Ploeg, CMD, 2010 Output ?
  • PHP starter - array <?php $nums = array(1,2,3,4,5,6,7,8); print_r($nums); ?> Wouter van der Ploeg, CMD, 2010 Output ?
  • PHP starter - array Wouter van der Ploeg, CMD, 2010 Output: Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 ) value index
  • PHP starter - for-loop Wouter van der Ploeg, CMD, 2010 Output ? for-loop block for ($tel = 1; $tel <=10; $tel++) { echo $tel*$tel, ' '; } start end count
  • PHP starter - for-loop - sum Wouter van der Ploeg, CMD, 2010 Output ? $sum =0; for ($tel = 1; $tel <=10; $tel++) { $sum = $sum + $tel; } echo 'total sum =',$sum;
  • PHP starter - for-loop & array Wouter van der Ploeg, CMD, 2010 Output ? $nameArray = array('jan', 'kees', 'pieter', 'klaas', 'gerben'); for ($tel = 0; $tel <=4; $tel++) { echo $nameArray[$tel]; }
  • PHP starter - if Wouter van der Ploeg, CMD, 2010 Output ? <?php $number = 4; if ($number > 3) { echo $number, 'is larger then 3'; } ?>
  • PHP starter - if Wouter van der Ploeg, CMD, 2010 Output ? <?php $number = 4; if ($number > 3) { echo $number, 'is larger then 3'; } elseif ($number < 3) { echo $number, ' is smaller then 3'; } else { echo $number, ' is equal to 3'; } ?>
  • PHP starter - for-loop - if Wouter van der Ploeg, CMD, 2010 Output ? for ($tel = 1; $tel <=10; $tel++) { if ($tel % 2 == 0) { echo $tel*$tel, ' '; } }
  • PHP starter - for-loop - if Wouter van der Ploeg, CMD, 2010 Output ? function even($num) { if ($num % 2 == 0) return true; else return false; } for ($tel = 1; $tel <=10; $tel++) { if (even($tel)) { echo $tel*$tel, ' '; } }
  • PHP starter - if Wouter van der Ploeg, CMD, 2010 Output ? $nameArray = array('jan', 'kees', 'pieter', 'klaas', 'gerben'); for ($tel = 0; $tel <=4; $tel++) { $naam = $nameArray[$tel]; if (substr($naam, 0, 1) == 'k') { echo $nameArray[$tel]; }; }
  • PHP starter - assignments Wouter van der Ploeg, CMD, 2010
    • $nameArray = array('jan', 'kees', 'pieter', 'klaas', 'gerben');
      • write 3rd-powers of numbers from 1-99
      • show squares of even numbers (1-99)
      • show name if name is shorter then 5 char's
      • give list of names and their length. (look for function length of string)
      • give all the names in capitals
      • count names shorter then 5 char's
  • GWT Google Web Toolkit how to program for all browsers Wouter van der Ploeg, CMD, 2010
    • GWT JDK (java) Apache Ant GWT SDK
    Wouter van der Ploeg, CMD, 2010
    • Pyjamas (port of GWT) Python (>=2.4) pyjamas
    Wouter van der Ploeg, CMD, 2010
    • RubyJS (port of GWT) Ruby rubyjs
    Wouter van der Ploeg, CMD, 2010
  • GWT installation Wouter van der Ploeg, CMD, 2010
        • http://code.google.com/webtoolkit/gettingstarted.html
        • download & unpack gwt-2.0.3.zip (SDK)
        • download & install (if needed) JDK >= 1.5
        • download & unpack Ant 1.8.1
          • http://ant.apache.org/bindownload.cgi
          • Add the bin directory to your path (e.g. add to path ;D:GWTapache-ant-1.8.1in )
          • Set the ANT_HOME environment variable (e.g. ANT_HOME = D:GWTapache-ant-1.8.1 )
          • try in shell D: ant
          • if the answer is: Buildfile: build.xml does not exist!
          • Build failed
          • All is OK, ant is installed
        • test GWT go to
        • http://code.google.com/intl/nl-NL/webtoolkit/gettingstarted.html