Workshop: Towards Highly Portable Software Jakarta, 20 – 23 January 2003 Diselenggarakan oleh Universitas IndonesiaUniversitas Indonesia Using Pretty Printing.

Slides:



Advertisements
Similar presentations
Intro to Python Welcome to the Wonderful world of GIS programing!
Advertisements

Floating Elements CS380.
CS0007: Introduction to Computer Programming Console Output, Variables, Literals, and Introduction to Type.
Chapter 3 Simple Graphics. Side Effects and Haskell  All the programs we have seen so far have no “side-effects.” That is, programs are executed only.
1 Computing for Todays Lecture 6 Yumei Huo Fall 2006.
Flowchart Start Input weight and height
XP New Perspectives on Microsoft Office Word 2003 Tutorial 4 1 Microsoft Office Word 2003 Tutorial 4 – Desktop Publishing and Mail Merge.
4 Copyright © 2004, Oracle. All rights reserved. Creating a Basic Form Module.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 8 - Characters and Strings Outline 8.1Introduction 8.2Fundamentals of Strings and Characters 8.3Character.
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
Session 2 Tables and forms in HTML Adapted by Sophie Peter from original document by Charlie Foulkes.
Console and File I/O - Basics Rudra Dutta CSC Spring 2007, Section 001.
Computer Programming for Biologists Class 2 Oct 31 st, 2014 Karsten Hokamp
Workshop: Towards Highly Portable Software Jakarta, 21 – 23 January 2003 Diselenggarakan oleh Universitas IndonesiaUniversitas Indonesia Part 1 : Programming.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML Pt. 2.
HTML history, Tags, Element. HTML: HyperText Markup Language Hello World Welcome to the world!
Session 1 SESSION 1 Working with Dreamweaver 8.0.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Ex3 Preview, Swing tutorial Ex1 review Amit Shabtay.
Chapter 1 Working with strings. Objectives Understand simple programs using character strings and the string library. Get acquainted with declarations,
1.Obtaining software 2.Sample pdf for this presentation 3.Checking accessibility of the pdf 4.Tackling inaccessibility 5.Tips and helpful links How to.
Creating Tables Lesson 6.
4 Copyright © 2004, Oracle. All rights reserved. Creating a Basic Form Module.
Workshop: Towards Highly Portable Software Jakarta, 21 – 23 January 2003 Diselenggarakan oleh Universitas IndonesiaUniversitas Indonesia XL Programming.
C Programming Lecture 5 : Basic standard I/O Lecture notes : courtesy of Ohio Supercomputing Center, science and technolgy support.
MS Lesson 14: Inserting a Table Mrs. Brown. Bell Ringer: Edmodo What is a Table? What is a cell?
Element 6 Print word processingdocuments. LEARNING OUTCOMES 1. Preview document using print preview mode. 2. Correctly select basic print options. 3.
Chapter 2 Using Objects. Types A type defines a set of values and the operations that can be carried out on the values Examples: 13 has type int "Hello,
Input & Output Functions JavaScript is special from other languages because it can accept input and produce output on the basis of that input in the same.
1 Principles of Computer Science I Prof. Nadeem Abdul Hamid CSC 120 – Fall 2005 Lecture Unit 2 - Using Objects.
Sekvence za krmiljenje tiska. Primer izpisa Understanding Operator Precedence.
Birkbeck University of London Business Workshop Web Accessibility for small businesses How to convert table layout page to css.
Strings Programming Applications. Strings in C C stores a string in a block of memory. The string is terminated by the \0 character:
Lee CSCE 314 TAMU 1 CSCE 314 Programming Languages Interactive Programs: I/O and Monads Dr. Hyunyoung Lee.
By Mr. Muhammad Pervez Akhtar
Pictures: A Case Study Lecture 4, Programmeringsteknik del A.
Variables, Types, Expressions Intro2CS – week 1b 1.
Chapter 8 Characters and Strings. Objectives In this chapter, you will learn: –To be able to use the functions of the character handling library ( ctype).
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
Workshop: Towards Highly Portable Software Jakarta, 21 – 23 January 2003 Diselenggarakan oleh Universitas IndonesiaUniversitas Indonesia Part 1 : Programming.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
C is a high level language (HLL)
Workshop: Towards Highly Portable Software Jakarta, 21 – 23 January 2003 Diselenggarakan oleh Universitas IndonesiaUniversitas Indonesia Part 1 : Transformation.
Nesting and Floating. Nesting and Floating Elements To make our page content appear the way we want, and to make the best use of screen space, we can.
COMPOSITION THE RULE OF THIRDS, VISUAL CENTER AND GRIDS.
Word 2010 Edit Page Layout In this lesson, you will learn how to insert columns and page breaks. How to change the page orientation, paper size, page margins,
C Programming Day 2. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/LA07/003 Version No. 1.0 Union –mechanism to create user defined data types.
Learning to use a ‘For Loop’ and a ‘Variable’. Learning Objective To use a ‘For’ loop to build shapes within your program Use a variable to detect input.
File I/O. I/O Flags Flags are passed to give some information about how the file is to be used. – Read only file – flag=0x0 – Write only file – flag=0x1.
The eclipse IDE IDE = “Integrated Development Environment”
Basic Text File Input/Output
Text File Input/Output
Formatting a Spreadsheet
Webpage layout using CSS
PROGRAMMING IN HASKELL
Basic Principles of Layout
Chapter 15: Customizing Forms
Javascript Short Introduction By Thanawat Varintree,
EEL 3705 / 3705L Digital Logic Design
Binary Files.
“The fastest I/O is no I/O.” Nils-Peter Nelson, Bell Labs
Vitalnet quickly makes publication-ready output
Chapter 11 Review.
Adobe Visual Design Understanding Adobe InDesign interface (2%)
Software Design Lecture : 9.
Class Examples.
The keyboard is the standard input device.
Programming Languages
Cascading Style Sheets
CSc 337 Lecture 5: Grid layout.
Presentation transcript:

Workshop: Towards Highly Portable Software Jakarta, 20 – 23 January 2003 Diselenggarakan oleh Universitas IndonesiaUniversitas Indonesia Using Pretty Printing Combinator Dr. Ir. I.S.W.B. A. Azurat

2 Pretty Printing Library How to pretty print some output nicely based on some layout → use lay out combinator (use UU_Pretty Library) Run hugs with option : hugs -98 +o –P:”c:\tools\UU.lib” height width last line

3 PP Document The basic building blocks for pretty-printing are PP documents (of type PP_Doc ). You obtain PP documents either by : 1.using the primitive text 2.combining PP documents with the pretty-printing operators.

4 Basic interface InterfaceComments empty The empty PP document and null element for the operations beside and above text s Converts the string s into a PP document render ppd pw Prints the PP document ppd (to IO () ) in a page pw (>=0) wide

5 example We are ready to try out the first examples: > tenplus = " ha!" > t_text = render (text tenplus) 15 whose output is ha!. But: > t_error = render (text tenplus) 10 will result in, because the page is not wide enough. The number of characters of the output line is the actual width of the input string.

6 Basic Combinator x >|< y x beside y x >-< y x above y

7 example Horizontal (beside) and vertical (above) composition are the principal combinators used to build more complex documents. For example: > hello = "hello" > world = "world!" > h_beside_w = hello >|< world > t_beside = render h_beside_w 20 (Hint: Try to use ># |<, what is the difference ? )

8 Exercise Run hugs with option : -98 +o –P:”c:\tools\UU.lib”

9