Coding Dojo: Bank OCR (2014)

15
Coding Dojo: Bank OCR Austrian Institute of Technology September 2014 Peter Kofler, ‘Code Cop’ @codecopkofler www.code-cop.org Copyright Peter Kofler, licensed under CC-BY.

Transcript of Coding Dojo: Bank OCR (2014)

Page 1: Coding Dojo: Bank OCR (2014)

Coding Dojo:Bank OCR

Austrian Institute of TechnologySeptember 2014

Peter Kofler, ‘Code Cop’@codecopkofler

www.code-cop.org

Copyright Peter Kofler, licensed under CC-BY.

Page 2: Coding Dojo: Bank OCR (2014)

Peter Kofler

• Ph.D. (Appl. Math.)

• Professional SoftwareDeveloper for 15 years

• “fanatic about code quality”

• I help development teams

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 3: Coding Dojo: Bank OCR (2014)

Coding Dojo?Expectations?

Page 4: Coding Dojo: Bank OCR (2014)

Coding Dojo Mindset

● Safe place outsidework

● We are here to learn● Need to slow down● Focus on doing it right● Collaborative Game

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 5: Coding Dojo: Bank OCR (2014)

Dojo Structure

● Introduction 15'● Coding 45'● Interim (Retrospective) 15'● Break 10'● Coding 45'● Retrospective 15'

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 6: Coding Dojo: Bank OCR (2014)

Assignment

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 7: Coding Dojo: Bank OCR (2014)

Bank OCR● You work for a bank, which has a machine to assist in

reading letters. The machine scans the paper documents, and produces a file with a number of entries which each look like this: ····_··_·····_··_··_··_··_· ··|·_|·_||_||_·|_···||_||_| ··||_··_|··|·_||_|··||_|·_| ···························

● Each entry is 4 lines long, each line has 27 characters. The first 3 lines contain an account number written using pipes and underscores, and the fourth line is blank. Each account number should have 9 digits, all of which should be in the range 1-9.

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 8: Coding Dojo: Bank OCR (2014)

Bank OCR

● Write a program that can take this file and parse it into actual account numbers.

● Find a pair.● Choose a programming language.● Set up the environment.● Start with creating a test.

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 9: Coding Dojo: Bank OCR (2014)

Don't Focus on Getting it Done.F0cus on Doing

It Perfectly.

Page 10: Coding Dojo: Bank OCR (2014)

→Practice

Page 11: Coding Dojo: Bank OCR (2014)

Bank OCR considerations

● Which algorithm did you chose?● How readable are your test cases? (Can you

look at them and easily see which digits are being parsed?)

● How do you match digits? (Are you using low level Ifs or high level patterns to match?)

● Functional or imperative? (Do you use iteration or recursion?)

● What if the input changes? (What about the style of digits, number of digits, ...)

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 12: Coding Dojo: Bank OCR (2014)

→Practice

Page 13: Coding Dojo: Bank OCR (2014)

Closing Circle

● What did you learn today?

● What surprised you today?

● What will you do differently in the future?

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 14: Coding Dojo: Bank OCR (2014)

Peter Kofler

@codecopkofler

www.code-cop.org

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 15: Coding Dojo: Bank OCR (2014)

CC Images● Bank https://www.flickr.com/photos/bigmacsc99/4325336251● Dojo

http://www.flickr.com/photos/49715404@N00/3267627038/● Todos

http://www.flickr.com/photos/kylesteeddesign/3724074594/● Wants you http://www.flickr.com/photos/shutter/105497713/

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY