20
Mr. Proper Nabil Shahid William Blinn Jeff Lin Matthew Anderegg

Mr. Proper

Embed Size (px)

DESCRIPTION

Mr. Proper. Nabil ShahidWilliam Blinn Jeff LinMatthew Anderegg. Who is Mr. Proper…. … and why did we name our language after him? Step 1. Do hours of work on O.S. assignment. Step 2. Google for hints on how to compile. Step 3. Make mrproper Step 4. Cry. What is MrProper?. - PowerPoint PPT Presentation

Citation preview

Page 1: Mr. Proper

Mr. Proper

Nabil Shahid William Blinn

Jeff Lin Matthew Anderegg

Page 2: Mr. Proper

Who is Mr. Proper…Who is Mr. Proper…

… … and why did we name our language after and why did we name our language after him?him?

Step 1. Do hours of work on O.S. Step 1. Do hours of work on O.S. assignment.assignment.

Step 2. Google for hints on how to compile.Step 2. Google for hints on how to compile.

Step 3. Make mrproperStep 3. Make mrproper

Step 4. Cry.Step 4. Cry.

Page 3: Mr. Proper

What is What is MrProper?MrProper?

A multi format log file manipulation A multi format log file manipulation language.language.

• Easy to use

• Powerful

• Multi chat client support

• Log file manipulation

Page 4: Mr. Proper

Mrp: Easy to UseMrp: Easy to Use

Hides complexity.Hides complexity. Logs become primary data type.Logs become primary data type. Log manipulation akin to integer manipulation.Log manipulation akin to integer manipulation.

Page 5: Mr. Proper

Mrp: PowerfulMrp: Powerful

Broad functionality.Broad functionality. Analysis of conversations.Analysis of conversations. Lexical and syntactic analysis.Lexical and syntactic analysis. Text transcription of log files.Text transcription of log files.

Page 6: Mr. Proper

Mrp: Multi Chat Client SupportMrp: Multi Chat Client Support

Scalable to support other log formats from Scalable to support other log formats from various chat clients.various chat clients.

Current built in support for:Current built in support for: AIMAIM TrillianTrillian Plain textPlain text

Page 7: Mr. Proper

Mrp: Log File ManipulationMrp: Log File Manipulation

Eliminates file read/write overhead from Eliminates file read/write overhead from user programs.user programs.

Built in operations such as loading, Built in operations such as loading, parsing, saving, and converting log parsing, saving, and converting log formats.formats.

Page 8: Mr. Proper

Why Mr.Proper?Why Mr.Proper?

Find links that friends send you.Find links that friends send you. Search logs for expressions, words, Search logs for expressions, words,

phrases.phrases. Easily convert old conversation logs when Easily convert old conversation logs when

switching chat clients.switching chat clients. Parse and format conversation logs to Parse and format conversation logs to

make online publishing easier.make online publishing easier.

Page 9: Mr. Proper

Type SystemType System

Page 10: Mr. Proper

Control StructuresControl Structures

ExpressionsExpressions log l = open(“logroot”, “screenName”, 0);log l = open(“logroot”, “screenName”, 0); int x = a + b + 1;int x = a + b + 1;

Loops Loops int i;int i;

for (i = 1:10) { print (“hello”); }for (i = 1:10) { print (“hello”); }

FunctionsFunctions func log addLogs (log oldLog) {func log addLogs (log oldLog) {

// code // code }}

Page 11: Mr. Proper

String FunctionsString Functions

print() – Prints a string to standard out.print() – Prints a string to standard out. void print (string boo);void print (string boo);

strLength() – Returns the length of a string as an integer.strLength() – Returns the length of a string as an integer. int strLength (string foo)int strLength (string foo)

concat() – Joins two strings and returns the result.concat() – Joins two strings and returns the result. string concat (string moo, string noo);string concat (string moo, string noo);

substr() – Returns part of the input string as a new string.substr() – Returns part of the input string as a new string. string substr (string poo, int offset, int length);string substr (string poo, int offset, int length);

contains() – Searches one string for another (using contains() – Searches one string for another (using regexps) and returns a boolean.regexps) and returns a boolean. bool contains (string line, string regexp)bool contains (string line, string regexp)

Page 12: Mr. Proper

Log File Manipulation FunctionsLog File Manipulation Functions

createLog() – Creates an empty log.createLog() – Creates an empty log. open() – Loads a log file into the program.open() – Loads a log file into the program. save() – Writes log file back to disk.save() – Writes log file back to disk. convert() – Covert log from one format to convert() – Covert log from one format to

another.another. logLength() – Returns the number of logLength() – Returns the number of

messages in the log.messages in the log.

Page 13: Mr. Proper

Log Message FunctionsLog Message Functions

getMessageName() – getMessageName() – Returns the name of the Returns the name of the person who wrote the message.person who wrote the message.

getText() – getText() – Returns the text of the message.Returns the text of the message.

getTime() – getTime() – Returns time of message as number of Returns time of message as number of seconds elapsed since 01/01/1970.seconds elapsed since 01/01/1970.

createMessage() – createMessage() – Creates a new empty message.Creates a new empty message.

setName() – setName() – Modifies the name in the message.Modifies the name in the message.

setText() – setText() – Modifies the text of the message.Modifies the text of the message.

setTime() – setTime() – Modifies the time of the message.Modifies the time of the message.

Page 14: Mr. Proper

Sample CodeSample Code

func int foo(int x) { return x + 3; }func int foo(int x) { return x + 3; }main {main {

int x = 0;int x = 0;for(i = 1:3) {for(i = 1:3) {

x += foo(x);x += foo(x);}}print(x);print(x);

}}

This program will output the value 15This program will output the value 15

Page 15: Mr. Proper

Log File Manipulation: FunctionLog File Manipulation: Function

func int wordCount(string word, string path) {func int wordCount(string word, string path) {log myLog = open(path, “mybuddy”, 1);log myLog = open(path, “mybuddy”, 1);int i;int i;int length = logLength(myLog) -1 ;int length = logLength(myLog) -1 ;int count = 0;int count = 0;string text;string text;for (i = 0:length) {for (i = 0:length) {

text = getText(getMessage(myLog, i));text = getText(getMessage(myLog, i));if (contains(text, word)) {if (contains(text, word)) {

count += 1;count += 1;}}

}}return count;return count;

}}

Page 16: Mr. Proper

Log File Manipulation: MainLog File Manipulation: Main

main {main {int count = wordCount(“hello”, “/mylogs/trillian”);int count = wordCount(“hello”, “/mylogs/trillian”);

print(count);print(count);

}}

Program trace?

Page 17: Mr. Proper

Execution of an Mrp ProgramExecution of an Mrp Program

MrProper is an interpreted language.MrProper is an interpreted language. The interpreter takes in a file containing Mrp The interpreter takes in a file containing Mrp

code, and the instructions are executed as they code, and the instructions are executed as they are encountered.are encountered.

Page 18: Mr. Proper

Testing PlanTesting Plan

Test each component as a module.Test each component as a module. .mrp test scripts to go over every part of the .mrp test scripts to go over every part of the

language.language. Manual and automated semantic error checking.Manual and automated semantic error checking. Test all data types.Test all data types. Control flow.Control flow. Input/output files.Input/output files. Test component interaction.Test component interaction.

Page 19: Mr. Proper

Lessons LearnedLessons Learned

Understand the basic tools Understand the basic tools before you try to use them and before you try to use them and before assuming that before assuming that something is wrong with the something is wrong with the code.code.

Create a more detailed project Create a more detailed project plan. Don’t rely on given plan. Don’t rely on given milestones.milestones.

Learn to balance working Learn to balance working together and dividing up tasks.together and dividing up tasks.

Page 20: Mr. Proper

The Bright Future of Mr. ProperThe Bright Future of Mr. Proper

Added support for other chat clients.Added support for other chat clients. User defined log formats for reading and User defined log formats for reading and

writing.writing. Graphical interface for browsing and Graphical interface for browsing and

searching through log files (tree?)searching through log files (tree?)