go-tutorial Documentation Release latest

Size: px
Start display at page:

Download "go-tutorial Documentation Release latest"

Transcription

1 go-tutorial Documentation Release latest Jun 04, 2017

2

3 Contents 1 Lesson 1: Introduction, installation and first code Introduction Links, bibliography Installation First code Project Solution Solution Solution Whetting you appetite i

4 ii

5 Contents: This tutorial approach to the Go programming language is higly personal: it handles the questions I ask myself when I study a new programming language. It works for me, let us hope it works for you as well. The emphasis is not so much on syntax but on answering questions, big and small, which cross my mind when I am learning and - when left unanswered - prevent me to work well with the language. Contents 1

6 2 Contents

7 CHAPTER 1 Lesson 1: Introduction, installation and first code Introduction This tutorial approach to the Go programming language is higly personal: it handles the questions I ask myself when I study a new programming language. It works for me, let us hope it works for you as well. The emphasis is not so much on syntax but on answering questions, big and small, which cross my mind when I am learning and - when left unanswered - prevent me to work well with the language. Why should you learn Go? Strangely enough, a tutorial, pretending to be big on answering questions, does not answer the very first one. I think, if you want to spend your time on learning a new language, you are likely to know the answer already. Moreover, as a side-effect of going through this tutorial, you will certainly note the ease with which Go handles concurrency, the quality of the tool set and the backwards compatibility of the language. This tutorial assumes you are already familiar with a programming language. Knowledge of Python would be a good basis to start this tutorial but others work as well. Note: I do not think that Go is a replacement of Python: changing Python for Go is like replacing a commuter s bicycle with a racing bicycle: only in particular circumstances a good idea! Links, bibliography The Go Programming Language Install the Go tools Effective Go The Go Programming Language Specification Package Documentation 3

8 Go in Action / William Kennedy with Brian Ketelsen and Erik St. Martin, Foreword by Steve Francia, November ISBN pages Programming in Go: Creating Applications for the 21st Century / Mark Summerfield - Published May 4, 2012 by Addison-Wesley Professional - ISBN Go Programming Language, The / Alan A. A. Donovan, Brian W. Kernighan - Published Nov 16, 2015 by Addison-Wesley Professional - ISBN Installation The Go Programming Language This tutorial handles Go 1.8+ Go is a pragmatic language: it tries to circumvent all kinds of essentially meaningless discussions (e.g. Where to place { and } in the code). Warning: Make the distinction between the Go specification and the workings of the Go tools which are installed on your computer. Working with the standard Go tools comes with a price: you develop your source code according to the way the Go designers intended it: you organise the code in a workspace. This workspace presents itself as a directory in your home directory with a standard name go. This directory contains the sub-directories: src: contains the source code bin: contains the generated binaries pkg: contains the compiled libraries Make sure that the directory containing the go binary is in your PATH Then: go env Note the value associated with GOPATH and make a subdirectory bin in that directory. Put this new directory also in your PATH Later we will come back to these directories and environment variables. First code Project The environment variable BROCADE_REGISTRY holds the name of a JSON file containing a simple key/value store. These are properties to use in your software: instead of hard-coding a value, we use a key (consisting of lowercase ASCII, digits and a MINUS symbol) that we associate with an actual value. In this project we will build a simple go based software which can query this key/value store. 4 Chapter 1. Lesson 1: Introduction, installation and first code

9 Solution 1 In the subdirectory src of GOPATH, make a directory brocade.be, and here a sub-directory rphilips (user your own userid). Finally, another directory delphi1 In this directory, create a file delphi1.go: 1 package main 2 3 import ( 4 "bufio" 5 "os" 6 "log" 7 "fmt" 8 "io/ioutil" 9 "encoding/json" 10 "strings" 11 ) var registry map[string]string func loadregistry() { 17 // retrieve location from environment variabel 18 registryfile := os.getenv("brocade_registry") 19 if registryfile == "" { 20 log.fatal("brocade_registry environment variable is not defined") 21 } // read file 24 b, err := ioutil.readfile(registryfile) 25 if err!= nil { 26 log.fatal(fmt.sprintf("cannot read file '%s' (BROCADE_REGISTRY environment variable)\n", registryfile), err) 27 } // interpret JSON 30 err = json.unmarshal(b, &registry) 31 if err!= nil { 32 log.fatal(fmt.sprintf("registry file '%s' does not contain valid JSON.\nUse registryfile), err) 33 } 34 } func main() { // load registry 40 loadregistry() reader := bufio.newreader(os.stdin) // loop and read until empty 45 for { 46 fmt.print("enter key: ") 47 key, err := reader.readstring('\n') 48 if err!= nil { 1.4. First code 5

10 49 log.fatal("cannot read from stdin") 50 } 51 key = strings.trimspace(key) 52 if key == "" { 53 break 54 } 55 value, ok := registry[key] 56 if!ok { 57 value = "?" 58 } 59 fmt.printf("%s -> %s\n\n", key, value) 60 } } Changing to the directory with delphi1.go go build go install try it: delphi1 Notes Line 1: Every Go file contains a package statement. The main package is used for executables Line 3: Import statement. The corresponding packages can be referenced by the last part of the impart string Line 13: Go is statically typed and compiled, so the type of every value has to be known at compile time. In Go, evry variable is initialised, even it is silent. Line 16: the basic structuring component is the function. Line 18: note how a name is referenced Line 24: Functions can return multiple values, the receiving and of the application has to capture as many values as are returned Line 30: Go can work with pointers without the drawback of the C language Line 37: package main needs a func main() Line 45: elegant and powerful way to code an infinite loop Some experiments insert a superfluous import and compile 1 import ( 2 "bufio" 3 "os" 4 "log" 5 "fmt" 6 "crypto/aes" 7 "io/ioutil" 8 "encoding/json" 6 Chapter 1. Lesson 1: Introduction, installation and first code

11 9 "strings" 10 ) remove package main remove func main() Solution 2 The previous solution does not allow for re-use: every application which needs the registry has to implement its own loadregistry() So, let us create a new directory: src/brocade.be/rphilips/registry and put a file registry.go: 1 package registry 2 3 import ( 4 "os" 5 "log" 6 "fmt" 7 "io/ioutil" 8 "encoding/json" 9 ) var Registry = loadregistry() func loadregistry() (registry map[string]string) { // retrieve location from environment variabel 17 registryfile := os.getenv("brocade_registry") 18 if registryfile == "" { 19 log.fatal("brocade_registry environment variable is not defined") 20 } // read file 23 b, err := ioutil.readfile(registryfile) 24 if err!= nil { 25 log.fatal(fmt.sprintf("cannot read file '%s' (BROCADE_REGISTRY environment variable)\n", registryfile), err) 26 } // interpret JSON 29 err = json.unmarshal(b, &registry) 30 if err!= nil { 31 log.fatal(fmt.sprintf("registry file '%s' does not contain valid JSON.\nUse registryfile), err) 32 } return 35 } Changing to the directory with registry.go go build go install 1.4. First code 7

12 Notes Line 1: the first line is the required package statement. The name of a registry is alsways an identifier and, by convention, lowercase Line 11: a name of a variable is intoduced here. Line 13: func loadregistry is defined with a named return value Line 34: the naked return, returns registry Some experiments remove package registry note the naked return Finally, let us create a directory: src/brocade.be/rphilips/delphi2 and put a file delphi2.go: 1 package main 2 3 import ( 4 "bufio" 5 "fmt" 6 "os" 7 "log" 8 "strings" 9 10 "brocade.be/rphilips/registry" 11 ) func main() { reader := bufio.newreader(os.stdin) for { 18 fmt.print("enter key: ") 19 key, err := reader.readstring('\n') 20 if err!= nil { 21 log.fatal("cannot read from stdin") 22 break; 23 } 24 key = strings.trimspace(key) 25 if key == "" { 26 break 27 } 28 value, ok := registry.registry[key] 29 if!ok { 30 value = "?" 31 } 32 fmt.printf("%s -> %s\n\n", key, value) 33 } 34 } Changing to the directory with delphi2.go go build go install 8 Chapter 1. Lesson 1: Introduction, installation and first code

13 try it: delphi2 Notes Line 10: the brocade.be/rphilips/registry library is imported. The name registry and all its exported items (those starting with an uppercase) are available to our program Line 28: the registry.registry is used Some experiments change in registry.go: var Registry map[string]string to var registry map[string]string and compile Solution 3 We can optimize this solution. Change registry.go to: 1 package registry 2 3 import ( 4 "os" 5 "log" 6 "fmt" 7 "io/ioutil" 8 "encoding/json" 9 ) var Registry map[string]string func init() { 15 registryfile := os.getenv("brocade_registry") 16 if registryfile == "" { 17 log.fatal("brocade_registry environment variable is not defined") 18 } 19 b, err := ioutil.readfile(registryfile) 20 if err!= nil { 21 log.fatal(fmt.sprintf("cannot read file '%s' (BROCADE_REGISTRY environment variable)\n", registryfile), err) 22 } 23 err = json.unmarshal(b, &Registry) 24 if err!= nil { 25 log.fatal(fmt.sprintf("registry file '%s' does not contain valid JSON.\nUse registryfile), err) 26 } } Changing to the directory with registry.go 1.4. First code 9

14 go build go install Changing to the directory with delphi2.go go build go install Changing to the directory with registry.go go build go install try it: delphi2 Notes Line 14: the func init() library is imported. There can be several of those func init() in a package (even in the same file). These functions have no arguments and no return values. But they are executed the moment their package is imported. Some experiments in registry.go, var Registry map[string]string after init(){...} in registry.go, put a second init(){...} after init(){...} Whetting you appetite Changing to the directory with delphi2.go, chose your poison: For MS-Windows: GOOS=windows GOARCH=amd64 go build For OSX: GOOS=darwin GOARCH=amd64 go build For linux: GOOS=linux GOARCH=amd64 go build and transfer the binary to an appropriate machine. Is this a UNIX machine, do not forget to set the execution permission: chmod +x delphi2 and try it: 10 Chapter 1. Lesson 1: Introduction, installation and first code

15 delphi Whetting you appetite 11

16 12 Chapter 1. Lesson 1: Introduction, installation and first code

17 Index B BROCADE_REGISTRY, 4 E environment variable BROCADE_REGISTRY, 4 GOPATH, 4, 5 PATH, 4 G GOPATH, 4, 5 P PATH, 4 13

William Kennedy. Brian Ketelsen Erik St. Martin Steve Francia FOREWORD BY MANNING WITH

William Kennedy. Brian Ketelsen Erik St. Martin Steve Francia FOREWORD BY MANNING WITH SAMPLE CHAPTER William Kennedy WITH FOREWORD BY Brian Ketelsen Erik St. Martin Steve Francia MANNING Go in Action by William Kennedy with Brian Ketelsen and Erik St. Martin Chapter 2 Copyright 2015 Manning

More information

Homework 5: Spatial Games : Programming for Scientists Due: Thursday, March 3, 2016 at 11:59 PM

Homework 5: Spatial Games : Programming for Scientists Due: Thursday, March 3, 2016 at 11:59 PM Homework 5: Spatial Games 02-201: Programming for Scientists Due: Thursday, March 3, 2016 at 11:59 PM 1. Reading Read Ch. 8 and Ch. 9 of An Introduction to Programming in Go (on pointers and structs).

More information

Lecture Overview Methods and Interfaces Methods review Interfaces Example: using the sort interface Anonymous fields in structs

Lecture Overview Methods and Interfaces Methods review Interfaces Example: using the sort interface Anonymous fields in structs 1 Lecture Overview Methods and Interfaces Methods review Interfaces Example: using the sort interface Anonymous fields in structs Generic printing using the empty interface Maps Creating a map Accessing

More information

Go Tutorial. Arjun Roy CSE 223B, Spring 2017

Go Tutorial. Arjun Roy CSE 223B, Spring 2017 Go Tutorial Arjun Roy arroy@eng.ucsd.edu CSE 223B, Spring 2017 Administrative details TA Office Hours: EBU3B B250A, Tuesday 5-7PM TA Email: arroy@eng.ucsd.edu All labs due by 2359 PDT. Lab 1 due: 4/13/2017.

More information

Introduzione a Go e RPC in Go

Introduzione a Go e RPC in Go Università degli Studi di Roma Tor Vergata Dipartimento di Ingegneria Civile e Ingegneria Informatica Introduzione a Go e RPC in Go Corso di Sistemi Distribuiti e Cloud Computing A.A. 2017/18 Valeria Cardellini

More information

Homework 6: Spatial Games Due: 11:59pm on Friday, October 30

Homework 6: Spatial Games Due: 11:59pm on Friday, October 30 02-201 Homework 6: Spatial Games Due: 11:59pm on Friday, October 30 1. Set up The set up is the basically the same as for homework 4. 1. Create a directory called go someplace (different than where you

More information

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories Chapter Two Exploring the UNIX File System and File Security Lesson A Understanding Files and Directories 2 Objectives Discuss and explain the UNIX file system Define a UNIX file system partition Use the

More information

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209 CSC209 Software Tools and Systems Programming https://mcs.utm.utoronto.ca/~209 What is this Course About? Software Tools Using them Building them Systems Programming Quirks of C The file system System

More information

The Go Programming Language. Frank Roberts

The Go Programming Language. Frank Roberts The Go Programming Language Frank Roberts frank.roberts@uky.edu - C++ (1983), Java (1995), Python (1991): not modern - Java is 18 years old; how has computing changed in 10? - multi/many core - web programming

More information

Assignment 1: Communicating with Programs

Assignment 1: Communicating with Programs Assignment 1: Communicating with Programs EC602 Design by Software Fall 2018 Contents 1 Introduction 2 1.1 Assignment Goals........................... 2 1.2 Group Size.............................. 2 1.3

More information

Processes in linux. What s s a process? process? A dynamically executing instance of a program. David Morgan. David Morgan

Processes in linux. What s s a process? process? A dynamically executing instance of a program. David Morgan. David Morgan Processes in linux David Morgan What s s a process? process? A dynamically executing instance of a program 1 Constituents of a process its code data various attributes OS needs to manage it OS keeps track

More information

How to program with Matlab (PART 1/3)

How to program with Matlab (PART 1/3) Programming course 1 09/12/2013 Martin SZINTE How to program with Matlab (PART 1/3) Plan 0. Setup of Matlab. 1. Matlab: the software interface. - Command window - Command history - Section help - Current

More information

5/20/2007. Touring Essential Programs

5/20/2007. Touring Essential Programs Touring Essential Programs Employing fundamental utilities. Managing input and output. Using special characters in the command-line. Managing user environment. Surveying elements of a functioning system.

More information

This document describes version 2.07 of File::Path, released

This document describes version 2.07 of File::Path, released NAME VERSION SYNOPSIS File::Path - Create or remove directory trees This document describes version 2.07 of File::Path, released 2008-11-09. use File::Path qw(make_path remove_tree); make_path('foo/bar/baz',

More information

Go in Action: Benchmarking

Go in Action: Benchmarking Go in Action: Benchmarking By William Kennedy with Brian Ketelsen and Erik St. Martin In this article, excerpted from the book Go in Action, we will look at a set of benchmark functions that reveal the

More information

DAB/MOT Data Carousel Support Library Linux Server Implementation

DAB/MOT Data Carousel Support Library Linux Server Implementation DAB/MOT Data Carousel Support Library Linux Server Implementation D. Knox 98-0003-003/1.0 28th Apr 1990 ENSIGMA Ltd Turing House Station Road Chepstow GWENT NP6 5PB Ensigma Ltd. Page 2 of 31 Distribution

More information

Overview of the UNIX File System

Overview of the UNIX File System Overview of the UNIX File System Navigating and Viewing Directories Adapted from Practical Unix and Programming Hunter College Copyright 2006 Stewart Weiss The UNIX file system The most distinguishing

More information

Don t Go Java! Edition 2019

Don t Go Java! Edition 2019 Don t Go, Java! Don t Go Java! Don t Go Java! Edition 2019 Disclaimer Disclaimer I actually like Go! Guess The Movie Guess The Movie Guess The Movie Guess The Movie Who s That Dude? Chris Engelbert Senior

More information

Formal languages and computation models

Formal languages and computation models Formal languages and computation models Guy Perrier Bibliography John E. Hopcroft, Rajeev Motwani, Jeffrey D. Ullman - Introduction to Automata Theory, Languages, and Computation - Addison Wesley, 2006.

More information

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209 CSC209 Software Tools and Systems Programming https://mcs.utm.utoronto.ca/~209 What is this Course About? Software Tools Using them Building them Systems Programming Quirks of C The file system System

More information

GRACES Data Reduction Cookbook

GRACES Data Reduction Cookbook GRACES Data Reduction Cookbook Prepared by Eder Martioli GRACES Pipeline Team: Eder Martioli, Vinicius Placco, Andre-Nicolas Chene, Lison Malo, Kanoa Withington, Nadine Manset, Claire Moutou. Scientific

More information

RPC and Threads. Jinyang Li. These slides are based on lecture notes of 6.824

RPC and Threads. Jinyang Li. These slides are based on lecture notes of 6.824 RPC and Threads Jinyang Li These slides are based on lecture notes of 6.824 Labs are based on Go language Why Golang? (as opposed to the popular alternacve: C++) good support for concurrency good support

More information

Filesystem Hierarchy and Permissions

Filesystem Hierarchy and Permissions and Linux Prepared by Steven Gordon on 19 April 2017 Common/Reports/linux-file-permissions.tex, r1417 1/15 Multiuser and Server Operating System Linux systems are commonly used as a multi-user system E.g.

More information

System Administration for Beginners

System Administration for Beginners System Administration for Beginners Week 5 Notes March 16, 2009 1 Introduction In the previous weeks, we have covered much of the basic groundwork needed in a UNIX environment. In the upcoming weeks, we

More information

EECS 470 Lab 5. Linux Shell Scripting. Friday, 1 st February, 2018

EECS 470 Lab 5. Linux Shell Scripting. Friday, 1 st February, 2018 EECS 470 Lab 5 Linux Shell Scripting Department of Electrical Engineering and Computer Science College of Engineering University of Michigan Friday, 1 st February, 2018 (University of Michigan) Lab 5:

More information

Essential Unix and Linux! Perl for Bioinformatics, ! F. Pineda

Essential Unix and Linux! Perl for Bioinformatics, ! F. Pineda Essential Unix and Linux! Perl for Bioinformatics, 140.636! F. Pineda Generic computer architecture Memory Storage Fig. 1.2 From Designing Embedded Hardware, 2 nd Ed. by John Catsoulis OS concepts Shell

More information

Overview of the UNIX File System. Navigating and Viewing Directories

Overview of the UNIX File System. Navigating and Viewing Directories Overview of the UNIX File System Navigating and Viewing Directories Copyright 2006 Stewart Weiss The UNIX file system The most distinguishing characteristic of the UNIX file system is the nature of its

More information

CVS. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 21

CVS. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 21 CVS Computer Science and Engineering College of Engineering The Ohio State University Lecture 21 CVS: Concurrent Version System Classic tool for tracking changes to a project and allowing team access Can

More information

C Programming. A quick introduction for embedded systems. Dr. Alun Moon UNN/CEIS. September 2008

C Programming. A quick introduction for embedded systems. Dr. Alun Moon UNN/CEIS. September 2008 C Programming A quick introduction for embedded systems Dr. Alun Moon UNN/CEIS September 2008 Dr. Alun Moon (UNN/CEIS) C Programming September 2008 1 / 13 Programming is both an art and a science. It is

More information

INSTITUTE OF AERONAUTICAL ENGINEERING

INSTITUTE OF AERONAUTICAL ENGINEERING INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad -500 043 INFORMATION TECHNOLOGY TUTORIAL QUESTION BANK Name : PRINCIPLES OF PROGRAMMING LANGUAGES Code : A40511 Class : II B. Tech

More information

Jackson State University Department of Computer Science CSC / Advanced Information Security Spring 2013 Lab Project # 5

Jackson State University Department of Computer Science CSC / Advanced Information Security Spring 2013 Lab Project # 5 Jackson State University Department of Computer Science CSC 439-01/539-02 Advanced Information Security Spring 2013 Lab Project # 5 Use of GNU Debugger (GDB) for Reverse Engineering of C Programs in a

More information

UNIX Tutorial One

UNIX Tutorial One 1.1 Listing files and directories ls (list) When you first login, your current working directory is your home directory. Your home directory has the same name as your user-name, for example, ee91ab, and

More information

Go for Java Developers

Go for Java Developers Go for Java Developers Stoyan Rachev May 26-27 16, Sofia 1 Agenda Introduction Variables and Control Flow Types and Data Structures Functions Methods and Interfaces Concurrency Conclusion 2 What is Go?

More information

Access Permissions. Agenda. chmod Command (Relative Method) File / Directory Permissions

Access Permissions. Agenda. chmod Command (Relative Method) File / Directory Permissions Agenda The Linux File System (chapter 4 in text) Setting Access Permissions Directory vs File Permissions chmod Utility Symbolic Method Absolute Method umask Utility Access Permissions Limiting unauthorized

More information

Patterns for polymorphic operations

Patterns for polymorphic operations Patterns for polymorphic operations Three small object structural patterns for dealing with polymorphism Alexander A. Horoshilov hor@epsylontech.com Abstract Polymorphism is one of the main elements of

More information

EAPI Cheat Sheet. Version th November Abstract

EAPI Cheat Sheet. Version th November Abstract EAPI Cheat Sheet Christian Faulhammer fauli@gentoo.org Ulrich Müller ulm@gentoo.org Version 6.0 19th November 2015 Abstract An overview of the main EAPI changes in Gentoo, for ebuild authors. For full

More information

Introduction of Linux

Introduction of Linux Introduction of Linux 阳 oslab2018_class1@163.com 寅 oslab2018_class2@163.com PART I Brief Introduction Basic Conceptions & Environment Install & Configure a Virtual Machine Basic Commands PART II Shell

More information

Computers and Computation. The Modern Computer. The Operating System. The Operating System

Computers and Computation. The Modern Computer. The Operating System. The Operating System The Modern Computer Computers and Computation What is a computer? A machine that manipulates data according to instructions. Despite their apparent complexity, at the lowest level computers perform simple

More information

JEE2600 INTRODUCTION TO DIGITAL LOGIC AND COMPUTER DESIGN. ModelSim Tutorial. Prepared by: Phil Beck 9/8/2008. Voter Function

JEE2600 INTRODUCTION TO DIGITAL LOGIC AND COMPUTER DESIGN. ModelSim Tutorial. Prepared by: Phil Beck 9/8/2008. Voter Function JEE2600 INTRODUCTION TO DIGITAL LOGIC AND COMPUTER DESIGN ModelSim Tutorial Prepared by: Phil Beck 9/8/2008 Vote 1 Vote 2 Voter Function Pass Vote 3 Pass is only a 1 when two or more of the Vote inputs

More information

PYTHON. BBM103 Introduction to Programming Lab 1. Hacettepe University Computer Engineering Department

PYTHON. BBM103 Introduction to Programming Lab 1. Hacettepe University Computer Engineering Department PYTHON BBM103 Introduction to Programming Lab 1 Hacettepe University Computer Engineering Department Beytepe 2016 Installation 1. Download PyCharm Edu from https://www.jetbrains.com/pycharm-edu/download/

More information

Computer Science 2500 Computer Organization Rensselaer Polytechnic Institute Spring Topic Notes: C and Unix Overview

Computer Science 2500 Computer Organization Rensselaer Polytechnic Institute Spring Topic Notes: C and Unix Overview Computer Science 2500 Computer Organization Rensselaer Polytechnic Institute Spring 2009 Topic Notes: C and Unix Overview This course is about computer organization, but since most of our programming is

More information

File System. Preview. File Name. File Structure. File Types. File Structure. Three essential requirements for long term information storage

File System. Preview. File Name. File Structure. File Types. File Structure. Three essential requirements for long term information storage Preview File System File System File Name, File Structure, File Types, File Access, File Attributes, File Operation Directories Directory Operations Contiguous Allocation Linked List Allocation Linked

More information

Lecture #2: Programming Structures: Loops and Functions

Lecture #2: Programming Structures: Loops and Functions UC Berkeley EECS Adj. Ass. Prof. Dr. Gerald Friedland Computational Structures in Data Science Lecture #2: Programming Structures: Loops and Functions Administrivia If you are waitlisted: Please wait.

More information

Filesystem Hierarchy and Permissions

Filesystem Hierarchy and Permissions 2 and Prepared by Steven Gordon on 19 April 2017 Common/Reports/linux-file-permissions.tex, r1417 1 Multiuser and Server Operating System systems are commonly used as a multi-user system E.g. multiple

More information

TIBCO FTL R Programming Tutorial Software Release 5.3 October 2017

TIBCO FTL R Programming Tutorial Software Release 5.3 October 2017 TIBCO FTL R Programming Tutorial Software Release 5.3 October 2017 1 Contents Introduction i 1 Getting Started with FTL Programming 1 1.1 Set Up the Environment... 1 1.2 Start the Local Realm Server...

More information

Linux desktop app guide Documentation. Thomas Kluyver & contributors

Linux desktop app guide Documentation. Thomas Kluyver & contributors Linux desktop app guide Documentation Thomas Kluyver & contributors Dec 13, 2018 Contents: 1 User Interface options 3 1.1 Desktop style: GTK or Qt........................................ 3 1.2 Web tech:

More information

Using WestGrid from the desktop Oct on Access Grid

Using WestGrid from the desktop Oct on Access Grid Using WestGrid from the desktop Oct 11 2007 on Access Grid Introduction Simon Sharpe, UCIT Client Services The best way to contact WestGrid support is to email support@westgrid.ca This seminar gives you

More information

Operating Systems. Copyleft 2005, Binnur Kurt

Operating Systems. Copyleft 2005, Binnur Kurt 3 Operating Systems Copyleft 2005, Binnur Kurt Content The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail.

More information

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing Content 3 Operating Systems The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail. How to log into (and out

More information

Go Tutorial. To do. A brief, gentle intro to Go. Next Networking. q Today

Go Tutorial. To do. A brief, gentle intro to Go. Next Networking. q Today Go Tutorial To do q Today A brief, gentle intro to Go q Next Networking About Go Developed by Google Webpage: https://golang.org/ Concurrency was a priority in the language design A bit of a mix between

More information

We do not teach programming

We do not teach programming We do not teach programming We do not teach C Take a course Read a book The C Programming Language, Kernighan, Richie Georgios Georgiadis Negin F.Nejad This is a brief tutorial on C s traps and pitfalls

More information

Matt Butcher Matt Farina

Matt Butcher Matt Farina Matt Butcher Matt Farina FOREWORD BY Brian Ketelsen Includes 70 Techniques MANNING Go in Practice by Matt Butcher Matt Farina Chapter 1 Copyright 2016 Manning Publications brief contents PART 1 BACKGROUND

More information

If Statements, For Loops, Functions

If Statements, For Loops, Functions Fundamentals of Programming If Statements, For Loops, Functions Table of Contents Hello World Types of Variables Integers and Floats String Boolean Relational Operators Lists Conditionals If and Else Statements

More information

Lecture 22 Go http://xkcd.com/979/ Go developed ~2007 at Google by Robert Griesemer, Rob Pike, Ken Thompson open sourced in 2009 compiled, statically typed very fast compilation C-like syntax garbage collection

More information

LAE 5.1. Release Notes. Version 1.0

LAE 5.1. Release Notes. Version 1.0 LAE 5.1 Release Notes Copyright THE CONTENTS OF THIS DOCUMENT ARE THE COPYRIGHT OF LIMITED. ALL RIGHTS RESERVED. THIS DOCUMENT OR PARTS THEREOF MAY NOT BE REPRODUCED IN ANY FORM WITHOUT THE WRITTEN PERMISSION

More information

Project 3: Base64 Content-Transfer-Encoding

Project 3: Base64 Content-Transfer-Encoding CMSC 313, Computer Organization & Assembly Language Programming Section 0101 Fall 2001 Project 3: Base64 Content-Transfer-Encoding Due: Tuesday November 13, 2001 Objective The objectives of this programming

More information

Getting Started with Apache NiFi Registry

Getting Started with Apache NiFi Registry 3 Getting Started with Date of Publish: 2018-11-15 http://docs.hortonworks.com Contents Terminology Used in This Guide... 3 Downloading and Installing NiFi Registry...3 Starting NiFi Registry... 3 For

More information

CSE413: Programming Languages and Implementation Racket structs Implementing languages with interpreters Implementing closures

CSE413: Programming Languages and Implementation Racket structs Implementing languages with interpreters Implementing closures CSE413: Programming Languages and Implementation Racket structs Implementing languages with interpreters Implementing closures Dan Grossman Fall 2014 Hi! I m not Hal J I love this stuff and have taught

More information

CS 307: UNIX PROGRAMMING ENVIRONMENT FIND COMMAND

CS 307: UNIX PROGRAMMING ENVIRONMENT FIND COMMAND CS 307: UNIX PROGRAMMING ENVIRONMENT FIND COMMAND Prof. Michael J. Reale Fall 2014 Finding Files in a Directory Tree Suppose you want to find a file with a certain filename (or with a filename matching

More information

Kindle Books The C Programming Language

Kindle Books The C Programming Language Kindle Books The C Programming Language The authors present the complete guide to ANSI standard C language programming. Written by the developers of C, this new version helps readers keep up with the finalized

More information

About Tutorial. Audience. Prerequisites. Disclaimer & Copyright. Euphoria

About Tutorial. Audience. Prerequisites. Disclaimer & Copyright. Euphoria About Tutorial This tutorial gives you basic understanding of Euphoria programming language. Euphoria is simple, flexible, easy to learn, and interpreted high-level programming language for DOS, Windows,

More information

Extra Notes - Data Stores & APIs - using MongoDB and native driver

Extra Notes - Data Stores & APIs - using MongoDB and native driver Extra Notes - Data Stores & APIs - using MongoDB and native driver Dr Nick Hayward Contents intro install MongoDB running MongoDB using MongoDB Robo 3T basic intro to NoSQL connect to MongoDB from Node.js

More information

Successful Go program design. Six years on

Successful Go program design. Six years on Successful Go program design Six years on ROBOTS Successful Go program design Six years on My background + My background C++ + My background C++ 2009 + My background C++ Go 2009 + My background C++ Go

More information

Introduction to Programming Style

Introduction to Programming Style Introduction to Programming Style Thaddeus Aid The IT Learning Programme The University of Oxford, UK 30 July, 2013 Abstract Programming style is the part of the program that the human reads and the compiler

More information

First steps on Linux and programming

First steps on Linux and programming First steps on Linux and programming Adrien Poteaux CRIStAL, Université de Lille Year 2017-2018 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. http://creativecommons.org/licenses/by-nc-sa/3.0/

More information

Shell Scripting. Todd Kelley CST8207 Todd Kelley 1

Shell Scripting. Todd Kelley CST8207 Todd Kelley 1 Shell Scripting Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 If we have a set of commands that we want to run on a regular basis, we could write a script A script acts as a Linux command,

More information

Creating a new CDC policy using the Database Administration Console

Creating a new CDC policy using the Database Administration Console Creating a new CDC policy using the Database Administration Console When you start Progress Developer Studio for OpenEdge for the first time, you need to specify a workspace location. A workspace is a

More information

Preview. COSC350 System Software, Fall

Preview. COSC350 System Software, Fall Preview File System File Name, File Structure, File Types, File Access, File Attributes, File Operation Directories Directory Operations File System Layout Implementing File Contiguous Allocation Linked

More information

A shell can be used in one of two ways:

A shell can be used in one of two ways: Shell Scripting 1 A shell can be used in one of two ways: A command interpreter, used interactively A programming language, to write shell scripts (your own custom commands) 2 If we have a set of commands

More information

This document describes version 2.09 of File::Path, released

This document describes version 2.09 of File::Path, released NAME VERSION SYNOPSIS File::Path - Create or remove directory trees This document describes version 2.09 of File::Path, released 2013-01-17. use File::Path qw(make_path remove_tree); make_path('foo/bar/baz',

More information

Processes. What s s a process? process? A dynamically executing instance of a program. David Morgan

Processes. What s s a process? process? A dynamically executing instance of a program. David Morgan Processes David Morgan What s s a process? process? A dynamically executing instance of a program 1 Constituents of a process its code data various attributes OS needs to manage it OS keeps track of all

More information

FX SERIES. Programmer s Guide. Embedded SDK. MN000540A01 Rev. A

FX SERIES. Programmer s Guide. Embedded SDK. MN000540A01 Rev. A FX SERIES Embedded SDK Programmer s Guide MN000540A01 Rev. A Table of Contents About This Guide Introduction...4 Chapter Descriptions... 4 Notational Conventions...5 Related Documents and Software...5

More information

Advanced Unix Programming Module 03 Raju Alluri spurthi.com

Advanced Unix Programming Module 03 Raju Alluri spurthi.com Advanced Unix Programming Module 03 Raju Alluri askraju @ spurthi.com Advanced Unix Programming: Module 3 Shells & Shell Programming Environment Variables Writing Simple Shell Programs (shell scripts)

More information

Installation and Upgrade Guide Zend Studio 9.x

Installation and Upgrade Guide Zend Studio 9.x Installation and Upgrade Guide Zend Studio 9.x By Zend Technologies, Inc. www.zend.com Disclaimer The information in this document is subject to change without notice and does not represent a commitment

More information

LAE Release Notes. Version 1.0

LAE Release Notes. Version 1.0 LAE 5.0.1 Release Notes Copyright THE CONTENTS OF THIS DOCUMENT ARE THE COPYRIGHT OF LIMITED. ALL RIGHTS RESERVED. THIS DOCUMENT OR PARTS THEREOF MAY NOT BE REPRODUCED IN ANY FORM WITHOUT THE WRITTEN PERMISSION

More information

Segmentation with Paging. Review. Segmentation with Page (MULTICS) Segmentation with Page (MULTICS) Segmentation with Page (MULTICS)

Segmentation with Paging. Review. Segmentation with Page (MULTICS) Segmentation with Page (MULTICS) Segmentation with Page (MULTICS) Review Segmentation Segmentation Implementation Advantage of Segmentation Protection Sharing Segmentation with Paging Segmentation with Paging Segmentation with Paging Reason for the segmentation with

More information

Motivations History Principles Language Gommunity Success stories Conclusion. Let s Go! A brief introduction to Google s new language.

Motivations History Principles Language Gommunity Success stories Conclusion. Let s Go! A brief introduction to Google s new language. Let s Go! A brief introduction to Google s new language Aurélien Dumez Inria Bordeaux - Sud-Ouest aurelien.dumez@inria.fr Tuesday, October 2nd 2012 Content - 1/2 1 2 3 4 Characteristics SDK vs Examples

More information

Computer Science 322 Operating Systems Mount Holyoke College Spring Topic Notes: C and Unix Overview

Computer Science 322 Operating Systems Mount Holyoke College Spring Topic Notes: C and Unix Overview Computer Science 322 Operating Systems Mount Holyoke College Spring 2010 Topic Notes: C and Unix Overview This course is about operating systems, but since most of our upcoming programming is in C on a

More information

Introduction to Programming with Python 3, Ami Gates. Chapter 1: Creating a Programming Environment

Introduction to Programming with Python 3, Ami Gates. Chapter 1: Creating a Programming Environment Introduction to Programming with Python 3, Ami Gates Chapter 1: Creating a Programming Environment 1.1: Python, IDEs, Libraries, Packages, and Platforms A first step to learning and using any new programming

More information

Lab #12: Shell Scripting

Lab #12: Shell Scripting Lab #12 Page 1 of 11 Lab #12: Shell Scripting Students will familiarize themselves with UNIX shell scripting using basic commands to manipulate the le system. Part A Instructions: This part will be demonstrated

More information

Installation and Upgrade Guide Zend Studio 9.x

Installation and Upgrade Guide Zend Studio 9.x Installation and Upgrade Guide Zend Studio 9.x By Zend Technologies, Inc. www.zend.com Disclaimer The information in this document is subject to change without notice and does not represent a commitment

More information

416 Distributed Systems. RPC Day 2 Jan 12, 2018

416 Distributed Systems. RPC Day 2 Jan 12, 2018 416 Distributed Systems RPC Day 2 Jan 12, 2018 1 Last class Finish networks review Fate sharing End-to-end principle UDP versus TCP; blocking sockets IP thin waist, smart end-hosts, dumb (stateless) network

More information

Effective TCP/IP Programming: 44 Tips To Improve Your Network Programs: 44 Tips To Improve Your Network Programs Ebooks Free

Effective TCP/IP Programming: 44 Tips To Improve Your Network Programs: 44 Tips To Improve Your Network Programs Ebooks Free Effective TCP/IP Programming: 44 Tips To Improve Your Network Programs: 44 Tips To Improve Your Network Programs Ebooks Free An excellent next-step for students who have read Stevens' TCP/IP Illustrated

More information

COURSE INTRODUCTION. Software Tools EECS2031 Winter 2018 Manos Papagelis. Thanks to Karen Reid and Alan J Rosenthal for material in these slides

COURSE INTRODUCTION. Software Tools EECS2031 Winter 2018 Manos Papagelis. Thanks to Karen Reid and Alan J Rosenthal for material in these slides COURSE INTRODUCTION Software Tools EECS2031 Winter 2018 Manos Papagelis Thanks to Karen Reid and Alan J Rosenthal for material in these slides What EECS2031 is about? A useful way to think about this course

More information

WebDocs 6.5. New Features and Functionality. An overview of the new features that increase functionality and ease of use including:

WebDocs 6.5. New Features and Functionality. An overview of the new features that increase functionality and ease of use including: WebDocs 6.5 New Features and Functionality An overview of the new features that increase functionality and ease of use including: Simplified Installation WebDocs Touch WebDocs Drive Office Automation Enhancements

More information

WRITING CONSOLE APPLICATIONS IN C

WRITING CONSOLE APPLICATIONS IN C WRITING CONSOLE APPLICATIONS IN C with Visual Studio 2017 A brief step-by-step primer for ME30 Bryan Burlingame, San José State University The Visual Studio 2017 Community Edition is a free integrated

More information

Adobe Illustrator CS3 Classroom In A Book (Book & CD-ROM) Ebooks Free

Adobe Illustrator CS3 Classroom In A Book (Book & CD-ROM) Ebooks Free Adobe Illustrator CS3 Classroom In A Book (Book & CD-ROM) Ebooks Free This thorough guide to Adobe Illustrator CS3 is ideal for beginning users who want to master the key features of Adobe's powerful

More information

PUG (Prover of User GPU Programs) v0.2

PUG (Prover of User GPU Programs) v0.2 PUG (Prover of User GPU Programs) v0.2 Guodong Li School of Computing, University of Utah 1 Installation For details on PUG, see our forthcoming FSE 2010 paper. This manual pertains to our tool for which

More information

(Refer Slide Time: 1:26)

(Refer Slide Time: 1:26) Information Security-3 Prof. V Kamakoti Department of Computer science and Engineering Indian Institute of Technology Madras Basics of Unix and Network Administration Operating Systems Introduction Mod01,

More information

Portions adapted from A Visual Guide to Version Control. Introduction to CVS

Portions adapted from A Visual Guide to Version Control. Introduction to CVS Portions adapted from A Visual Guide to Version Control Introduction to CVS Outline Introduction to Source Code Management & CVS CVS Terminology & Setup Basic commands Checkout, Add, Commit, Diff, Update,

More information

Exercise sheet 1 To be corrected in tutorials in the week from 23/10/2017 to 27/10/2017

Exercise sheet 1 To be corrected in tutorials in the week from 23/10/2017 to 27/10/2017 Einführung in die Programmierung für Physiker WS 207/208 Marc Wagner Francesca Cuteri: cuteri@th.physik.uni-frankfurt.de Alessandro Sciarra: sciarra@th.physik.uni-frankfurt.de Exercise sheet To be corrected

More information

CPSC : Program 3, Perceptron and Backpropagation

CPSC : Program 3, Perceptron and Backpropagation CPSC 420-500: Program 3, Perceptron and Backpropagation Yoonsuck Choe Department of Computer Science Texas A&M University November 2, 2007 1 Overview You will implement perceptron learning from scratch

More information

Applied Informatics POCO PRO C++ Frameworks

Applied Informatics POCO PRO C++ Frameworks Applied Informatics POCO PRO C++ Frameworks Getting Started Guide Version 1.10 Purpose of This Document This document guides developers interested in the POCO PRO C++ Frameworks by Applied Informatics

More information

CS 300. Data Structures

CS 300. Data Structures CS 300 Data Structures Start VirtualBox Search or Windows Run C:\CS300 Launches CS 300/360 Virtual Machine (Eventually) Logon with Zeus password Syllabus http://zeus.cs.pacificu.edu/chadd/cs300f18/syllabus.html

More information

Lecture 3: Web Servers / PHP and Apache. CS 383 Web Development II Monday, January 29, 2018

Lecture 3: Web Servers / PHP and Apache. CS 383 Web Development II Monday, January 29, 2018 Lecture 3: Web Servers / PHP and Apache CS 383 Web Development II Monday, January 29, 2018 Server Configuration One of the most common configurations of servers meant for web development is called a LAMP

More information

GO IDIOMATIC CONVENTIONS EXPLAINED IN COLOR

GO IDIOMATIC CONVENTIONS EXPLAINED IN COLOR GO IDIOMATIC CONVENTIONS EXPLAINED IN COLOR REVISION 1 HAWTHORNE-PRESS.COM Go Idiomatic Conventions Explained in Color Published by Hawthorne-Press.com 916 Adele Street Houston, Texas 77009, USA 2013-2018

More information

Chapter 2 Working with Data Types and Operators

Chapter 2 Working with Data Types and Operators JavaScript, Fourth Edition 2-1 Chapter 2 Working with Data Types and Operators At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics

More information

COMP s1 Lecture 1

COMP s1 Lecture 1 COMP1511 18s1 Lecture 1 1 Numbers In, Numbers Out Andrew Bennett more printf variables scanf 2 Before we begin introduce yourself to the person sitting next to you why did

More information

Your First Ruby Script

Your First Ruby Script Learn Ruby in 50 pages Your First Ruby Script Step-By-Step Martin Miliauskas @mmiliauskas 1 Your First Ruby Script, Step-By-Step By Martin Miliauskas Published in 2013 by Martin Miliauskas On the web:

More information

Project C: B+Tree. This project may be done in groups of up to three people.

Project C: B+Tree. This project may be done in groups of up to three people. Project C: B+Tree In this last project, you will implement a B+Tree index in C++. At the end of the project, you will have a C++ class that conforms to a specific interface. Your class is then used by

More information