Showing posts with label coding. Show all posts
Showing posts with label coding. Show all posts

Monday, June 4, 2012

Library Code Year Interest Group at ALA

The LITA/ALCTS Library Code Year IG will be having our first meeting at ALA Annual 2012 (#ala12) in Anaheim, CA and we need your help. We are looking for speakers to give lightening talks!

Call for Speakers

What strategies, or roadblocks, have you found in learning to code? How have you used programming to improve library service models or workflows?

The Library Code Year Interest Group seeks speakers for lightening talks (5 minutes) on any aspect of coding and libraries, including projects you have completed, your experience learning to code or thoughts on projects you would like to see in the future.  Speakers at all levels of coding skill and from all types of library backgrounds are invited to participate.


Our meeting at ALA Annual in Anaheim will be Saturday, June 23, 1:30-3:30pm at the Doubletree Suites (Tuscany AB). You can find it on the ALA Scheduler here. The inaugural meeting of the Library Code Year Interest Group will provide an opportunity for members to discuss how they have used what they have learned through Code Year in their jobs and to discuss roadblocks they have encountered along the way through a combination of lightening talks and roundtable discussions. Attendees will learn ways that the code they are learning can be used in libraries and have a chance to share their experiences learning and using code. We will end with a brainstorming session on how the IG can support members’ efforts to learn and apply code in libraries.

Feel free to contact me with any questions at slmcdanold@gmail.com or mcdanold@pobox.upenn.edu or post your thoughts on our Connect page.

Even if you don't want to give a talk, I hope to see you there! 

Thursday, February 9, 2012

Learning Python

Last September I participated in a one day full day basic Introduction to Python for Women workshop sponsored by PyStarPhilly. It was good exposure, but it didn't stick all that much.

Fortunately, they decided to hold the workshop again (details here), and this time made it even longer, starting on Friday night and all day on Saturday last weekend.

Friday night started with making sure the Python install on my machine I did last September was still OK, and that Notepad++ was up to date. And making friends again with my cmd window, which I also use to run the Perl scripts at work. Whee my cmd skills are rusty. But between work and this workshop, it's all surfacing from the deep recesses of my brain.

The rest of Friday can be summed up thusly: practice practice practice. The PyStar ladies have posted a series of exercises to practice the basics of Python on CodingBat. These exercises reinforce the concepts covered and force you to think through things.

Saturday morning began with completing Friday's CodingBat exercises and working through some Saturday morning review exercises. Practice practice practice!

A few things I learned while working on the exercises:

  • spaces don't matter so much, although including spaces makes the code more readable
  • punctuation matters!
  • capitalization is noticed, so A =/= a, in other words, machines are very literal!
It is definitely sticking better this time. Between more coding stuff at work, plus Code Year, it's all starting to come together in my brain. I got farther with the exercises this time, and was able to reason through (or talk myself through) when I got stuck.

After a bit of warmup practice, we had a morning lecture. The goal of the lecture was for us to be able to write simple scripts on our own by the end of it. We reviewed the material in the morning exercises (equations, functions, etc.) and covered loops, while loops, input statements, dictionaries, more detailed functions, modules and packages. Also a brief description of libraries.

And then it was back to practice practice practice.

Another challenge I discovered: indentations. Where your indentations are impacts what your code returns, so you have to be careful what you embed under other things, versus what you want to do at the end. Often I wrote the code correctly, but indented it too far relating it to something it shouldn't be related to, producing no result, not even an error message. At one point I nearly created a recursive loop by indenting too far. Oops.

After lunch we had a few lightning talks, where people shared various code they're written for projects. It's encouraging to see what people have built; even more so that I can read and understand the code they wrote! The talks involved editing images (adding text), predictive puzzle solving (the Tower of Hanoi puzzle),   and a very cool project working with 7 to 13 year old girls and the Tropo simple API. We also looked at a very neat page of data visualization and graphical plotting options using Python at matplotlib.sourceforge.net.

The talks also include some more learn to code resources. I'll be posting the new ones I learned about to the catcode wiki resources page.

After the lightening talks, they gave us a project to work on (in addition to the CodingBat exercises) involving using Twitter's API to call recent tweets and trending topics. Challenging but so satisfying when you get it!


Monday, February 6, 2012

Why am I learning to code?

Why am I learning to code. I get asked this a fair amount these days. Why would a librarian want to learn to code? What good is it for my job?

I alluded to it in my first post on the catcode phenomenon: "Catalogers work with massive amounts of curated bibliographic data, and being able to manipulate it in new and different ways and in ever increasing amounts is key as we move forward into the bibliographic future and the world of linked data and the semantic web."

But that's a pretty generic statement. And doesn't explain much. I usually end up giving some examples of how coding would be (or already is) used in my current day to day work:

1. Editing of record sets prior to loading - beyond MarcEdit

All of our batch loads of MARC records for various collections go through a basic editing process. We have a standardized set of edits that all of our records go through to normalize certain elements and insert local-specific notes about access restrictions and our licenses. These edits are all combined in a script to facilitate the process. All sets are quickly run through the script as a first step of the loading process. Currently when something changes (like a change to MARC coding or the need to add something or add a conditional for another format such as images), I have to ask our systems folks to edit the script, I review it, we test it, and then it's put into regular use. If I could make the edits and test it myself the process would be much more efficient.

Often I have very large sets and potentially complicated edits that need to be made. MarcEdit has a script editor that allows me do make a series of basic conditional edits, but for more complicated things I'm still limited to asking our systems staff to write a script.

For example, our records from ProQuest for the online version of our dissertations come in with subject codes that are proprietary to ProQuest and their indexes. For these to be useful for our users for searching, they need to be mapped to valid Library of Congress Subject Headings. I can build a cross-walk in a spreadsheet for the mapping, but I need a script to run the records through a process to actually match on the codes in the records in the file and insert the LCSH heading.

2. Reports from our system (or from any large file of records)

The only mechanism for getting a report from our current ILS (Voyager) is via script. There's no reporting interface. Like with script editing, I have to pester systems folks to help me. And it can be a tedious process. I tell them what I need (being as clear and specific as possible within the bounds of how confusing MARC is and the myriad of exceptions/variations that exist). They then take my request, and turn the query into a script (interpreting things in the process), run it, and send it to me for review. If we're lucky, we get it right the first time. More often than not, there's errors, and exceptions, and quite a bit of back and forth before we get it right.

If I could gain some experience in coding, I could hopefully reduce the back and forth and write the exceptions and variations into my query request, essentially cutting out the middle man interpretation. Having a better understanding of what is possible to write into a query based on the data and how "clean" it is (or isn't) is invaluable.

3. Batch editing of records already in the system

Just because something is already cataloged and loaded doesn't mean you can ignore it. Records require maintenance. Rules change, headings change, tags change, new fields and subfields are added, etc. etc. MARC as a standard is changing regularly. Names are updated in authority files, subjects are created, collapsed, divided, etc. And we have to keep our data up to date so it's actually useful to our users and so relationships are maintained. All of this updating requires editing a very large batch of data. It starts with getting an effective/accurate report of things that need updating, and then telling the system what needs to change. A big thing that would be useful to articulate more clearly is conditional edits...add this field but only if these things are true. But if your instructions to the system isn't clear you end up with a big mess that you have to undo and try again, which is time consuming and most likely also problematic for user access until you clean things up (or undo). Once you have a better understanding of how to write the instructions, the number of messes decreases exponentially. And less mess is always a good thing when dealing with data that  potentially impacts user access.

4. Loading of records in bulk

There are set of profiles used for loading records into our ILS. Distilled down, they are a series of scripts dictating the modification and creation of bibliographic, holdings, and item records. The specifics of each load determine which profile is most appropriate. I don't have a good understanding of these profiles because my understanding of coding is still limited. I'm hoping learning coding will give me a better understanding so I may better advise which profile is more appropriate.

A good example of why this would be useful. A few months ago we tried to load a set of records into our system. Both the colleague in systems and myself being unfamiliar with the profiles, we picked the one we thought was correct. Well, given her unfamiliarity with MARC and library records, and my unfamiliarity with coding and in reading the profiles, we blundered and used the wrong one. We made a bit of a mess of things in our production catalog (hello error message displayed to the public) and had fix things after the load, once we figured out what we did wrong, of course. Our blunder created quite a bit of extra work for both of us.

5. System design / user interface design / etc.


We're currently in the process of redesigning our public interface to our catalog (our OPAC). This means dealing with indexes and the underlying data in different ways. Having a good solid understanding of the data means I can explain what data is useful and what our data can and cannot do. Writing functional specifications for the use/manipulation of the data so the coders can go to work. Having a solid understanding of how systems talk to each other and where data lives helps immensely. Learning to code helps me do all of that.



I think an overarching theme of all the above examples is communication. To be able to explain things to coders, and to understand the questions from coders, and explain things to catalogers, and non-catalogers, and effectively talk/explain my needs to the systems themselves, I need to have a better understanding of how it all works. Learning coding helps with that. It's like learning another language. If I can be even semi-fluent in coding, things will be much clearer for everyone involved in the conversation. Even if I don't become a full-fledged coder, the exposure I'm gaining from participating in Code Year and workshops on Python and attending project nights and talks about various coding languages and systems is already proving to be invaluable.

Saturday, January 28, 2012

Talking about Code Year

It's really weird to watch yourself talk. And listen to yourself. Oh boy.

Anyway, here's a link to Andromeda Yelton and I talking about the Code Year phenomenon and what we've got going on:

http://americanlibrariesmagazine.org/ala-members-blog/beginning-lita-code-year-interest-group



[Note: I'm on the left, wearing the Stewie from Family Guy "OBEY ME!" lanyard.]

Watch. And then come join us!! Thanks to Tina Coleman for posting her video and sharing it. :)

We are working on making the ALA Interest Group a joint LITA/ALCTS venture. There are far too many catalogers involved fro ALCTS to not participate! Yay for dialogue between catalogers and coders!

Catcode twitter list
Catcode wiki
Code Year on ALA Connect


Tuesday, January 10, 2012

Code Year, the first week

Again, I am overwhelmed by the interest in the Code Year project from fellow catalogers. Kudos to everyone for taking on the challenge of learning to code. It's time to dive in and get dirty!

How is the first week of Code Year 2012 for everyone (Code Year Course list/Calendar)? Did you complete the course yet or are you working on it bit by bit (lesson by lesson) all week? Who did the Supplemental lesson?

Did you feel like tearing your hair out? Or was it fun? Or was it both?

Who got started early? I admittedly signed up for Codecademy this weekend and plowed through the first 4 lessons of Getting Started with Programming course. I'll be working on the other half of the course lessons throughout the week. I know it will help to cement it in my brain if I spread it out and have to keep going back and reviewing. I also have a sneaking suspicion I might have to create a command cheat sheet until they stick in my brain.

A trouble spot for me I've already identified: TYPOS. Lordy. Talk about error messages. I had to re-do a few of the lessons just because of typos. I know I have some minor dyslexia (spellchecker was invented for people like me, I swear it's true), and I've learned I need to be extra careful when coding or writing in mark-up language(s) (HTML, MARC, etc.) where capitalization, spelling, and punctuation are critical. That was reinforced quite strongly by a couple of the coding lessons this week (damn "ReferenceError:" returns). Clearly I have to take my time, work carefully, and can't do this when distracted or frequently interrupted so I don't lose my focus. At least not yet. Maybe when I'm more comfortable/experienced I'll be able to code successfully in my office. But for right now I need a quiet environment (no distractions) where I'm not interrupted by questions/staff/colleagues/etc.

What are your trouble spots? Does noise distract you or do you like music while you work? Does a busy environment help or hinder?

Oh, btw, I've learned that M&Ms help the coding process. ;)

Resources:



Thursday, January 5, 2012

CatCode is born!

The number of people interested in the Code Year 2012 catcode project has grown by leaps and bounds the past few days! I'm slightly overwhelmed. I'm also stupidly excited and keep doing a little happy dance in my chair at work with each new person that adds themselves as a participant. I can hardly keep up with all the Twitter messages and post comments! To see the growing list, check out my previous post. I've been actively updating the post to add names as I receive them.

To help facilitate participation going forward, I've created a space in PBWiki for all of us to use: CatCode is born! The CodeYear project may have spawned the space, but my hope is that it becomes a more general space for dialogue and learning for catalogers and coders beyond the CodeYear project. A girl can dream, right?

Please go visit the wiki and sign up as a user (it's free!). Once your access has been granted (please be patient with me on verifying you! I'm trying to prevent spammers), please update your information on the Participants page. If you submitted your name before, I've pre-populated the participant's table with some information...please find your info and update it!

We (my partners in crime and I) are still working on setting up a discussion/q&a space. We'll post the information far and wide as soon as it's ready.

And don't forget to follow the Twitter list too! Catcode and send a message on Twitter to me to add yourself to the list. We're also using #catcode as the hashtag.

Tuesday, January 3, 2012

CodeYear Catalogers

CodeAcademy is offering an excellent opportunity for anyone interested in getting started with coding: Code Year. Each week they'll be emailing out to anyone that signs up an interactive lesson on coding. Code Academy offers some fantastic interactive courses, so you learn in a supportive environment.

Naturally this has piqued the interest of a number of catalogers that have been interested in learning to code or want to brush up or learn new code languages, myself included. Catalogers work with massive amounts of curated bibliographic data, and being able to manipulate it in new and different ways and in ever increasing amounts is key as we move forward into the bibliographic future and the world of linked data and the semantic web.

So I started compiling names. This is my curated list of catalogers on Twitter participating in CodeYear so far:

@slmcdanold (me)
@lauramac95
@jaleh_f
@erinaleach
@HLPitts
@yo_bj (no longer has cataloger in her title but it's in her soul)
@jen_young
@cjclib
@cursedstorm
@enimsakont
@debdegeorge
@evil_jen
@chrpr (not a cataloger...but we like him anyway)
@amyrpennington
@skiddie2
@johnmac38
@wabashcanonball
@EstherArens
@lagina
@sidesmirk
@libdespot
@shelitwits
@AnneWelsh
@yanajenn
@orangeaurochs 
@maryacat
@campbell_b
@strong_stuff
@dchud
@lrobare
@ahitchens
@dorevabelfiore
@kate80
@jenniferswright
@SuzanGriffiths
@lynncorrigan
@alyssa_briggs 
@springyrice
@caschwartz (no longer has cataloger in her title but it's in her soul)
@HtebLuap
@prburley
@frleibo
@cololibrarygirl
@srodr2
@htomren
@shomj
@rachelmcw
@schammond
@StephenTEarly
@cindywho23
@Headstrongways
@ynde
@ces43
@infod1va
@teagueamania
@israelcsus
@meta_cat
@diriwh
@bibliosaurustxt
@pikesar
@BarbaraBrownell
@tminchew
@keribrary
@lrts
@barnlib
@adriennerad
@spaghettiwall
@zemkat
@AhavaCohen
@deans
@catlib56
@bookmender11
@diseming
@jnavia
@violibrarian
@egelliott
@koklbr
@plummerkaren
@nossis
@PhillyKatia
@jmyntti
@mrlindner
@metalib
@AllisonJaiODell
@strettoc 
@bohyunkim
@wendyrlibrarian
@maggienunley
@alison_felstead
@RachaelCohen1
@bibliographics 

Add yourself to the list by posting your Twitter handle as a comment. I'll update as needed. :) You can also send me a message via Twitter (@slmcdanold) and add yourself that way. Or use the newly created hashtag #catcode (thanks @chrpr for the suggestion)!

There is now an actual LIST on Twitter: catcode. Subscribe!

If you're not on Twitter, let me know where we should email you when we get some sort of wiki/webpage/IRC channel going so we can all suffer learn together and help each other.

Non-Twitter list:

Cecilia G. (gener002@umn.edu)
Joe O. (Joe_Orth@ca6.uscourts.gov)
Martin J. (martin.jenkins@wright.edu)
Nancy H. (nancy.hunter@colostate.edu)
Ann H. (alh5456@sbcglobal.net) [on Twitter as @alh5456 but forgets to use it. ;) ]
chrisallenstanton@gmail.com
Susie R. (sridgeway@me.com)
Deborah Tomaras (dtomaras@southportland.org)
Melodie Frances (mfrances@gtu.edu)
Linda Frankel (lf92355@gmail.com)
Leigh Billings (rednaal@umich.edu)
Bill Anderson (William.Anderson@ct.gov)
Catherine Kellett (catherine.kellett@yale.edu)
Christine DeZelar-Tiedman (dezel002@umn.edu)
Cindy (cbarrilleaux@slol.lib.la.us)
Ashley Dietrick (akdietrick@gmail.com)
Joan Milligan (jmilligan1@udayton.edu)
Chris Blackman (cblackma@williams.edu)
Kristi Bergland (krisser@gmail.com)
Euem C. Osmera (eosmera@unmc.edu)
flinchba@umbc.edu
David A. Johnson (djohnson@highline.edu)
deg7@nyu.edu
Pauline (myrtlebell@centurylink.net)
Mike Mitchell (deeptexas10@gmail.com)
R.A. Stewart (rstewart@indiantrailslibrary.org)
Melissa VanTine (melissa.vantine@yale.edu
Tina (spielmat@uwm.edu
Carolyn (chufford@gmail.com
Julie (julie.howe@kctcs.edu) 
Peter Rolla (peter_rolla@hms.harvard.edu)  
lloydgerard@hotmail.com
kvalenzuela@csustan.edu