SlideShare une entreprise Scribd logo
1  sur  74
A Strand of Perls: Some Home Grown Utilities
Our New Books List Call Number Sorting Getting Operator Profiles QPID – Quick Patron Information Dump (cupid…) Syllabus
Our New Books List Call Number Sorting Getting Operator Profiles QPID – Quick Patron Information Dump (cupid…)
Why present another new books list? Different strokes for different folks… ,[object Object],[object Object]
Why present another new books list? Different strokes for different folks… ,[object Object],[object Object],[object Object]
Why present another new books list? Different strokes for different folks… ,[object Object],[object Object],[object Object],[object Object]
Why present another new books list? Different strokes for different folks… ,[object Object],[object Object],[object Object],[object Object],[object Object]
New Books List Process at WMU get last month’s acquisitions
New Books List Process at WMU get last month’s acquisitions break up by department
New Books List Process at WMU get last month’s acquisitions Department X Department C Department B Department A break up by department
New Books List Process at WMU get last month’s acquisitions Department X Department C Department B Department A break up by department one text output file
New Books List Process at WMU ftp to Batch PC get last month’s acquisitions Department X Department C Department B Department A break up by department one text output file
New Books List Process at WMU put on library LAN for the Web Office ftp to Batch PC get last month’s acquisitions Department X Department C Department B Department A break up by department one text output file
New Books List Process at WMU Our production-type jobs get the database password from a file, for easy maintenance. Then use DBI to set up access to the database.
New Books List Process at WMU The query (sprintf wrapper removed for clarity)
New Books List Process at WMU Get data from the query in a loop and put in an array
New Books List Process at WMU Get rid of headphones!
New Books List Process at WMU Create sort vector and put in array
New Books List Process at WMU Got the deduping code from one of the O’Reilly Perl books. Data will implicitly be in call number order due to sort vector structure. … line noise…?
Digression… Speaking of line noise… Broken up for clarity This puts the line count of a MARC file into a shell script.
New Books List Process at WMU Now we need to get the results classified by department, going by call number ranges. raw ranges file…
New Books List Process at WMU The call number range specifications are normalized in the same manner used for sorting.
New Books List Process at WMU The call number range specifications are normalized in the same manner used for sorting. Great for the computer, not so easy  for us humans. Created a utility to make a  human-readable version. formatted ranges file…
New Books List Process at WMU The range data is read into arrays.  (If a syntactic error was found, the program stops and shows where it is.)
New Books List Process at WMU The range data is read into arrays.  (If a syntactic error was found, the program stops and shows where it is.) Then loop for each department. If the current call number falls within the current range, it goes into the current department file.
New Books List Process at WMU The output files are sorted. For our final processing, we loop through each of these sorted files of raw data. We ignore the call number chunks created during the normalization process. The desired fields are concatenated and line-wrapped. field1 | field2 | etc. how this was done…
New Books List Process at WMU As we loop through the contents of each departmental file: We split up the sort vector, and store the output fields with a vertical bar in between.
New Books List Process at WMU Some additional processing is done, including the always visually entertaining regular expression manipulations.
New Books List Process at WMU The output is line-wrapped prior to writing to the file.
New Books List Process at WMU The output is line-wrapped prior to writing to the file. You’ll need some initial setup for the above wrap to work.
New Books List Process at WMU Now we have our output file… When we first implemented our list, this was the whole process. The file was handed off to the library, where staff separated the departmental data out of the file, added the HTML, and put it on our web site. It took several hours to do this!
New Books List Process at WMU Once I knew this, I looked into further automation. Now we have an additional Perl script that takes care of the rest of the story. I looked at the new books’ web pages the library had created and figured out that I could break out three sections of static html.
New Books List Process at WMU We read the previous output file, paying attention to which department we’re “in”.
New Books List Process at WMU We read the previous output file, paying attention to which department we’re “in”. Next, we create a separate .html file for each department, incorporating the static HTML sections, adding date information where necessary.
New Books List Process at WMU We read the previous output file, paying attention to which department we’re “in”. Next, we create a separate .html file for each department, incorporating the static HTML sections, adding date information where necessary. Finally, these files are put on the library LAN and a reminder email is sent out.
New Books List Process at WMU put on library LAN for the Web Office ftp to Batch PC get last month’s acquisitions Department X Department C Department B Department A static HTML static HTML static HTML static HTML break up by department separate HTML file for each department, ready to be incorporated into the library web pages
New Books List Process at WMU See the results at:  http://www.wmich.edu/library/newbooks/index.html
Our New Books List Call Number Sorting Getting Operator Profiles QPID – Quick Patron Information Dump (cupid…)
Call Number Sorting Seems right to call it sorting, but it’s really in the  normalization  process that the “magic” occurs.
Call Number Sorting Seems right to call it sorting, but it’s really in the  normalization  process that the “magic” occurs. Uses intelligent parsing, not a quick regular expression implementation.
Call Number Sorting Seems right to call it sorting, but it’s really in the  normalization  process that the “magic” occurs. Uses intelligent parsing, not a quick regular expression implementation. Designed with LC call numbers in mind, but pretty much handles everything, including locally generated call numbers.
Call Number Sorting Seems right to call it sorting, but it’s really in the  normalization  process that the “magic” occurs. Uses intelligent parsing, not a quick regular expression implementation. Designed with LC call numbers in mind, but pretty much handles everything, including locally generated call numbers. Resulting sorts appear to be about 99% accurate (my estimate).
Call Number Sorting Seems right to call it sorting, but it’s really in the  normalization  process that the “magic” occurs. Uses intelligent parsing, not a quick regular expression implementation. Designed with LC call numbers in mind, but pretty much handles everything, including locally generated call numbers. Resulting sorts appear to be about 99% accurate (my estimate). The algorithm divides call numbers into chunks, based on separators.
Call Number Sorting Explicit separators:  colon (:)
Call Number Sorting Explicit separators:  colon (:) semicolon (;)
Call Number Sorting Explicit separators:  colon (:) semicolon (;) comma (,)
Call Number Sorting Explicit separators:  colon (:) semicolon (;) comma (,) period (.)
Call Number Sorting Explicit separators:  colon (:) semicolon (;) comma (,) period (.) space ( )
Call Number Sorting Explicit separators:  colon (:) semicolon (;) comma (,) period (.) space ( ) forward slash (/)
Call Number Sorting Explicit separators:  colon (:) semicolon (;) comma (,) period (.) space ( ) forward slash (/) Implicit separators: transitions: alpha->numeric numeric->alpha
Call Number Sorting Explicit separators:  colon (:) semicolon (;) comma (,) period (.) space ( ) forward slash (/) Implicit separators: transitions: alpha->numeric numeric->alpha During parsing, separators are absorbed, but the period may be uniquely retained.
Call Number Sorting Further processing and normalization include: Whole numbers are treated differently from decimal numbers.
Call Number Sorting Further processing and normalization include: Whole numbers are treated differently from decimal numbers. Decimal numbers may affect as many as several following chunks.
Call Number Sorting Further processing and normalization include: Whole numbers are treated differently from decimal numbers. Decimal numbers may affect as many as several following chunks. Look-ahead and look-back for one or more chunks is also employed.
Call Number Sorting demo…  democall.pl democall.lst
Call Number Sorting This code is available at: http://homepages.wmich.edu/~zimmer
Our New Books List Call Number Sorting Getting Operator Profiles QPID – Quick Patron Information Dump (cupid…)
The next two programs are designed to run on PCs, not on a Voyager box. In order to run them, you will need: Perl, (I use ActiveState)   DBI and DBD for Oracle (get from ActiveState)  Oracle Client software (from Oracle) preface
Get ActiveState Perl at: http://www.activestate.com/Products/Download/Register.plex?id=ActivePerl This puts you at the registration (optional) screen for the download. At the next page, you’ll probably want to select the “MSI” installation for Windows. Get version 5.6.1. preface
How to get DBI and DBD: Once ActivePerl is installed, open a command prompt window (DOS prompt) Run PPM Once in PPM, install DBI and DBD Exit PPM preface
Oracle Client software Required!  DBI and DBD rely on this. Check to make sure that the Oracle licensing arrangement at your site allows you to install the client software, if you do not already have a suitably equipped PC available. I used 8.1.6. The stated combination of versions is the only one I got to work. This is on machines running Windows 2000. preface
Getting Operator Profiles Demo getprof…
Getting Operator Profiles Program outline: Setup and initialization Look for each possible profile; when found: get count of affected locations get profile info format Y/N boolean values output info to file in HTML format Invoke browser to display profile data
Getting Operator Profiles Query example using the master profile
Getting Operator Profiles Do some data massaging, then use tables in HTML for formatting.
Our New Books List Call Number Sorting Getting Operator Profiles QPID – Quick Patron Information Dump (cupid…)
Patron Information Dump Demo patdump…
Patron Information Dump Program outline: Setup and initialization. Run a series of queries to get all the patron data. Take resulting data from each query and format in html, creating a file. Invoke browser to display patron data.
Both the operator profile and patron dump programs allow for choice of browser, via an .ini file, so that different users can use different browsers.
Sample .ini file
Some users like to explore… Slow down or stop them by associating an icon with the .bat file and hiding the other files. .bat normal file your choice of   browser .ini hidden, read-only .pl hidden, read-only .html normal file
The code for these two programs is available at: http://homepages.wmich.edu/~zimmer
Resources http://www.tek-tips.com/gfaqs.cfm/pid/219/fid/1711 for general installation issues on a PC http://metalink.oracle.com login, then search for 131299.1 for Pentium IV  problems with the client software install http://www.activestate.com/Products/Download/Register.plex?id=ActivePerl get your ActivePerl here http://www.wmich.edu/library/newbooks/index.html Western Michigan University new books list http://homepages.wmich.edu/~ zimmer some of the code from this presentation
Questions? Email: zimmer@wmich.edu Phone: 269.387.3885 Thanks for listening.

Contenu connexe

En vedette

Chapter 5 sets & counting
Chapter 5   sets & countingChapter 5   sets & counting
Chapter 5 sets & countingsarkissk
 
Numbers In Nonfiction
Numbers In NonfictionNumbers In Nonfiction
Numbers In Nonfictionsroyal
 
Tutorial matriks_jawapan
Tutorial matriks_jawapanTutorial matriks_jawapan
Tutorial matriks_jawapanHazlin Nazri
 
Sorting Things Out: An Introduction to Card Sorting
Sorting Things Out: An Introduction to Card SortingSorting Things Out: An Introduction to Card Sorting
Sorting Things Out: An Introduction to Card SortingStephen Anderson
 
Minimum formula for 3 x3x3 rubik cube solution - last layer permutation
Minimum formula for 3 x3x3  rubik cube solution - last layer permutationMinimum formula for 3 x3x3  rubik cube solution - last layer permutation
Minimum formula for 3 x3x3 rubik cube solution - last layer permutationPuworkUtara OnSlideshare
 
QT1 - 03 - Measures of Central Tendency
QT1 - 03 - Measures of Central TendencyQT1 - 03 - Measures of Central Tendency
QT1 - 03 - Measures of Central TendencyPrithwis Mukerjee
 
3.3 Mean, Median, Mode, Formulas
3.3 Mean, Median, Mode, Formulas3.3 Mean, Median, Mode, Formulas
3.3 Mean, Median, Mode, FormulasJessca Lundin
 
Grouped Mean Median Mode
Grouped Mean Median ModeGrouped Mean Median Mode
Grouped Mean Median ModePassy World
 
Mean, median, mode, & range ppt
Mean, median, mode, & range pptMean, median, mode, & range ppt
Mean, median, mode, & range pptmashal2013
 
Measures of central tendency
Measures of central tendencyMeasures of central tendency
Measures of central tendencyChie Pegollo
 
Mean, Median, Mode: Measures of Central Tendency
Mean, Median, Mode: Measures of Central Tendency Mean, Median, Mode: Measures of Central Tendency
Mean, Median, Mode: Measures of Central Tendency Jan Nah
 

En vedette (13)

Chapter 5 sets & counting
Chapter 5   sets & countingChapter 5   sets & counting
Chapter 5 sets & counting
 
DSKP Bahasa KadazanDusun Tahun 6
DSKP Bahasa KadazanDusun Tahun 6DSKP Bahasa KadazanDusun Tahun 6
DSKP Bahasa KadazanDusun Tahun 6
 
Numbers In Nonfiction
Numbers In NonfictionNumbers In Nonfiction
Numbers In Nonfiction
 
Tutorial matriks_jawapan
Tutorial matriks_jawapanTutorial matriks_jawapan
Tutorial matriks_jawapan
 
Sorting Things Out: An Introduction to Card Sorting
Sorting Things Out: An Introduction to Card SortingSorting Things Out: An Introduction to Card Sorting
Sorting Things Out: An Introduction to Card Sorting
 
Sorting
SortingSorting
Sorting
 
Minimum formula for 3 x3x3 rubik cube solution - last layer permutation
Minimum formula for 3 x3x3  rubik cube solution - last layer permutationMinimum formula for 3 x3x3  rubik cube solution - last layer permutation
Minimum formula for 3 x3x3 rubik cube solution - last layer permutation
 
QT1 - 03 - Measures of Central Tendency
QT1 - 03 - Measures of Central TendencyQT1 - 03 - Measures of Central Tendency
QT1 - 03 - Measures of Central Tendency
 
3.3 Mean, Median, Mode, Formulas
3.3 Mean, Median, Mode, Formulas3.3 Mean, Median, Mode, Formulas
3.3 Mean, Median, Mode, Formulas
 
Grouped Mean Median Mode
Grouped Mean Median ModeGrouped Mean Median Mode
Grouped Mean Median Mode
 
Mean, median, mode, & range ppt
Mean, median, mode, & range pptMean, median, mode, & range ppt
Mean, median, mode, & range ppt
 
Measures of central tendency
Measures of central tendencyMeasures of central tendency
Measures of central tendency
 
Mean, Median, Mode: Measures of Central Tendency
Mean, Median, Mode: Measures of Central Tendency Mean, Median, Mode: Measures of Central Tendency
Mean, Median, Mode: Measures of Central Tendency
 

Similaire à A Strand of Perls: Some Home Grown Utilities

Apache Spark Listeners: A Crash Course in Fast, Easy Monitoring
Apache Spark Listeners: A Crash Course in Fast, Easy MonitoringApache Spark Listeners: A Crash Course in Fast, Easy Monitoring
Apache Spark Listeners: A Crash Course in Fast, Easy MonitoringDatabricks
 
Spark + AI Summit 2019: Apache Spark Listeners: A Crash Course in Fast, Easy ...
Spark + AI Summit 2019: Apache Spark Listeners: A Crash Course in Fast, Easy ...Spark + AI Summit 2019: Apache Spark Listeners: A Crash Course in Fast, Easy ...
Spark + AI Summit 2019: Apache Spark Listeners: A Crash Course in Fast, Easy ...Landon Robinson
 
Using Static Binary Analysis To Find Vulnerabilities And Backdoors in Firmware
Using Static Binary Analysis To Find Vulnerabilities And Backdoors in FirmwareUsing Static Binary Analysis To Find Vulnerabilities And Backdoors in Firmware
Using Static Binary Analysis To Find Vulnerabilities And Backdoors in FirmwareLastline, Inc.
 
Understanding Framework Architecture using Eclipse
Understanding Framework Architecture using EclipseUnderstanding Framework Architecture using Eclipse
Understanding Framework Architecture using Eclipseanshunjain
 
Streaming SQL with Apache Calcite
Streaming SQL with Apache CalciteStreaming SQL with Apache Calcite
Streaming SQL with Apache CalciteJulian Hyde
 
Streaming SQL w/ Apache Calcite
Streaming SQL w/ Apache Calcite Streaming SQL w/ Apache Calcite
Streaming SQL w/ Apache Calcite Hortonworks
 
Orchestrating the Intelligent Web with Apache Mahout
Orchestrating the Intelligent Web with Apache MahoutOrchestrating the Intelligent Web with Apache Mahout
Orchestrating the Intelligent Web with Apache Mahoutaneeshabakharia
 
Real-World Pulsar Architectural Patterns
Real-World Pulsar Architectural PatternsReal-World Pulsar Architectural Patterns
Real-World Pulsar Architectural PatternsDevin Bost
 
Perl DBI Scripting with the ILS
Perl DBI Scripting with the ILSPerl DBI Scripting with the ILS
Perl DBI Scripting with the ILSRoy Zimmer
 
Web-IT Support and Consulting - dBase exports
Web-IT Support and Consulting - dBase exportsWeb-IT Support and Consulting - dBase exports
Web-IT Support and Consulting - dBase exportsDirk Cludts
 
Web-IT Support and Consulting - bulk dBase (DBF) exports via Microsoft Excel ...
Web-IT Support and Consulting - bulk dBase (DBF) exports via Microsoft Excel ...Web-IT Support and Consulting - bulk dBase (DBF) exports via Microsoft Excel ...
Web-IT Support and Consulting - bulk dBase (DBF) exports via Microsoft Excel ...Dirk Cludts
 
Deploying your Data Warehouse on AWS
Deploying your Data Warehouse on AWSDeploying your Data Warehouse on AWS
Deploying your Data Warehouse on AWSAmazon Web Services
 
CBStreams - Java Streams for ColdFusion (CFML)
CBStreams - Java Streams for ColdFusion (CFML)CBStreams - Java Streams for ColdFusion (CFML)
CBStreams - Java Streams for ColdFusion (CFML)Ortus Solutions, Corp
 
ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...
ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...
ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...Ortus Solutions, Corp
 
Hands on Mahout!
Hands on Mahout!Hands on Mahout!
Hands on Mahout!OSCON Byrum
 

Similaire à A Strand of Perls: Some Home Grown Utilities (20)

Apache Spark Listeners: A Crash Course in Fast, Easy Monitoring
Apache Spark Listeners: A Crash Course in Fast, Easy MonitoringApache Spark Listeners: A Crash Course in Fast, Easy Monitoring
Apache Spark Listeners: A Crash Course in Fast, Easy Monitoring
 
Spark + AI Summit 2019: Apache Spark Listeners: A Crash Course in Fast, Easy ...
Spark + AI Summit 2019: Apache Spark Listeners: A Crash Course in Fast, Easy ...Spark + AI Summit 2019: Apache Spark Listeners: A Crash Course in Fast, Easy ...
Spark + AI Summit 2019: Apache Spark Listeners: A Crash Course in Fast, Easy ...
 
Using Static Binary Analysis To Find Vulnerabilities And Backdoors in Firmware
Using Static Binary Analysis To Find Vulnerabilities And Backdoors in FirmwareUsing Static Binary Analysis To Find Vulnerabilities And Backdoors in Firmware
Using Static Binary Analysis To Find Vulnerabilities And Backdoors in Firmware
 
Java basics
Java basicsJava basics
Java basics
 
Understanding Framework Architecture using Eclipse
Understanding Framework Architecture using EclipseUnderstanding Framework Architecture using Eclipse
Understanding Framework Architecture using Eclipse
 
Streaming SQL with Apache Calcite
Streaming SQL with Apache CalciteStreaming SQL with Apache Calcite
Streaming SQL with Apache Calcite
 
Streaming SQL w/ Apache Calcite
Streaming SQL w/ Apache Calcite Streaming SQL w/ Apache Calcite
Streaming SQL w/ Apache Calcite
 
Well You Ought To Know (WYOTK) FP&A Automation Series
Well You Ought To Know (WYOTK) FP&A Automation SeriesWell You Ought To Know (WYOTK) FP&A Automation Series
Well You Ought To Know (WYOTK) FP&A Automation Series
 
Phpconf2008 Sphinx En
Phpconf2008 Sphinx EnPhpconf2008 Sphinx En
Phpconf2008 Sphinx En
 
Orchestrating the Intelligent Web with Apache Mahout
Orchestrating the Intelligent Web with Apache MahoutOrchestrating the Intelligent Web with Apache Mahout
Orchestrating the Intelligent Web with Apache Mahout
 
What`s New in Java 8
What`s New in Java 8What`s New in Java 8
What`s New in Java 8
 
Splunk bsides
Splunk bsidesSplunk bsides
Splunk bsides
 
Real-World Pulsar Architectural Patterns
Real-World Pulsar Architectural PatternsReal-World Pulsar Architectural Patterns
Real-World Pulsar Architectural Patterns
 
Perl DBI Scripting with the ILS
Perl DBI Scripting with the ILSPerl DBI Scripting with the ILS
Perl DBI Scripting with the ILS
 
Web-IT Support and Consulting - dBase exports
Web-IT Support and Consulting - dBase exportsWeb-IT Support and Consulting - dBase exports
Web-IT Support and Consulting - dBase exports
 
Web-IT Support and Consulting - bulk dBase (DBF) exports via Microsoft Excel ...
Web-IT Support and Consulting - bulk dBase (DBF) exports via Microsoft Excel ...Web-IT Support and Consulting - bulk dBase (DBF) exports via Microsoft Excel ...
Web-IT Support and Consulting - bulk dBase (DBF) exports via Microsoft Excel ...
 
Deploying your Data Warehouse on AWS
Deploying your Data Warehouse on AWSDeploying your Data Warehouse on AWS
Deploying your Data Warehouse on AWS
 
CBStreams - Java Streams for ColdFusion (CFML)
CBStreams - Java Streams for ColdFusion (CFML)CBStreams - Java Streams for ColdFusion (CFML)
CBStreams - Java Streams for ColdFusion (CFML)
 
ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...
ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...
ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...
 
Hands on Mahout!
Hands on Mahout!Hands on Mahout!
Hands on Mahout!
 

Plus de Roy Zimmer

Automating a Vendor File Load Process with Perl and Shell Scripting
Automating a Vendor File Load Process with Perl and Shell ScriptingAutomating a Vendor File Load Process with Perl and Shell Scripting
Automating a Vendor File Load Process with Perl and Shell ScriptingRoy Zimmer
 
Orientation Session for (New) Presenters and Moderators
Orientation Session for (New) Presenters and ModeratorsOrientation Session for (New) Presenters and Moderators
Orientation Session for (New) Presenters and ModeratorsRoy Zimmer
 
Taking Your Customers to the Cleaners: Historical Patron Data Cleanup and Rou...
Taking Your Customers to the Cleaners: Historical Patron Data Cleanup and Rou...Taking Your Customers to the Cleaners: Historical Patron Data Cleanup and Rou...
Taking Your Customers to the Cleaners: Historical Patron Data Cleanup and Rou...Roy Zimmer
 
You Can Do It! Start Using Perl to Handle Your Voyager Needs
You Can Do It! Start Using Perl to Handle Your Voyager NeedsYou Can Do It! Start Using Perl to Handle Your Voyager Needs
You Can Do It! Start Using Perl to Handle Your Voyager NeedsRoy Zimmer
 
Voyager Meets MeLCat: MC'ing the Introductions
Voyager Meets MeLCat: MC'ing the IntroductionsVoyager Meets MeLCat: MC'ing the Introductions
Voyager Meets MeLCat: MC'ing the IntroductionsRoy Zimmer
 
Plunging Into Perl While Avoiding the Deep End (mostly)
Plunging Into Perl While Avoiding the Deep End (mostly)Plunging Into Perl While Avoiding the Deep End (mostly)
Plunging Into Perl While Avoiding the Deep End (mostly)Roy Zimmer
 
Marcive Documents: Catching Up and Keeping Up
Marcive Documents: Catching Up and Keeping UpMarcive Documents: Catching Up and Keeping Up
Marcive Documents: Catching Up and Keeping UpRoy Zimmer
 
Implementing a Backup Catalog… on a Student Budget
Implementing a Backup Catalog… on a Student BudgetImplementing a Backup Catalog… on a Student Budget
Implementing a Backup Catalog… on a Student BudgetRoy Zimmer
 
Another Way to Attack the BLOB: Server-side Access via PL/SQL and Perl
Another Way to Attack the BLOB: Server-side Access via PL/SQL and PerlAnother Way to Attack the BLOB: Server-side Access via PL/SQL and Perl
Another Way to Attack the BLOB: Server-side Access via PL/SQL and PerlRoy Zimmer
 

Plus de Roy Zimmer (10)

Automating a Vendor File Load Process with Perl and Shell Scripting
Automating a Vendor File Load Process with Perl and Shell ScriptingAutomating a Vendor File Load Process with Perl and Shell Scripting
Automating a Vendor File Load Process with Perl and Shell Scripting
 
Orientation Session for (New) Presenters and Moderators
Orientation Session for (New) Presenters and ModeratorsOrientation Session for (New) Presenters and Moderators
Orientation Session for (New) Presenters and Moderators
 
Taking Your Customers to the Cleaners: Historical Patron Data Cleanup and Rou...
Taking Your Customers to the Cleaners: Historical Patron Data Cleanup and Rou...Taking Your Customers to the Cleaners: Historical Patron Data Cleanup and Rou...
Taking Your Customers to the Cleaners: Historical Patron Data Cleanup and Rou...
 
You Can Do It! Start Using Perl to Handle Your Voyager Needs
You Can Do It! Start Using Perl to Handle Your Voyager NeedsYou Can Do It! Start Using Perl to Handle Your Voyager Needs
You Can Do It! Start Using Perl to Handle Your Voyager Needs
 
Voyager Meets MeLCat: MC'ing the Introductions
Voyager Meets MeLCat: MC'ing the IntroductionsVoyager Meets MeLCat: MC'ing the Introductions
Voyager Meets MeLCat: MC'ing the Introductions
 
Plunging Into Perl While Avoiding the Deep End (mostly)
Plunging Into Perl While Avoiding the Deep End (mostly)Plunging Into Perl While Avoiding the Deep End (mostly)
Plunging Into Perl While Avoiding the Deep End (mostly)
 
Marcive Documents: Catching Up and Keeping Up
Marcive Documents: Catching Up and Keeping UpMarcive Documents: Catching Up and Keeping Up
Marcive Documents: Catching Up and Keeping Up
 
Implementing a Backup Catalog… on a Student Budget
Implementing a Backup Catalog… on a Student BudgetImplementing a Backup Catalog… on a Student Budget
Implementing a Backup Catalog… on a Student Budget
 
Another Way to Attack the BLOB: Server-side Access via PL/SQL and Perl
Another Way to Attack the BLOB: Server-side Access via PL/SQL and PerlAnother Way to Attack the BLOB: Server-side Access via PL/SQL and Perl
Another Way to Attack the BLOB: Server-side Access via PL/SQL and Perl
 
Batchhow
BatchhowBatchhow
Batchhow
 

Dernier

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Dernier (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

A Strand of Perls: Some Home Grown Utilities

  • 1. A Strand of Perls: Some Home Grown Utilities
  • 2. Our New Books List Call Number Sorting Getting Operator Profiles QPID – Quick Patron Information Dump (cupid…) Syllabus
  • 3. Our New Books List Call Number Sorting Getting Operator Profiles QPID – Quick Patron Information Dump (cupid…)
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. New Books List Process at WMU get last month’s acquisitions
  • 9. New Books List Process at WMU get last month’s acquisitions break up by department
  • 10. New Books List Process at WMU get last month’s acquisitions Department X Department C Department B Department A break up by department
  • 11. New Books List Process at WMU get last month’s acquisitions Department X Department C Department B Department A break up by department one text output file
  • 12. New Books List Process at WMU ftp to Batch PC get last month’s acquisitions Department X Department C Department B Department A break up by department one text output file
  • 13. New Books List Process at WMU put on library LAN for the Web Office ftp to Batch PC get last month’s acquisitions Department X Department C Department B Department A break up by department one text output file
  • 14. New Books List Process at WMU Our production-type jobs get the database password from a file, for easy maintenance. Then use DBI to set up access to the database.
  • 15. New Books List Process at WMU The query (sprintf wrapper removed for clarity)
  • 16. New Books List Process at WMU Get data from the query in a loop and put in an array
  • 17. New Books List Process at WMU Get rid of headphones!
  • 18. New Books List Process at WMU Create sort vector and put in array
  • 19. New Books List Process at WMU Got the deduping code from one of the O’Reilly Perl books. Data will implicitly be in call number order due to sort vector structure. … line noise…?
  • 20. Digression… Speaking of line noise… Broken up for clarity This puts the line count of a MARC file into a shell script.
  • 21. New Books List Process at WMU Now we need to get the results classified by department, going by call number ranges. raw ranges file…
  • 22. New Books List Process at WMU The call number range specifications are normalized in the same manner used for sorting.
  • 23. New Books List Process at WMU The call number range specifications are normalized in the same manner used for sorting. Great for the computer, not so easy for us humans. Created a utility to make a human-readable version. formatted ranges file…
  • 24. New Books List Process at WMU The range data is read into arrays. (If a syntactic error was found, the program stops and shows where it is.)
  • 25. New Books List Process at WMU The range data is read into arrays. (If a syntactic error was found, the program stops and shows where it is.) Then loop for each department. If the current call number falls within the current range, it goes into the current department file.
  • 26. New Books List Process at WMU The output files are sorted. For our final processing, we loop through each of these sorted files of raw data. We ignore the call number chunks created during the normalization process. The desired fields are concatenated and line-wrapped. field1 | field2 | etc. how this was done…
  • 27. New Books List Process at WMU As we loop through the contents of each departmental file: We split up the sort vector, and store the output fields with a vertical bar in between.
  • 28. New Books List Process at WMU Some additional processing is done, including the always visually entertaining regular expression manipulations.
  • 29. New Books List Process at WMU The output is line-wrapped prior to writing to the file.
  • 30. New Books List Process at WMU The output is line-wrapped prior to writing to the file. You’ll need some initial setup for the above wrap to work.
  • 31. New Books List Process at WMU Now we have our output file… When we first implemented our list, this was the whole process. The file was handed off to the library, where staff separated the departmental data out of the file, added the HTML, and put it on our web site. It took several hours to do this!
  • 32. New Books List Process at WMU Once I knew this, I looked into further automation. Now we have an additional Perl script that takes care of the rest of the story. I looked at the new books’ web pages the library had created and figured out that I could break out three sections of static html.
  • 33. New Books List Process at WMU We read the previous output file, paying attention to which department we’re “in”.
  • 34. New Books List Process at WMU We read the previous output file, paying attention to which department we’re “in”. Next, we create a separate .html file for each department, incorporating the static HTML sections, adding date information where necessary.
  • 35. New Books List Process at WMU We read the previous output file, paying attention to which department we’re “in”. Next, we create a separate .html file for each department, incorporating the static HTML sections, adding date information where necessary. Finally, these files are put on the library LAN and a reminder email is sent out.
  • 36. New Books List Process at WMU put on library LAN for the Web Office ftp to Batch PC get last month’s acquisitions Department X Department C Department B Department A static HTML static HTML static HTML static HTML break up by department separate HTML file for each department, ready to be incorporated into the library web pages
  • 37. New Books List Process at WMU See the results at: http://www.wmich.edu/library/newbooks/index.html
  • 38. Our New Books List Call Number Sorting Getting Operator Profiles QPID – Quick Patron Information Dump (cupid…)
  • 39. Call Number Sorting Seems right to call it sorting, but it’s really in the normalization process that the “magic” occurs.
  • 40. Call Number Sorting Seems right to call it sorting, but it’s really in the normalization process that the “magic” occurs. Uses intelligent parsing, not a quick regular expression implementation.
  • 41. Call Number Sorting Seems right to call it sorting, but it’s really in the normalization process that the “magic” occurs. Uses intelligent parsing, not a quick regular expression implementation. Designed with LC call numbers in mind, but pretty much handles everything, including locally generated call numbers.
  • 42. Call Number Sorting Seems right to call it sorting, but it’s really in the normalization process that the “magic” occurs. Uses intelligent parsing, not a quick regular expression implementation. Designed with LC call numbers in mind, but pretty much handles everything, including locally generated call numbers. Resulting sorts appear to be about 99% accurate (my estimate).
  • 43. Call Number Sorting Seems right to call it sorting, but it’s really in the normalization process that the “magic” occurs. Uses intelligent parsing, not a quick regular expression implementation. Designed with LC call numbers in mind, but pretty much handles everything, including locally generated call numbers. Resulting sorts appear to be about 99% accurate (my estimate). The algorithm divides call numbers into chunks, based on separators.
  • 44. Call Number Sorting Explicit separators: colon (:)
  • 45. Call Number Sorting Explicit separators: colon (:) semicolon (;)
  • 46. Call Number Sorting Explicit separators: colon (:) semicolon (;) comma (,)
  • 47. Call Number Sorting Explicit separators: colon (:) semicolon (;) comma (,) period (.)
  • 48. Call Number Sorting Explicit separators: colon (:) semicolon (;) comma (,) period (.) space ( )
  • 49. Call Number Sorting Explicit separators: colon (:) semicolon (;) comma (,) period (.) space ( ) forward slash (/)
  • 50. Call Number Sorting Explicit separators: colon (:) semicolon (;) comma (,) period (.) space ( ) forward slash (/) Implicit separators: transitions: alpha->numeric numeric->alpha
  • 51. Call Number Sorting Explicit separators: colon (:) semicolon (;) comma (,) period (.) space ( ) forward slash (/) Implicit separators: transitions: alpha->numeric numeric->alpha During parsing, separators are absorbed, but the period may be uniquely retained.
  • 52. Call Number Sorting Further processing and normalization include: Whole numbers are treated differently from decimal numbers.
  • 53. Call Number Sorting Further processing and normalization include: Whole numbers are treated differently from decimal numbers. Decimal numbers may affect as many as several following chunks.
  • 54. Call Number Sorting Further processing and normalization include: Whole numbers are treated differently from decimal numbers. Decimal numbers may affect as many as several following chunks. Look-ahead and look-back for one or more chunks is also employed.
  • 55. Call Number Sorting demo… democall.pl democall.lst
  • 56. Call Number Sorting This code is available at: http://homepages.wmich.edu/~zimmer
  • 57. Our New Books List Call Number Sorting Getting Operator Profiles QPID – Quick Patron Information Dump (cupid…)
  • 58. The next two programs are designed to run on PCs, not on a Voyager box. In order to run them, you will need: Perl, (I use ActiveState) DBI and DBD for Oracle (get from ActiveState) Oracle Client software (from Oracle) preface
  • 59. Get ActiveState Perl at: http://www.activestate.com/Products/Download/Register.plex?id=ActivePerl This puts you at the registration (optional) screen for the download. At the next page, you’ll probably want to select the “MSI” installation for Windows. Get version 5.6.1. preface
  • 60. How to get DBI and DBD: Once ActivePerl is installed, open a command prompt window (DOS prompt) Run PPM Once in PPM, install DBI and DBD Exit PPM preface
  • 61. Oracle Client software Required! DBI and DBD rely on this. Check to make sure that the Oracle licensing arrangement at your site allows you to install the client software, if you do not already have a suitably equipped PC available. I used 8.1.6. The stated combination of versions is the only one I got to work. This is on machines running Windows 2000. preface
  • 62. Getting Operator Profiles Demo getprof…
  • 63. Getting Operator Profiles Program outline: Setup and initialization Look for each possible profile; when found: get count of affected locations get profile info format Y/N boolean values output info to file in HTML format Invoke browser to display profile data
  • 64. Getting Operator Profiles Query example using the master profile
  • 65. Getting Operator Profiles Do some data massaging, then use tables in HTML for formatting.
  • 66. Our New Books List Call Number Sorting Getting Operator Profiles QPID – Quick Patron Information Dump (cupid…)
  • 67. Patron Information Dump Demo patdump…
  • 68. Patron Information Dump Program outline: Setup and initialization. Run a series of queries to get all the patron data. Take resulting data from each query and format in html, creating a file. Invoke browser to display patron data.
  • 69. Both the operator profile and patron dump programs allow for choice of browser, via an .ini file, so that different users can use different browsers.
  • 71. Some users like to explore… Slow down or stop them by associating an icon with the .bat file and hiding the other files. .bat normal file your choice of browser .ini hidden, read-only .pl hidden, read-only .html normal file
  • 72. The code for these two programs is available at: http://homepages.wmich.edu/~zimmer
  • 73. Resources http://www.tek-tips.com/gfaqs.cfm/pid/219/fid/1711 for general installation issues on a PC http://metalink.oracle.com login, then search for 131299.1 for Pentium IV problems with the client software install http://www.activestate.com/Products/Download/Register.plex?id=ActivePerl get your ActivePerl here http://www.wmich.edu/library/newbooks/index.html Western Michigan University new books list http://homepages.wmich.edu/~ zimmer some of the code from this presentation
  • 74. Questions? Email: zimmer@wmich.edu Phone: 269.387.3885 Thanks for listening.