LING 408/508: Programming for Linguists Lecture 13 October 14 th.
LING 408/508: Programming for Linguists Lecture 3 August 31 st.
-
Upload
marion-blankenship -
Category
Documents
-
view
227 -
download
0
Transcript of LING 408/508: Programming for Linguists Lecture 3 August 31 st.
![Page 1: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/1.jpg)
LING 408/508: Programming for Linguists
Lecture 3August 31st
![Page 2: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/2.jpg)
Administrivia
Homework 1 graded
![Page 3: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/3.jpg)
Today’s Topics:
– Review Homework 1– VirtualBox– Ubuntu install (your Homework 2)
![Page 4: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/4.jpg)
Homework 1
1. Encode Pi as accurately as possible using both the 64and 32 bit floating point representationsInstruction: draw the diagram and fill in the 1's and 0's
2. How many decimal places of precision is provided by each of the 64 and 32 bit floating point representations?
wikipedia
![Page 5: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/5.jpg)
Homework 1 Review
• 32 bit (float) representation– Sval:– ExpVal:– FracVal:
![Page 6: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/6.jpg)
Homework 1 Review
• 64 bit (float) representation:– Sval:– ExpVal:– FracVal:
![Page 7: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/7.jpg)
VirtualBox• Virtual x86 machine(s)
– install other operating systems (OSs) running inside a window, we’ll install Ubuntu (Linux) as a Guest OS
• Free application at https://www.virtualbox.org
Ubuntu 14.04 LTS*under
VirtualBoxunder
OS X 10.10.5
*LTS = Long Term Support
![Page 8: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/8.jpg)
Homework 2
• Your homework is to successfully install Ubuntu under VirtualBox on your computer this week (preferably: ready for next class)– this is different from partitioning your hard drive, installing
Ubuntu in one of the partitions, and making your machine dual booting (although you could do that) …
• I’ll walk through the live install Ubuntu here …• Assume VirtualBox + Extension Pack is installed
– (I’m using version 4.3.30 now)
![Page 9: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/9.jpg)
VirtualBox• Download extension pack as well:
• Enable it from VirtualBox Preferences…
![Page 10: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/10.jpg)
VirtualBox• Step 1: download Ubuntu ISO image from http://www.ubuntu.com/download/desktop• ISO image: this is an image of a CD.• Choose 64 bits (recent machine). 32 bits for older machines.• 64 bits Mac (for recent Macs) – for booting with a Mac (in BIOS emulation mode)
Skip thedonationpage …
![Page 11: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/11.jpg)
VirtualBox• The file ubuntu-14.04.3-desktop-amd64.iso takes considerable time to
download (size: about 1GB)• We don’t boot off real cds anymore; the .iso file is a special file that can
be interpreted as a virtual cd• ISO images:
– Macs can mount ISO images.– Macs can’t boot off a multitrack ISO image; hence the special adm64+mac
version.– some versions of Windows can’t mount an ISO image (without extra
software). Install Microsoft’s Virtual CD-ROM Control Panel.
• Next, we need to create the virtual machine on which we’re going to install Ubuntu on
![Page 12: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/12.jpg)
VirtualBox• Step 2: in VirtualBox, select New and give new virtual machine of type
Linux a name
dynamically allocated VirtualBox Disk Image
![Page 13: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/13.jpg)
VirtualBox
• Need to add your .iso file in Settings > Storage:
Select yourdownloaded.iso file
![Page 14: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/14.jpg)
VirtualBox
• Dynamically allocated virtual hard drive:
![Page 15: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/15.jpg)
VirtualBox
![Page 16: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/16.jpg)
VirtualBox
• Created Virtual Machine:
![Page 17: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/17.jpg)
VirtualBox
![Page 18: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/18.jpg)
VirtualBox
![Page 19: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/19.jpg)
VirtualBox
• Step 3: start your virtual machine, install Ubuntu:
![Page 20: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/20.jpg)
Ubuntu
![Page 21: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/21.jpg)
Ubuntu
![Page 22: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/22.jpg)
Ubuntu
![Page 23: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/23.jpg)
Ubuntu
![Page 24: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/24.jpg)
Ubuntu
![Page 25: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/25.jpg)
Ubuntu
![Page 26: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/26.jpg)
Ubuntu
• Virtual Box > Devices > Insert Guest Additions CD Image …
![Page 27: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/27.jpg)
Ubuntu
• Guest Additions:
![Page 28: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/28.jpg)
Ubuntu
restart
![Page 29: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/29.jpg)
Ubuntu
• After restart, login, System Settings > Details
![Page 30: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/30.jpg)
Ubuntu
![Page 31: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/31.jpg)
Ubuntu
![Page 32: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/32.jpg)
Ubuntu• Ubuntu Software Center
– App store– (full screen to see Search box)
• Software packages– Terminal: sudo apt-get install <pkg-name>– sudo prefix: means execute the apt-get command with superuser privileges (typically
needed for packages) • How to find Terminal: use search
Lock to Launcher
![Page 33: LING 408/508: Programming for Linguists Lecture 3 August 31 st.](https://reader036.fdocuments.in/reader036/viewer/2022062301/56649e7d5503460f94b7fc5e/html5/thumbnails/33.jpg)
Ubuntu• Terminal:
– runs a shell: bash– enter commands: some are built-in to the shell, others are executable files in
specified directories ($PATH), still others will require apt-get– simple commands:
• pwd print working directory• ls (ls -a) list current directory (-a option: show . (dot) files too)• cd change directory• mkdir create a new directory• which name the directory where command name is located• man name display manual page for command name• echo $SHELL prints the shell ($ prefixes a variable)
– pre-defined environment variables: env– lots of packages are pre-loaded: wish, python, perl, etc.
dpkg –get-selections
The shell has a programming language