SlideShare a Scribd company logo
INTRO TO SERVER SIDE PROGRAMMING
Lesson Three
Friday, September 13, 13
Recap - What Have We Found?
Literals
boolean - True/False
integer
float - decimal numbers
string - text
array - ordered key/value pairs
object - literal within class
Null - no value
Friday, September 13, 13
Recap Continued
Operators
Arithmetic - $newvalue = $oldvalue + 1;
Assignment - $newervalue = 10;
Comparison - $newvalue != $oldvalue;
String Operators
var_dump('foo' . 'bar');
$a = 'foo'; a .= 'bar';
var_dump($a);
Friday, September 13, 13
Order of Operations
PHP (and most languages) follows Operator
Precedence rules
These allow for unambiguous statements
Parentheses can be used to override default
Operator Precedence or to add visual clarity
$taxable_income = $wages + $earnings - $deductions;
$taxable_income = $wages + ( $earnings - $deductions );
Friday, September 13, 13
Programming Blocks
Blocks are sections of code grouped together
Blocks consist of declarations and statements
PHP organizes statements into blocks with { }
Conventions dictate indentation for readability
{$foo=$bar+$bat;echo $foo;}
{
$foo = $bar + $bat;
echo $foo;
}
Friday, September 13, 13
Coding Conventions
A set of guidelines for a specific programming
language of recommended styles, practices &
methods for each aspect of a program
Covers things like file organization, indentation,
comments, declarations, statements, white space,
naming conventions, practices & principles
This improves the readability of code and makes
software maintenance easier.
Conventions enforced by humans, not compilers
Friday, September 13, 13
Ease of Reading/Ease of Use
$UP=6;DN=19;$x=0;
while(++$x<=24){echo "hour $x: "; if($x>+$UP&&$X<+$DN);
echo "sun is up"; else echo "sun is down": echo "n"; }
define( 'SUNRISE', 6 );
define( 'SUNSET', 19 );
$hours = range( 1, 24);
foreach ( $hours as $hour ) {
// ternary operation
$up_or_down = ( (
$hour >= SUNRISE and
$hour <= SUNSET
) ? 'up' : 'down' );
echo "hour {$hour}: ",
"sun is {$up_or_down}",
"n";
}
Friday, September 13, 13
ASSIGNMENT 3.1
Good Code, Bad Code
Friday, September 13, 13
Good Code, Bad Code
Log in to Github, then into Cloud9 Using Github
Look through your forked projects for a block
(~100) lines of code that are either very hard or
very easy to read based on the coding style
Copy & paste into a file named assignment-4.1.md
Make a list with your partner of ways that the code
style could be improved in each of your examples
Save files to share with the class. Push to Github?
(https://help.github.com/articles/create-a-repo)
Friday, September 13, 13
Git and Github - Here to Help
Git is your robot friend that remembers what you
tell it to remember, and only that
This robot recognizes when things have changed
It knows how to remember, just not when
Git can tell you what changed and when, you use
comments to tell it (and yourself) why
If you ask nicely (-h or --help) the robot will help
This robot is well organized and can track
branches of changed code
Friday, September 13, 13
Basic git Commands
git branch - what branches are there & which am I on?
git status - what files have I changed or created?
git add (files) - consider this stuff for remembering
git commit (files) - I really want you to remember what I've
considered via git add
git push [remote [branch] ] - tell the robot named
"remote" (default is "origin") about my changes in
"branch" (default is "master")
git fetch [remote] - ask the robot named "remote" for changes or
branches that you don't know about yet
git merge [branch] - attempt to combine changes in "branch"
Friday, September 13, 13
ASSIGNMENT 3.2
fetch and merge
Friday, September 13, 13
Let's Merge Again
In Cloud 9:
git remote add upstream 
https://github.com/vc-dig1108-fall-2013/assignments.git
git fetch upstream
git merge upstream/master
Open the file named "homework-4.1.md"
Add your name to bottom of the file and save
Commit the file & push to your Github acct. (hint: "origin")
https://help.github.com/articles/create-a-repo
https://help.github.com/articles/fork-a-repo
Friday, September 13, 13

More Related Content

What's hot

Linux shell script-1
Linux shell script-1Linux shell script-1
Linux shell script-1
兎 伊藤
 
Functuon
FunctuonFunctuon
Functuon
NithyaNithyav
 
The most exciting features of PHP 7.1
The most exciting features of PHP 7.1The most exciting features of PHP 7.1
The most exciting features of PHP 7.1
Zend by Rogue Wave Software
 
Linux class 15 26 oct 2021
Linux class 15   26 oct 2021Linux class 15   26 oct 2021
Linux class 15 26 oct 2021
Khawar Nehal khawar.nehal@atrc.net.pk
 
basic shell_programs
 basic shell_programs basic shell_programs
basic shell_programs
madhugvskr
 
Vim Hacks
Vim HacksVim Hacks
Vim Hacks
Lin Yo-An
 
Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)
James Titcumb
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
Sway Wang
 
CODING WITH PYTHON PART 1
CODING WITH PYTHON PART 1CODING WITH PYTHON PART 1
CODING WITH PYTHON PART 1
Buxoo Abdullah
 
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!..."A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
akaptur
 
Let's golang
Let's golangLet's golang
Let's golang
SuHyun Jeon
 
Functional perl
Functional perlFunctional perl
Functional perl
Errorific
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
akaptur
 
次世代PHPフレームワーク Symfony2
次世代PHPフレームワーク Symfony2次世代PHPフレームワーク Symfony2
次世代PHPフレームワーク Symfony2
Masao Maeda
 
symfony & jQuery (PUG)
symfony & jQuery (PUG)symfony & jQuery (PUG)
symfony & jQuery (PUG)
Massimiliano Arione
 
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges
✅ William Pinaud
 
Formatted Console I/O Operations in C++
Formatted Console I/O Operations in C++Formatted Console I/O Operations in C++
Formatted Console I/O Operations in C++
sujathavvv
 
Mouse programming in c
Mouse programming in cMouse programming in c
Mouse programming in c
gkgaur1987
 
Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015
Lin Yo-An
 

What's hot (19)

Linux shell script-1
Linux shell script-1Linux shell script-1
Linux shell script-1
 
Functuon
FunctuonFunctuon
Functuon
 
The most exciting features of PHP 7.1
The most exciting features of PHP 7.1The most exciting features of PHP 7.1
The most exciting features of PHP 7.1
 
Linux class 15 26 oct 2021
Linux class 15   26 oct 2021Linux class 15   26 oct 2021
Linux class 15 26 oct 2021
 
basic shell_programs
 basic shell_programs basic shell_programs
basic shell_programs
 
Vim Hacks
Vim HacksVim Hacks
Vim Hacks
 
Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 
CODING WITH PYTHON PART 1
CODING WITH PYTHON PART 1CODING WITH PYTHON PART 1
CODING WITH PYTHON PART 1
 
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!..."A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
 
Let's golang
Let's golangLet's golang
Let's golang
 
Functional perl
Functional perlFunctional perl
Functional perl
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
 
次世代PHPフレームワーク Symfony2
次世代PHPフレームワーク Symfony2次世代PHPフレームワーク Symfony2
次世代PHPフレームワーク Symfony2
 
symfony & jQuery (PUG)
symfony & jQuery (PUG)symfony & jQuery (PUG)
symfony & jQuery (PUG)
 
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges
 
Formatted Console I/O Operations in C++
Formatted Console I/O Operations in C++Formatted Console I/O Operations in C++
Formatted Console I/O Operations in C++
 
Mouse programming in c
Mouse programming in cMouse programming in c
Mouse programming in c
 
Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015
 

Viewers also liked

DIG1108 Lesson 5
DIG1108 Lesson 5DIG1108 Lesson 5
DIG1108 Lesson 5
vc-dig1108-fall-2013
 
Spanish verbs friends
Spanish verbs friendsSpanish verbs friends
Spanish verbs friends
Savanna_Llynnn
 
DIG1108 Lesson 4
DIG1108 Lesson 4DIG1108 Lesson 4
DIG1108 Lesson 4
vc-dig1108-fall-2013
 
DIG1108 Lesson 6
DIG1108 Lesson 6DIG1108 Lesson 6
DIG1108 Lesson 6
vc-dig1108-fall-2013
 
Live virtual machine migration based on future prediction of resource require...
Live virtual machine migration based on future prediction of resource require...Live virtual machine migration based on future prediction of resource require...
Live virtual machine migration based on future prediction of resource require...
Tapender Yadav
 
Dig1108C Lesson 2
Dig1108C Lesson 2Dig1108C Lesson 2
Dig1108C Lesson 2
vc-dig1108-fall-2013
 
DIG1108 Lesson 8
DIG1108 Lesson 8DIG1108 Lesson 8
DIG1108 Lesson 8
vc-dig1108-fall-2013
 
Dig1108 c lesson1
Dig1108 c lesson1Dig1108 c lesson1
Dig1108 c lesson1
vc-dig1108-fall-2013
 
Separata protoracionalismo
Separata protoracionalismoSeparata protoracionalismo
Separata protoracionalismo
Harold Navarro Palacios
 

Viewers also liked (9)

DIG1108 Lesson 5
DIG1108 Lesson 5DIG1108 Lesson 5
DIG1108 Lesson 5
 
Spanish verbs friends
Spanish verbs friendsSpanish verbs friends
Spanish verbs friends
 
DIG1108 Lesson 4
DIG1108 Lesson 4DIG1108 Lesson 4
DIG1108 Lesson 4
 
DIG1108 Lesson 6
DIG1108 Lesson 6DIG1108 Lesson 6
DIG1108 Lesson 6
 
Live virtual machine migration based on future prediction of resource require...
Live virtual machine migration based on future prediction of resource require...Live virtual machine migration based on future prediction of resource require...
Live virtual machine migration based on future prediction of resource require...
 
Dig1108C Lesson 2
Dig1108C Lesson 2Dig1108C Lesson 2
Dig1108C Lesson 2
 
DIG1108 Lesson 8
DIG1108 Lesson 8DIG1108 Lesson 8
DIG1108 Lesson 8
 
Dig1108 c lesson1
Dig1108 c lesson1Dig1108 c lesson1
Dig1108 c lesson1
 
Separata protoracionalismo
Separata protoracionalismoSeparata protoracionalismo
Separata protoracionalismo
 

Similar to Dig1108 Lesson 3

Maintaining your own branch of Drupal core
Maintaining your own branch of Drupal coreMaintaining your own branch of Drupal core
Maintaining your own branch of Drupal core
drumm
 
Empezando con Twig
Empezando con TwigEmpezando con Twig
Empezando con Twig
Ismael Ambrosi
 
07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards
Denis Ristic
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
Kang-min Liu
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous php
Wim Godden
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous php
Wim Godden
 
Objects, Testing, and Responsibility
Objects, Testing, and ResponsibilityObjects, Testing, and Responsibility
Objects, Testing, and Responsibility
machuga
 
jQuery Performance Rules
jQuery Performance RulesjQuery Performance Rules
jQuery Performance Rules
nagarajhubli
 
Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
Lars Jankowfsky
 
Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)
aasarava
 
Modern Perl
Modern PerlModern Perl
Modern Perl
Dave Cross
 
Fewd week5 slides
Fewd week5 slidesFewd week5 slides
Fewd week5 slides
William Myers
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
Dave Cross
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)
Michael Schwern
 
Symfony console: build awesome command line scripts with ease
Symfony console: build awesome command line scripts with easeSymfony console: build awesome command line scripts with ease
Symfony console: build awesome command line scripts with ease
Oscar Merida
 
Functional Pearls 4 (YAPC::EU::2009 remix)
Functional Pearls 4 (YAPC::EU::2009 remix)Functional Pearls 4 (YAPC::EU::2009 remix)
Functional Pearls 4 (YAPC::EU::2009 remix)
osfameron
 
Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)
andrewnacin
 
Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5
Stephan Schmidt
 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java Developers
Andres Almiray
 
PHP: The easiest language to learn.
PHP: The easiest language to learn.PHP: The easiest language to learn.
PHP: The easiest language to learn.
Binny V A
 

Similar to Dig1108 Lesson 3 (20)

Maintaining your own branch of Drupal core
Maintaining your own branch of Drupal coreMaintaining your own branch of Drupal core
Maintaining your own branch of Drupal core
 
Empezando con Twig
Empezando con TwigEmpezando con Twig
Empezando con Twig
 
07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous php
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous php
 
Objects, Testing, and Responsibility
Objects, Testing, and ResponsibilityObjects, Testing, and Responsibility
Objects, Testing, and Responsibility
 
jQuery Performance Rules
jQuery Performance RulesjQuery Performance Rules
jQuery Performance Rules
 
Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
 
Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)Smarter Interfaces with jQuery (and Drupal)
Smarter Interfaces with jQuery (and Drupal)
 
Modern Perl
Modern PerlModern Perl
Modern Perl
 
Fewd week5 slides
Fewd week5 slidesFewd week5 slides
Fewd week5 slides
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)
 
Symfony console: build awesome command line scripts with ease
Symfony console: build awesome command line scripts with easeSymfony console: build awesome command line scripts with ease
Symfony console: build awesome command line scripts with ease
 
Functional Pearls 4 (YAPC::EU::2009 remix)
Functional Pearls 4 (YAPC::EU::2009 remix)Functional Pearls 4 (YAPC::EU::2009 remix)
Functional Pearls 4 (YAPC::EU::2009 remix)
 
Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)
 
Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5
 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java Developers
 
PHP: The easiest language to learn.
PHP: The easiest language to learn.PHP: The easiest language to learn.
PHP: The easiest language to learn.
 

Recently uploaded

GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 

Recently uploaded (20)

GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 

Dig1108 Lesson 3

  • 1. INTRO TO SERVER SIDE PROGRAMMING Lesson Three Friday, September 13, 13
  • 2. Recap - What Have We Found? Literals boolean - True/False integer float - decimal numbers string - text array - ordered key/value pairs object - literal within class Null - no value Friday, September 13, 13
  • 3. Recap Continued Operators Arithmetic - $newvalue = $oldvalue + 1; Assignment - $newervalue = 10; Comparison - $newvalue != $oldvalue; String Operators var_dump('foo' . 'bar'); $a = 'foo'; a .= 'bar'; var_dump($a); Friday, September 13, 13
  • 4. Order of Operations PHP (and most languages) follows Operator Precedence rules These allow for unambiguous statements Parentheses can be used to override default Operator Precedence or to add visual clarity $taxable_income = $wages + $earnings - $deductions; $taxable_income = $wages + ( $earnings - $deductions ); Friday, September 13, 13
  • 5. Programming Blocks Blocks are sections of code grouped together Blocks consist of declarations and statements PHP organizes statements into blocks with { } Conventions dictate indentation for readability {$foo=$bar+$bat;echo $foo;} { $foo = $bar + $bat; echo $foo; } Friday, September 13, 13
  • 6. Coding Conventions A set of guidelines for a specific programming language of recommended styles, practices & methods for each aspect of a program Covers things like file organization, indentation, comments, declarations, statements, white space, naming conventions, practices & principles This improves the readability of code and makes software maintenance easier. Conventions enforced by humans, not compilers Friday, September 13, 13
  • 7. Ease of Reading/Ease of Use $UP=6;DN=19;$x=0; while(++$x<=24){echo "hour $x: "; if($x>+$UP&&$X<+$DN); echo "sun is up"; else echo "sun is down": echo "n"; } define( 'SUNRISE', 6 ); define( 'SUNSET', 19 ); $hours = range( 1, 24); foreach ( $hours as $hour ) { // ternary operation $up_or_down = ( ( $hour >= SUNRISE and $hour <= SUNSET ) ? 'up' : 'down' ); echo "hour {$hour}: ", "sun is {$up_or_down}", "n"; } Friday, September 13, 13
  • 8. ASSIGNMENT 3.1 Good Code, Bad Code Friday, September 13, 13
  • 9. Good Code, Bad Code Log in to Github, then into Cloud9 Using Github Look through your forked projects for a block (~100) lines of code that are either very hard or very easy to read based on the coding style Copy & paste into a file named assignment-4.1.md Make a list with your partner of ways that the code style could be improved in each of your examples Save files to share with the class. Push to Github? (https://help.github.com/articles/create-a-repo) Friday, September 13, 13
  • 10. Git and Github - Here to Help Git is your robot friend that remembers what you tell it to remember, and only that This robot recognizes when things have changed It knows how to remember, just not when Git can tell you what changed and when, you use comments to tell it (and yourself) why If you ask nicely (-h or --help) the robot will help This robot is well organized and can track branches of changed code Friday, September 13, 13
  • 11. Basic git Commands git branch - what branches are there & which am I on? git status - what files have I changed or created? git add (files) - consider this stuff for remembering git commit (files) - I really want you to remember what I've considered via git add git push [remote [branch] ] - tell the robot named "remote" (default is "origin") about my changes in "branch" (default is "master") git fetch [remote] - ask the robot named "remote" for changes or branches that you don't know about yet git merge [branch] - attempt to combine changes in "branch" Friday, September 13, 13
  • 12. ASSIGNMENT 3.2 fetch and merge Friday, September 13, 13
  • 13. Let's Merge Again In Cloud 9: git remote add upstream https://github.com/vc-dig1108-fall-2013/assignments.git git fetch upstream git merge upstream/master Open the file named "homework-4.1.md" Add your name to bottom of the file and save Commit the file & push to your Github acct. (hint: "origin") https://help.github.com/articles/create-a-repo https://help.github.com/articles/fork-a-repo Friday, September 13, 13