1 Gentle Introduction to Programming Tirgul 1: Shell and Scala “hands on” in the lab.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Lab III – Linux at UMBC.
Zhang Hongyi CSCI2100B Data Structures Tutorial 2
1 Lab Session-II CSIT 121 Fall 2000 Visual Studio Introduction Lab-1 Explanation and Demos Debugging Tips How to add new files to your projects How many.
George Blank University Lecturer. Creating A Web Site at NJIT Professor Blank.
Integrated Development Environments. Today We Will: Go over more advanced functionality of Eclipse. Break up into teams to work on presentation and final.
1 Gentle Introduction to Programming Session 2: Functions.
CS 110 Intro to Computer Science I Sami Rollins Fall 2006.
1 Gentle Introduction to Programming Session 3: Higher Order Functions, Recursion.
1 Gentle Introduction to Programming Session 3: Recursion.
CS 101 Problem Solving and Structured Programming in C Sami Rollins Spring 2003.
1 Basics of Linux On linux machine: Login at your home directory Open a “shell” or “terminal” or “xterm” workspace (4) On windows machine Intall linux.
1 Gentle Introduction to Programming Tirgul 2: Scala “hands on” in the lab.
1 Gentle Introduction to Programming Session 2: Functions.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
1 Introduction to Java Brief history of Java Sample Java Program Compiling & Executing Reading: => Section 1.1.
Introduction to Parallel Programming with C and MPI at MCSR Part 2 Broadcast/Reduce.
Drexel University Software Engineering Research Group 1 Eclipse for SE101.
1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience.
GNU Compiler Collection (GCC) and GNU C compiler (gcc) tools used to compile programs in Linux.
Compiling & Debugging Quick tutorial. What is gcc? Gcc is the GNU Project C compiler A command-line program Gcc takes C source files as input Outputs.
Writing Scala Programs. Command Line There are three common operating systems: Windows (various flavors; I recommend Windows 7) UNIX or Linux (basically.
Chapter 9: MuPAD Programming II Procedures MATLAB for Scientist and Engineers Using Symbolic Toolbox.
CSE 332: C++ debugging in Eclipse C++ Debugging in Eclipse We’ve now covered several key program features –Variable declarations, expressions and statements.
Our Environment We will exercise on Microsoft Visual C++ v.6 We will exercise on Microsoft Visual C++ v.6 because that is what we have in the univ. because.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
Active-HDL Interfaces Debugging C Code Course 10.
OpenModelica Eclipse Setup
CSS Linux and Eclipse 1. CSS Account Log into your CSS account with the NoMachine client (NX client) 2.
Welcome To Eclipse. Basic Concepts Workspace – directory where your projects are stored –Projects grouping of related works –Resources generic term to.
9/2/ CS171 -Math & Computer Science Department at Emory University.
1 C Programming Week 2 Variables, flow control and the Debugger.
CSE 232: C++ Programming in Visual Studio Graphical Development Environments for C++ Eclipse –Widely available open-source debugging environment Available.
CSE 232: C++ debugging in Visual Studio and emacs C++ Debugging (in Visual Studio and emacs) We’ve looked at programs from a text-based mode –Shell commands.
Mobile Programming Lecture 3 Debugging. Lecture 2 Review What widget would you use to allow the user to enter o a yes/no value o a range of values from.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
1 Getting Started with C++ Part 2 Linux. 2 Getting Started on Linux Now we will look at Linux. See how to copy files between Windows and Linux Compile.
Install CB 1.8 on Ubuntu. Steps Followed Install Ubuntu (Ubuntu LTS) on Virtual machine – (VMware Workstation) (
CMSC 104, Version 8/061L14AssignmentOps.ppt Assignment Operators Topics Increment and Decrement Operators Assignment Operators Debugging Tips Reading Section.
Chapter 2 Wrap Up 2/18/16 & 2/22/16. Topics Review for Exam I DecimalFormat More Style Conventions Debugging using eclipse The Java API.
1 Project 5: Leap Years. 222 Leap Years Write a program that reads an integer value from the user representing a year and determines if the year is a.
1 CS101 Fall 2001 Lecture 1 In order to write a program, you must first telnet to your pegasus account and login either from a Rutgers computer in a lab,
Debugging Lab Antonio Gómez-Iglesias Texas Advanced Computing Center.
 Prepared by: Eng. Maryam Adel Abdel-Hady
 Prepared by: Eng. Maryam Adel Abdel-Hady
Debugging using By: Samuel Ashby. What is debugging?  A bug is an error in either a program or the hardware itself.  Debugging is first locating and.
1 Using an Integrated Development Environment. Integrated Development Environments An Integrated Development Environment, or IDE, permits you to edit,
Linux CSE 1222 CSE1222: Lecture 1BThe Ohio State University1.
CSE 332: Scientific debugging in C++ Scientific Debugging in C++ (with Eclipse & gdb) By now we’ve covered several key C++ features –Variable declarations.
DEVRY CIS 170 C I L AB 1 OF 7 G ETTING S TARTED Check this A+ tutorial guideline at
Note: Some of the slides are repeated from Introduction to C++
Eclipse.
CS1010: Intro Workshop.
Development Environment Basics
Introduction to Programming
Testing and Debugging.
USING ECLIPSE TO CREATE HELLO WORLD
Lab 1 introduction, debrief
1. Open Visual Studio 2008.
Introduction Paul Flynn
Debugging at Scale.
Our Environment We will exercise on Microsoft Visual C++ v.6
Introduction to Java Brief history of Java Sample Java Program
How to debug a website using IE F12 tools
Preparation for Assignment 2
Debugging.
Presentation transcript:

1 Gentle Introduction to Programming Tirgul 1: Shell and Scala “hands on” in the lab

2 Today Login to your account Your Account, basic Linux commands Using the interpreter Eclipse – “Hello World!” Understanding compiler messages Eclipse: Command line arguments Debugger Home work – practice Shell commands

3 Today Login to your account Your Account, basic Linux commands Using the interpreter Eclipse – “Hello World!” Understanding compiler messages Eclipse: Command line arguments Debugger Home work – practice Shell commands

4 Your Account, Basic Linux Commands User’s account: to log in select session: GNOME Web browser Open the “system handouts” file from the course’s site (in the session’s section) Shell / Console

5 Basic Linux Commands

6 Security (chmod)

7 Today Login to your account Your Account, basic Linux commands Using the interpreter Eclipse – “Hello World!” Understanding compiler messages Eclipse: Command line arguments Debugger Home work – practice Shell commands

8 Using the Interpreter Type “scala” from the console Start trying some basic commands: println(“hello world!”) val x = 5 var y = 1.4 Define a function that receives two integers and return their sum. Use it on several inputs.

9 Today Login to your account Your Account, basic Linux commands Using the interpreter Eclipse – “Hello World!” Understanding compiler messages Eclipse: Command line arguments Debugger Home work – practice Shell commands

10 Eclipse Type “eclipse35 &” from the console Use a workspace located on your account How to solve common technical problems: “ Clean” your eclipse by removing the.eclipse directory (rm –R.eclipse, from your root) Start a new workspace / remove the old one

11 Open Eclipse – Set Workspace

12 Open Eclipse

13 Define New Project

14 If you don’t find the Scala new project… File  New  Project

15 New Object

16 Write Some Code

17 Run output

18 Today Login to your account Your Account, basic Linux commands Using the interpreter Eclipse – “Hello World!” Understanding compiler messages Eclipse: Command line arguments Debugger Home work – practice Shell commands

19 Understanding Compiler Messages Open the interpreter, try the following lines of code, and try to understand what the compiler means, and how to solve it val x = 5 x = 6 Println(“123”) val f = (x : Int => x + 1) if x > f(x) x = 9 val f = (x : int) => x + 1

20 And In Eclipse Select and copy a program of your choice to Eclipse How are compilation errors marked in Eclipse? Perform compilation errors purposely and see how the compiler’s errors look like: Change an upper-case letter to lower case Remove a closing brackets Where are the compiled files?

21 Today Login to your account Your Account, basic Linux commands Using the interpreter Eclipse – “Hello World!” Understanding compiler messages Eclipse: Command line arguments Debugger Home work – practice Shell commands

22 Command Line Arguments In Eclipse

23 Command Line Arguments In Eclipse

24 Usage Example ? Fibonacci.scala

25 Example: Prime Write a program that receives from the command line arguments a list of numbers, and prints out for each whether it is prime Use the prime code that is published, and wrap it as a function Notice, that the number of arguments is not known in advance!

26 The Debugger Some programs may compile correctly, yet not produce the desirable results These programs are valid and correct Scala programs, yet not the programs we meant to write! The debugger can be used to follow the program step by step and may help detecting bugs in an already compiled program

27 Debugger – Add Breakpoint Right click on the desired line “Toggle Breakpoint”

28 Debugger – Start Debugging breakpoint debug

29 Debugger – Debug Perspective

30 Debugger – Debugging Current state Current location Back to Scala perspective

31 Today Login to your account Your Account, basic Linux commands Using the interpreter Eclipse – “Hello World!” Understanding compiler messages Eclipse: Command line arguments Debugger Home work – practice Shell commands

32 Home Work - Shell