AHS-TechClub-031913 - Avon High School Tech Crew

advertisement
V2012.13
Agenda
• Old Business
– Delete Files
• New Business
– Week 14 Topics:
• Upcoming Meeting Topics
• Intro to HTML/CSS
– Starts Next Week!
• Linux Scripts Review
• Introduction to Programming
Avon High School Tech Club
2
Upcoming Meeting Topics
•
•
•
•
•
Introduction to Programming
Arduino/Raspberry Pi/Embedded Projects
Building a PC
Configuring a Server
Introduction to Web Development
Avon High School Tech Club
3
Video: What Most Schools Don’t Teach …
Avon High School Tech Club
4
Intro to HTML/CSS
• First Session Starts Next Week
– Nine Weeks
• Exercises, Assignments
• What You’ll Learn
– HTML Basics
– CSS
• We’ll Use Code Academy
– http://www.codecademy.com/learn
– http://www.codecademy.com/tracks/afterschool-semester1
Avon High School Tech Club
5
Scripting Review
• Intro to Linux Review
– Scripts/scripting
Avon High School Tech Club
6
Create Your First Script
• Open a text editor
– Menu->Accessories->gedit
• Scripts always begin with:
#! /bin/bash
• Save your script (date.sh)
• Make the script executable
$ chmod +x date.sh
• Run your script
$ ./date.sh
Avon High School Tech Club
7
Create Your First Script
• Output
$ ./date.sh
Fri Mar 8 13:27:05 EST 2013
Avon High School Tech Club
8
Create Your First Script
• Your Challenge:
– Let’s add some features
• Display only the date
• Display the Day
Avon High School Tech Club
9
Create Your First Script
Avon High School Tech Club
10
Create Your First Script (date.sh)
• Output
$ ./date.sh
Today's date is: March 8
The day of the week is: Friday
The year is: 2013
The complete date is: Friday, March 8, 2013
Avon High School Tech Club
11
Create Your First Script (date.sh)
#!/bin/sh
echo -n "Today's date is: "; date +"%B %-d"
echo -n "The day of the week is: "; date +"%A"
echo -n "The year is: "; date +"%Y"
echo -n "The complete date is: "; date +"%A, %B %-d, %Y"
Avon High School Tech Club
12
Script to Display Memory (mem.sh)
#! /bin/bash
# Total memory space details
echo "Memory Space Details"
free -t -m | grep "Total" | awk '{ print "Total Memory space : "$2 " MB";
print "Used Memory Space : "$3" MB";
print "Free Memory : "$4" MB";
}'
echo "Swap memory Details"
free -t -m | grep "Swap" | awk '{ print "Total Swap space : "$2 " MB";
print "Used Swap Space : "$3" MB";
print "Free Swap : "$4" MB";
Avon High School Tech Club
13
Introduction to Programming
• Key Concepts
• Terms
• How do I get started?
Avon High School Tech Club
14
So, what is a program?
A computer is a tool for solving problems with data.
A program is a sequence of instructions that tell a
computer how to PERFORM a task.
Avon High School Tech Club
15
THINK OF A PROGRAM AS A RECIPE!
DATA
FLOW
TASKS
OUTCOME
Avon High School Tech Club
16
PROGRAMS …
Deal with data from various sources
(user input, file, the internet)
Determine a course of action
(based on this data)
Perform the appropriate action
Avon High School Tech Club
17
WHAT IS A PROGRAMMING LANGUAG
designed to communicate
instructions to a computer
Used to create programs
provide a better interface between
us (programmers) and the computer
Avon High School Tech Club
18
Types of Programming languages
HIGH-LEVEL LANGUAGES
CLOSER TO NATURAL LANGUAGES ... Dynamic languages
PROVIDES ABSTRACTION
(JAVA)
LOW-LEVEL LANGUAGES
CLOSEST TO MACHINE CODE
(ASSEMBLY LANGUAGE)
Avon High School Tech Club
19
Execution models …
COMPILED
STORES PROGRAMS IN MACHINE CODE … BINARY
(MACHINE CODE IS 1’S AND 0’S … IN WINDOWS .EXE)
INTERPRETED
STORES PROGRAMS IN ‘HUMAN READABLE’ FORM
(only a small number of instructions exist as machine code)
Avon High School Tech Club
20
HOW DO I BEGIN … tools
1. Text editor
Windows: notepad, linux: gedit, many editors available
IDE (integrated development environment)
Netbeans, eclipse, visual studio ($) … man y more
2. Ambition
Avon High School Tech Club
21
HOW DO I BEGIN … requirements
1. Identify the problem:
What problem does your program solve?
If you can't clearly state what your program does, you won't know how to
design it.
2. Identify the user:
Who's going to use your program?
Avon High School Tech Club
22
HOW DO I BEGIN … requirements
3. Determine the target platform
Is it a Windows computer, Mac, Linux, mobile, etc.
4. What skills will you need to develop
Are you going to write the entire thing yourself or get help from
others? If you're going to get others to help you, which parts of
the program are they going to write?
Avon High School Tech Club
23
Download